forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: paulgul on November 07, 2010, 12:52:55 pm

Title: Last uploads album
Post by: paulgul on November 07, 2010, 12:52:55 pm
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
Title: Re: Last uploads album
Post by: Nibbler on November 07, 2010, 12:54:16 pm
Yes, that's how it works.
Title: Re: Last uploads album
Post by: paulgul on November 07, 2010, 02:00:17 pm
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.
Title: Re: Last uploads album
Post by: Αndré on November 07, 2010, 06:51:24 pm
You have to modify the appropriate queries in include/functions.inc.php. Search for 'lastup' (including the quotation marks).
Title: Re: Last uploads album
Post by: paulgul on November 07, 2010, 10:13:23 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
Title: Re: Last uploads album
Post by: Αndré on November 08, 2010, 09:55:16 am
Find
Code: [Select]
        $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
Code: [Select]
        $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
Code: [Select]
        $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
Code: [Select]
        $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
Code: [Select]
        $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
Code: [Select]
        $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";
Title: Re: Last uploads album
Post by: paulgul on November 08, 2010, 04:41:56 pm
Thanks for that, just what I needed.
Paul