coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: ejgladwin on August 23, 2005, 05:37:11 PM

Title: Setting the sort order of thumbnails on the seach results page
Post by: ejgladwin on August 23, 2005, 05:37:11 PM
Hello,

I installed Coppermine 1.3.2 and I have modified it quite a bit to make it work the way I want.  The only thing I'd like to do which I haven't been able to do, is change the sort order of the thumbnails for the search results page.

I'd like the thumbnails for search results to be ordered so that the most recently uploaded files are shown first.  At the moment it seems at though it is showing the earliest thumbnails first, and the most recent thumbnails last (or it could also be name ascending).

I tried changing the default sort order in the Coppermine config screen but this doesn't seem to affect how the search results are ordered.

Thanks in advance for any help,

Edward ~

http://photos.edgladwin.com/
Title: Re: Setting the sort order of thumbnails on the seach results page
Post by: Nibbler on August 23, 2005, 08:12:35 PM
You'll need to hardcode it, look in include/search.inc.php, find:

$sql = "SELECT $select_columns " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE ($pic_set) " . "AND approved = 'YES' " . "$ALBUM_SET $limit";

and change to

$sql = "SELECT $select_columns " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE ($pic_set) " . "AND approved = 'YES' " . "$ALBUM_SET ORDER BY pid DESC $limit";
Title: Re: Setting the sort order of thumbnails on the seach results page
Post by: ejgladwin on August 23, 2005, 08:31:04 PM
Thanks very much, that worked perfectly  ;D