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

Title: a simple code for using the latest images on an HTML page...
Post 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!
Title: Re: a simple code for using the latest images on an HTML page...
Post by: alexpalermoo on December 17, 2007, 05:21:18 pm
nd im not using CMPFetch thingy...just a simple code...
Title: Re: a simple code for using the latest images on an HTML page...
Post by: François Keller on December 17, 2007, 05:31:52 pm
nd im not using CMPFetch thingy...just a simple code...
the you must code it yourself  ;)
Title: Re: a simple code for using the latest images on an HTML page...
Post by: Joachim Müller on December 17, 2007, 05:38:49 pm
Doesn't get simpler than that.
Title: Re: a simple code for using the latest images on an HTML page...
Post by: just_some_guy on December 17, 2007, 06:08:31 pm
Code: [Select]
<?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.

Title: Re: a simple code for using the latest images on an HTML page...
Post by: alexpalermoo on December 17, 2007, 07:20:30 pm
what is the CMPFetch?
will it get what i want?
Title: Re: a simple code for using the latest images on an HTML page...
Post by: alexpalermoo on December 17, 2007, 08:46:02 pm
I DID IT!!!!! soo thanks for the people who helped!