Sorting seems to be a problem to a few users these days. I have the following problem:
I can't get plogger to decently sort my pictures under the /manage/ tab. I have an album with, say, image001.jpg to image036.jpg. I want the manage tab to start with image001 and end with image036. Instead it starts with image036 and counts down to image000. No matter what I do, I can't get it right. I tried editing plog-manage.php and tried some 'order by' statements, but to no avail. I think I should be near these lines of code (318):
// determine the filtering conditional based on the level and id number
I tried a lot of ASC and DESC order by statements, but it won't budge. What am I doing wrong? I'm using the latest plogger version (v3).
Thank you very much!
Problem solved thanks to sidtheduck. Look at my next post for the solution.
To do this, you actually need to change some code in the plog-admin-functions.php. Find and edit (in bold) the following code in two locations under 'function plog_picture_manager' (lines 1130-1135 and 1152-1157 in my default download of beta 3):
Thank you for your kind reply! This certainly did something to the sort order in my manage tab; however I'm not quite there yet. With the added sortdir comment my images display like this:
image_07 image_06 image_05 image_04 image_03 image_02 image_01 image_21 image_20 image_19 (continues to 8...) image_08 image_35 image_34 (continues to 22..) image_22 image_45 image_44 (continues to 36) image_36
Without it, it starts with image_45 down to image_00. I reverted back to the original beta3 plog-admin-functions.php and plog-manage.php to be sure none of my previous alterations is causing this. Seems the sortdir isn't affecting the entire array somehow. Any ideas on how to correct this?
[edit] SOLVED! I looked a bit further down the code and noticed the 'sortby: id' statement in a similar array (for the albums). That fixed it! This sorts the pictures by ID, as long as the IDs match the filenames' order you're good to go. I can't get it to purely sort on filename and ignore the ID though.
So one has to add:
'sortby' => 'id', 'sortdir' => 'asc'
to the code in plog-admin-functions.php around lines 1130-1135 and 1152-1157.
Thank you very much sidtheduck for pointing me in the right direction!
I had problems with photos sort order on album pages -- this also helped to solve this by hardcoding in plog_functions.php plogger_init() .. (I use plogger 3b)