Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: modify "lastalb"  (Read 2625 times)

0 Members and 1 Guest are viewing this topic.

Carsten

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 38
modify "lastalb"
« on: September 25, 2004, 08:55:13 pm »

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;

« Last Edit: September 25, 2004, 09:18:45 pm by Carsten »
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: modify "lastalb"
« Reply #1 on: September 25, 2004, 08:58:59 pm »

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.
Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 38
Re: modify "lastalb"
« Reply #2 on: September 25, 2004, 09:23:42 pm »

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
« Last Edit: September 25, 2004, 09:32:26 pm by Carsten »
Logged
Pages: [1]   Go Up
 

Page created in 0.044 seconds with 19 queries.