forum.coppermine-gallery.net
Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: alexpalermoo on December 17, 2007, 05:16:26 pm
-
Hey!
I have been looking everywhere for a code like "http://www.breatheheavy.com"...they have the latest pictures from thier coppermine gallery automatically updated on their non-coppermine gallery page (the index page of the site)...and i need help trying to find the code! thanks!
-
nd im not using CMPFetch thingy...just a simple code...
-
nd im not using CMPFetch thingy...just a simple code...
the you must code it yourself ;)
-
Doesn't get simpler than that.
-
<?php
// MYSQL connect info here
// Alter `cpg1411` to the table prefix you use
$sql = 'SELECT filename,filepath FROM `cpg1411_pictures` ORDER BY ctime DESC LIMIT 10;';
// Alter the number after LIMIT to define the number of pictures you want
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
echo '<img src="';
echo $row['filepath'];
echo $row['filename'];
echo '" />';
}
?>
That will start you off, you may need to alter the code etc. I know this is'nt support for coppermine, but i had a few free minutes.
-
what is the CMPFetch?
will it get what i want?
-
I DID IT!!!!! soo thanks for the people who helped!