Hi,
I just discovered the nice possibility to add the last modified albums to the main page with "lastalb".
(See
http://coppermine.sourceforge.net/manual.php#changing).
I use each one album for one event, so after creating the album once, I don't change it anymore.
Therefore I would like to see in "lastalb" the picture which is shown in the normal album list instead of the last added picture.
Is there anybody who could help me what I have to change in the code? It should be in the function "get_pic_data" in the file "include/functions.inc.php", line 755 - 784 (using CPG 1.21)
I quote the important part here, perhaps somebody with more php and mysql knowlege could help. Thanks!
case 'lastalb': // Last albums to which uploads
if ($ALBUM_SET && $CURRENT_CAT_NAME) {
$album_name = $lang_meta_album_names['lastalb'].' - '. $CURRENT_CAT_NAME;
} else {
$album_name = $lang_meta_album_names['lastalb'];
}
$ALBUM_SET = str_replace( "aid", $CONFIG['TABLE_PICTURES'].".aid" , $ALBUM_SET );
$result = db_query("SELECT COUNT(*) from {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $ALBUM_SET");
$nbEnr = mysql_fetch_array($result);
$count = $nbEnr[0];
mysql_free_result($result);
$result = db_query("SELECT *,{$CONFIG['TABLE_ALBUMS']}.title AS title,{$CONFIG['TABLE_ALBUMS']}.aid AS aid FROM {$CONFIG['TABLE_PICTURES']},{$CONFIG['TABLE_ALBUMS']} WHERE {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND approved = 'YES' $ALBUM_SET GROUP BY {$CONFIG['TABLE_PICTURES']}.aid ORDER BY {$CONFIG['TABLE_PICTURES']}.ctime DESC $limit");
$rowset = db_fetch_rowset($result);
mysql_free_result($result);
if ($set_caption) foreach ($rowset as $key => $row){
if ($row['user_id']) {
$user_link = '<br /><a href ="profile.php?uid='.$row['user_id'].'">'.$row['user_name'].'</a>';
} else {
$user_link = '';
}
$caption = "<span class=\"thumb_caption\">".$row['title']." - ".localised_date($row['ctime'], $lastup_date_fmt).$user_link.'</span>';
$rowset[$key]['caption_text'] = $caption;
}
return $rowset;
break;