coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: ashleyXcore on November 16, 2006, 09:17:01 AM

Title: Sorting files when editing them (editpics.php)
Post by: ashleyXcore on November 16, 2006, 09:17:01 AM
I would like the files to be shown newest-oldest when I am editing them, and I found this (http://forum.coppermine-gallery.net/index.php?topic=16440.0) thread which tells how to do it, but it is older and the code isn't in my version of editpics.php - can someone tell me what to change to show the newest files on top?

Thanks :)
Title: Re: Sorting files when editing them (editpics.php)
Post by: ashleyXcore on November 16, 2006, 09:58:57 AM
Also, the FAQ must be outdated because when I search for that line it tells me to change, it doesn't exist...
http://coppermine-gallery.net/demo/cpg14x/docs/faq.htm#changeOrderEdit
Title: Re: Sorting files when editing them (editpics.php)
Post by: ashleyXcore on November 17, 2006, 09:45:46 PM
Anyone? Your help would be greatly appreciated  :)
Title: Re: Sorting files when editing them (editpics.php)
Post by: Nibbler on November 17, 2006, 09:49:32 PM
The code is now


                $sql = "SELECT p.*,a.category FROM {$CONFIG['TABLE_PICTURES']} as p ".
                           "INNER JOIN {$CONFIG['TABLE_ALBUMS']} as a ".
                           "ON a.aid=p.aid ".
                           "WHERE p.aid = '$album_id' ".
                           "ORDER BY p.filename LIMIT $start, $count";
                $result = cpg_db_query($sql);


and should be changed to


                $sql = "SELECT p.*,a.category FROM {$CONFIG['TABLE_PICTURES']} as p ".
                           "INNER JOIN {$CONFIG['TABLE_ALBUMS']} as a ".
                           "ON a.aid=p.aid ".
                           "WHERE p.aid = '$album_id' ".
                           "ORDER BY pid LIMIT $start, $count";
                $result = cpg_db_query($sql);


to apply the mod.
Title: Re: Sorting files when editing them (editpics.php)
Post by: ashleyXcore on November 18, 2006, 06:15:01 AM
Thanks so much for the help =P