modify "lastalb" modify "lastalb"
 

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

modify "lastalb"

Started by Carsten, September 25, 2004, 08:55:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Carsten

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;


kegobeer

I don't understand exactly what you're asking.  If you want a certain thumbnail to display when the album list is displayed, just click on "Properties" that's next to the album name and select the image you want for the album thumbnail.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Carsten

#2
Hi kegobeer, thanks for your reply.

Unfortunaletly, I wrote twice "alblist" instead of "lastalb", that's a big difference ... just fixed it.

You can see what I mean when you see my test install of coppermine:
http://www.erwinia.de/cop/

In the album list in the upper part you see the certain pic I've chosen.

Below in "Last updated albums" the last uploaded picture of the album is shown.

Carsten