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

News:

CPG Release 1.6.29
During HTML5 upload, keep pseudo blank code 200 messages from triggering error condition
added Russian language
correct failure to use theme menu icons in album manager
minor vulnerabilities mitigation

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