Separate latest and random pics... Separate latest and random pics...
 

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

Separate latest and random pics...

Started by adnoctum, November 02, 2006, 05:07:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

adnoctum

First of all, great stuff !

I got it to work on a site, I used this code...


<?php
include "galleri/cpmfetch/cpmfetch.php";
$objCpm = new cpm('/galleri');
$objCpm->cpm_viewLastAddedMedia (2,1,array("imagestyle" => "test1"));
$objCpm->cpm_viewRandomMedia (2,1,array("imagestyle" => "test1"));
$objCpm->cpm_close();
?>



But, I would like to separate "latest added" and "random" from each other, and have random at one place on my mainpage and latest at a different place.I did try to make two php include files out of it, one for latest and one for random.

I get the following error message: "Fatal error: Cannot redeclare class cpm in "LINK TO CPMFETCH.PHP" on line 33.

How can I get it to work ?

vuud


Easy.  You just "reuse" your $objCpm...

Here is how...


<-- This is at the top of your file -->
<?php
include "galleri/cpmfetch/cpmfetch.php";
$objCpm = new cpm('/galleri');
?>


... html, other stuff goes here - whatever

<?php
$objCpm
->cpm_viewLastAddedMedia (2,1,array("imagestyle" => "test1"));
?>


... more html, whatever...

<?php
$objCpm
->cpm_viewRandomMedia (2,1,array("imagestyle" => "test1"));
?>


... more html, whatever...

<!-- this is the bottom of your file -->
<?php
$objCpm
->cpm_close();
?>



You do that as many times as you want, just have one "new" and one "close".
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco