Last uploads album Last uploads album
 

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

Last uploads album

Started by paulgul, November 07, 2010, 12:52:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

paulgul

My gallery http://www.paulgulliver.co.uk/Coppermine/index.php?cat=0
How many files are held in the last uploads album. When I can on mine (from the album menu) I seem to get all the uploads I've done across several pages

Nibbler


paulgul

Ok, I just assumed it would show the last 'X' number of thumbnails and then remove older ones as new ones were uploaded. I was hoping to set it up to show those uploaded in, say, the last 30 days so that returning users would be find new uploads quickly.

Αndré

You have to modify the appropriate queries in include/functions.inc.php. Search for 'lastup' (including the quotation marks).

paulgul

Quote from: Αndré on November 07, 2010, 06:51:24 PM
You have to modify the appropriate queries in include/functions.inc.php.
If anyone could offer some help here in modifing the query. that would be appreciated
Paul

Αndré

Find
        $query = "SELECT COUNT(*)
                FROM {$CONFIG['TABLE_PICTURES']} AS r
                INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON a.aid = r.aid
                $RESTRICTEDWHERE
                AND approved = 'YES'";

and replace with
        $query = "SELECT COUNT(*)
                FROM {$CONFIG['TABLE_PICTURES']} AS r
                INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON a.aid = r.aid
                $RESTRICTEDWHERE
                AND approved = 'YES'
                AND ctime > UNIX_TIMESTAMP() - 60*60*24*30";



Find
        $query = "SELECT $select_columns
                FROM {$CONFIG['TABLE_PICTURES']} AS r
                INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON a.aid = r.aid
                $RESTRICTEDWHERE
                AND approved = 'YES'
                ORDER BY r.pid $DESC $limit";

and replace with
        $query = "SELECT $select_columns
                FROM {$CONFIG['TABLE_PICTURES']} AS r
                INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON a.aid = r.aid
                $RESTRICTEDWHERE
                AND approved = 'YES'
                AND ctime > UNIX_TIMESTAMP() - 60*60*24*30
                ORDER BY r.pid $DESC $limit";



Find
        $query = "SELECT COUNT(*) FROM {$CONFIG['TABLE_PICTURES']} AS p
            INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON r.aid = p.aid
            $RESTRICTEDWHERE
            AND approved = 'YES'
            AND pid > $pid";

and replace with
        $query = "SELECT COUNT(*) FROM {$CONFIG['TABLE_PICTURES']} AS p
            INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON r.aid = p.aid
            $RESTRICTEDWHERE
            AND approved = 'YES'
            AND ctime > UNIX_TIMESTAMP() - 60*60*24*30
            AND pid > $pid";

paulgul

Thanks for that, just what I needed.
Paul