coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: knugen on September 01, 2007, 05:56:49 PM

Title: How do I get a specifik category via RSS?
Post by: knugen on September 01, 2007, 05:56:49 PM
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
Title: Re: How do I get a specifik category via RSS?
Post by: freesouljah on September 07, 2007, 06:01:39 AM
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
Title: Re: How do I get a specifik category via RSS?
Post by: freesouljah on September 07, 2007, 06:07:44 AM
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