[Solved]: Category Thumb Being Last Added Image [Solved]: Category Thumb Being Last Added Image
 

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

Main Menu

[Solved]: Category Thumb Being Last Added Image

Started by aunrea, May 02, 2008, 01:21:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

aunrea

Is there a way to have the category thumb be the last added image to that category, instead of a pre-selected image? I tried using cpmFetch to do it but I couldn't figure out how to get the category id.

I am using Coppermine 1.4.16 Modded by Stramm version.
My gallery is located at http://candaceduffyjones.com/gallery

Nibbler

Update your gallery. Then edit index.php. Find


                if ($subcat['thumb'] > 0) {
                    $sql = "SELECT filepath, filename, url_prefix, pwidth, pheight " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='{$subcat['thumb']}'" . $pic_filter;


Change to


                if ($pic_count) {
                    $sql = "SELECT filepath, filename, url_prefix, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} as p, {$CONFIG['TABLE_ALBUMS']} as a WHERE p.aid = a.aid AND approved='YES' AND category = {$subcat['cid']} " . $album_filter . " ORDER BY pid DESC LIMIT 1";

aunrea