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: Last uploads album  (Read 3410 times)

0 Members and 1 Guest are viewing this topic.

paulgul

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Last uploads album
« 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
Logged

Nibbler

  • Guest
Re: Last uploads album
« Reply #1 on: November 07, 2010, 12:54:16 pm »

Yes, that's how it works.
Logged

paulgul

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Last uploads album
« Reply #2 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Last uploads album
« Reply #3 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).
Logged

paulgul

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Last uploads album
« Reply #4 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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Last uploads album
« Reply #5 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";
Logged

paulgul

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Last uploads album
« Reply #6 on: November 08, 2010, 04:41:56 pm »

Thanks for that, just what I needed.
Paul
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.