forum.coppermine-gallery.net
Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: mauba on June 19, 2008, 08:22:17 pm
-
How can I display the three last added album and their names om my home page ?
-
The actual time that the album was created is not logged, however this is possible by ordering the results by the album id (aid) field as this is an auto_increment field; meaning the id of each album is bigger the later it is created.
This assumes that your "home page" is outside coppermine.
<?php
/*Assuming you have already connected to the database. */
$prefix = 'cpg14x_';
$lastalb = mysql_query("SELECT title FROM {$prefix}albums ORDER BY aid DESC LIMIT 3");
echo 'The latest albums are - <ul> ';
while ($row = mysql_fetch_array($lastalb)) {
echo '<li>'.$row['title'].'</li>';
}
echo '</ul>';
?>
Adjust the $prefix variable to suit your gallery prefix.
PS - This is not using cpmFetch.
-
Look at my page.
The pics display are calling with cpmfetch
The error is code that you sent. do you I have to declare the user and password in the code ?
How can I do ?
-
Here is the page:
http://www.pibsm.com.br/index.php
-
Its because you have not properly connected to MySQL or your login does not have the correct permissions etc.
-
I want to display not private albums.
Whatīs wrong ?
Is it necessary declare the password ?
I put the code on my home page to call the albums from cpm but the albums arenīs shown.
-
How can I do it with cpmfetch ?