Author Topic: Order photos in admin by newest first - solution  (Read 993 times)

flyer5

  • Prime Member
  • ****
  • Posts: 107
  • Karma: +4/-0
    • North East Nudists
Order photos in admin by newest first - solution
« on: February 16, 2015, 05:27:55 AM »
If you want your member photos in Admin>photos>browse all  to be in the order of Newest uploaded first instead of oldest first try this -

Make a backup of file admin/photo_results.php
Then
In file admin/photo_results.php

Around line 90 find:
Code: [Select]
$query="SELECT a.`photo_id` FROM $from WHERE $where";Change it to:
Code: [Select]
$query="SELECT a.`photo_id` FROM $from WHERE $where ORDER BY date_posted DESC";// added > order by date_posted DESC
// gets our results and orders them by newest first

Around line 112 find:
Code: [Select]
$query="SELECT *,UNIX_TIMESTAMP(`date_posted`) as `date_posted` FROM `{$dbtable_prefix}user_photos` WHERE `photo_id` IN ('".join("','",$photo_ids)."')";Change it to:
Code: [Select]
$query="SELECT *,UNIX_TIMESTAMP(`date_posted`) as `date_posted` FROM `{$dbtable_prefix}user_photos` WHERE `photo_id` IN ('".join("','",$photo_ids)."') ORDER BY date_posted DESC";// added order by date_posted DESC";
// that displays our results with the newest page of records first, and newest record at the top

Test.
If broken overwrite photo_results.php with the backup copy you made.

This works fine with version 2, which is the only version I have tried it with.