Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Change default sort order on album thumbnails with case "lastalb"  (Read 1920 times)

0 Members and 1 Guest are viewing this topic.

net

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 88

Hi,

I have a slight issue i can't figure out. My default sort order for album thumbnails is set to: DESC, (in CPG config) and it works very nicely when i browse the gallery normally, but for some reason when i call the function "lastalb"
Code: [Select]
case 'lastalb': // Last albums to which uploads
                if ($META_ALBUM_SET && $CURRENT_CAT_NAME) {
                        $album_name = $lang_meta_album_names['lastalb'].' - '. $CURRENT_CAT_NAME;
                } else {
                        $album_name = $lang_meta_album_names['lastalb'];
                }


                $META_ALBUM_SET = str_replace( "aid", $CONFIG['TABLE_PICTURES'].".aid" , $META_ALBUM_SET );

                $query = "SELECT count({$CONFIG['TABLE_ALBUMS']}.aid) FROM {$CONFIG['TABLE_PICTURES']},{$CONFIG['TABLE_ALBUMS']} WHERE {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND approved = 'YES' $META_ALBUM_SET GROUP  BY {$CONFIG['TABLE_PICTURES']}.aid";

                $result = cpg_db_query($query);
                $count = mysql_num_rows($result);
                mysql_free_result($result);

                $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' $META_ALBUM_SET GROUP BY {$CONFIG['TABLE_PICTURES']}.aid ORDER BY {$CONFIG['TABLE_PICTURES']}.ctime DESC $limit";
                $result = cpg_db_query($query);
                $rowset = cpg_db_fetch_rowset($result);
                mysql_free_result($result);

                if ($set_caption) build_caption($rowset,array('ctime'));

                $rowset = CPGPluginAPI::filter('thumb_caption_lastalb',$rowset);

                return $rowset;
                break;

the album thumbnails are sorted by ASC which means the first picture created in the album is the one displayed. I want it to sort by DESC so that the last picture created in the album is displayed as the album thumbnail.

Any ideas how i can change the case "lastalb" to do this for me? I can't seem to figure it out. I don't use "lastalb" as a function to display albums on the index page, i'm using it as a button to see the latest updates albums. The link i use to call the function is "thumbnails.php?album=lastalb", i don't know if that matters at all, but the more information the better i though!

Thanks for the support.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Logged

net

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 88
Re: Change default sort order on album thumbnails with case "lastalb"
« Reply #2 on: July 24, 2009, 11:02:38 am »

http://tinyurl.com/nf9pdg <- NOT SAFE FOR WORK

Click any album to see that the thumbnail used is the first uploaded picture into that album, i want it to be the other way around that the latest or newest picture created in album is the thumbnail. Which i have when you browse through normal categories.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Change default sort order on album thumbnails with case "lastalb"
« Reply #3 on: July 24, 2009, 01:48:06 pm »

I'm not going to follow an tinyurl link. Post the real link or don't post at all.
Logged

net

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 88
Re: Change default sort order on album thumbnails with case "lastalb"
« Reply #4 on: July 24, 2009, 02:09:59 pm »

Well i don't want unwanted google attention, so i won't post then.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 21 queries.