How do I change the display order of the files in editpics? I want them sorted by 'most recent first' - it seems to be sorting them in name order. Am I missing something in a setting somewhere?
TIA!
I don't believe it's an option anywhere. You can modify editpics.php to change the sort order, though.
Find this:
$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";
And replace it with this:
$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.pid LIMIT $start, $count";
It'll be in oldest to newest order. To get the newest files at the beginning, add DESC after p.pid:
"ORDER BY p.pid DESC LIMIT $start, $count";
And yay that's the first question I've gotten a chance to answer. ^^
Being able to edit would be super. You said you wanted newest first. So
this:
$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";
to this:
$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.pid DESC LIMIT $start, $count";
and nevermind the rest I said. Too long a delay between when I read your post and when I posted my reply. :\
:'(
In editpics.php... this:
$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";
to this:
$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.pid DESC LIMIT $start, $count";
No more mistakes, I swear. And I don't know how people do the code boxes and yet still have the php colors. Hence my problematic last post. A thousand apologies to everyone who reads this thread.
Quote from: bowserbabe on May 30, 2007, 03:26:20 AM
And I don't know how people do the code boxes and yet still have the php colors.
To accomplish syntax highlighting, SMF's bbcode either needs leading PHP opening tags like this:
<?php
echo 'Hello World';
?>
or you can use the tag [ p h p ] (without the spaces) as well, which results in $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.pid DESC LIMIT $start, $count";as you have done in your previous posting. When using the [ c o d e ]-tag, it depends on the leading PHP-tag:
<?php
echo 'Hello World';
?>
echo 'Hello World';
that got it - thanks all!
Thanks GauGau, that makes way more sense than what it says in the FAQ.
And I'm glad you understood, graemerae, despite the mess I made of my replies. ;)