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: album sort order  (Read 2944 times)

0 Members and 1 Guest are viewing this topic.

ganeshcp

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 33
album sort order
« on: November 24, 2005, 10:32:43 am »


I want to sort albums by their popularity but I don't think albums have a hits count. So I thought I can sort them by the no. of pics they contain by using

Code: [Select]
    $sql = 'SELECT a.aid, a.title, a.description, visibility, filepath, '.
           'filename, url_prefix, pwidth, pheight '.
           'FROM '.$CONFIG['TABLE_ALBUMS'].' as a '.
           'LEFT JOIN '.$CONFIG['TABLE_PICTURES'].' as p '.
           'ON a.thumb=p.pid '.
           'WHERE category='.$cat.$album_filter.
           ' ORDER BY a.pic_count DESC '.
           $limit;

the funny thing is when i brwse my db all the stats for albums are empty!

pic_count,  last_addition all are zeroes... :(

Logged

Nibbler

  • Guest
Re: album sort order
« Reply #1 on: November 24, 2005, 06:37:27 pm »

They are not used. If you want to do this then you need to adjust the query to count the actual number of hits or pics.
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.