Advanced search  

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]

Pages: [1]   Go Down

Author Topic: How do I get a specifik category via RSS?  (Read 4248 times)

0 Members and 1 Guest are viewing this topic.

knugen

  • Guest
How do I get a specifik category via RSS?
« 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..

Code: [Select]
$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
Logged

freesouljah

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 116
  • Can you feel the Love?
    • freesouljah.com
Re: How do I get a specifik category via RSS?
« Reply #1 on: September 07, 2007, 06:01:39 am »

I would use php include...


code to use with cpg and cpmfetch:
Code: [Select]
  <?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:

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



keep the peace,
freesouljah

freesouljah

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 116
  • Can you feel the Love?
    • freesouljah.com
Re: How do I get a specifik category via RSS?
« Reply #2 on: September 07, 2007, 06:07:44 am »

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

Code: [Select]
$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
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 15 queries.