Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Please sign in or apply for membership to remove the ads
    • CommentAuthorphAn
    • CommentTimeMar 5th 2008 edited
     
    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.
    •  
      CommentAuthorsidtheduck
    • CommentTimeMar 5th 2008 edited
     
    phAn,

    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):

    plogger_init_pictures(array(
    'type' => 'album',
    'value' => $id,
    'from' => $from,
    'limit' => $limit,
    'sortdir' => 'ASC'
    ));

    That should do it for you!
    • CommentAuthorphAn
    • CommentTimeMar 6th 2008 edited
     
    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!
    •  
      CommentAuthorsidtheduck
    • CommentTimeMar 6th 2008
     
    not a problem, phAn. I was wondering if you would need the 'sortby', but I assumed it would default back to there. Glad you got it working! :)
    • CommentAuthordz0
    • CommentTimeApr 12th 2008
     
    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)