How do I get a specifik category via RSS? How do I get a specifik category via RSS?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

How do I get a specifik category via RSS?

Started by knugen, September 01, 2007, 05:56:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

knugen

Hi.
I want to show random pictures from coppermine on another webb page.

I want to show s specifik category.

First of all, i'm not sure if i should call
cfrssget.php or rss_lastadded.php.

this is my simple code..


$url = "http://....../cpmfetch/cfrssget.php";
$rss = fetch_rss($url);

foreach ($rss->items as $item ) {

echo "".$item['description']."<br /><br />";

}


anyone have a sollution? ???

Knugen of Stockholm

freesouljah

I would use php include...


code to use with cpg and cpmfetch:
  <?php
include $_SERVER['DOCUMENT_ROOT'].'/WEBSITE#1/cpmfetch/cpmfetch.php';
  $objCpm = new cpm("./pics/cpmfetch/cpmfetch_config.php");

$options = array("subtitle" => "%f","imagesize" => "thumb","windowtarget" => '_blank');

$objCpm->cpm_viewRandomMedia(1,3,$options);
$objCpm->cpm_close();
?>



save that code as random.php in the same directory as cpg...and then use the php include to include that page onto the page on your other website:

      <?php
  include 'http://www.WEBSITE#1.com/random.php';
  
?>




keep the peace,
freesouljah

freesouljah

oh yeah...to get it from a category, you need to use this as your $objCpm:

$objCpm->cpm_viewRandomMediaFrom("cat=XXX",1,3,$options);


and XXX should be replaced by the category number you want to use...


keep the peace,
freesouljah