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: sort albums by date  (Read 3442 times)

0 Members and 1 Guest are viewing this topic.

zieloo

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
sort albums by date
« on: October 06, 2007, 03:00:01 pm »

Hi

How do I sort albums inside a category by date (asc or desc, whatever) ?

Thanks
« Last Edit: October 12, 2007, 07:49:36 am by Sami »
Logged

just_some_guy

  • Supporter
  • Coppermine addict
  • ****
  • Offline Offline
  • Posts: 539
  • I am currently on holiday, back in a few weeks. :D
Re: sort albums by date
« Reply #1 on: October 06, 2007, 03:02:06 pm »

use the "DATE + -" buttons on the top right.
Logged
Tambien, Hablo Espaņol      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

zieloo

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: sort albums by date
« Reply #2 on: October 06, 2007, 03:05:30 pm »

use the "DATE + -" buttons on the top right.

I want to sort the albums NOT the pictures within them...
Logged

zieloo

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: sort albums by date
« Reply #3 on: October 11, 2007, 05:18:25 pm »

Anyone?
Logged

Nibbler

  • Guest
Re: sort albums by date
« Reply #4 on: October 11, 2007, 07:37:45 pm »

You can make a small mod to index.php to adjust the sort order. Search the board - the answer is already posted.
Logged

zieloo

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: sort albums by date
« Reply #5 on: October 11, 2007, 09:05:27 pm »

Done. :D
Change:
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.pos' . $limit;'
to:
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.pos DESC ' . $limit;'
line: aprox 605, file: index.php

Thanks, Nibbler :)
« Last Edit: October 14, 2007, 10:25:05 am by GauGau »
Logged
Pages: [1]   Go Up
 

Page created in 0.042 seconds with 20 queries.