Member:
Markus ⋅
Date: March 8, 2010, 01:18 AM
⋅ Subject: "Re: Member order by Last Active displays Last Registered not last active"
That's odd. The settings are correct. Here's the debugging as it goes along, for all you debuggers out there who want to understand what your system does.
I have created two test pages in our demo, Last Active and Last Registered. Now, when I'm logged in as admin and append &debug=on to the end of the URL, I get to look at the MySQL queries. They are:
SELECT *, member_display_name AS member_name FROM w_members GROUP BY member_id ORDER BY member_last_active DESC LIMIT 0, 20 // @Module::get_elements / 638@class_templates.php
SELECT *, member_display_name AS member_name FROM w_members GROUP BY member_id ORDER BY member_registered DESC LIMIT 0, 20 // @Module::get_elements / 638@class_templates.php
As you can see, the queries are correct. I could go hunt the timestamps down in the database, but let's extend the skin_members.php / member_short instead to display the last active time so we get something useful out of this session. You can do this mod to your own site if you want. I am adding in (wherever you wish, line #102 is as good a spot as any):
Last Active: [[MEMBER_LAST_ACTIVE]]
Now, this will just put the timestamps in. What we need is one of them preprocessors! class_modules.php, line #566 onward we have the default function member_preprocess(), and I'm going to stick it there for now so it's in global use. I'm actually just copypasting the timestamp convertor from the post_preprocessor right next door, and entering this in (anywhere in the function):
$data['member_last_active'] = Utility::make_date($core['module']['format_post_date'], $data['member_last_active'], 30);
Now we can actually get to see the last active dates in their profiles. Can you please look those up on your site and see what they say? (I'm assuming you would actually like to have this shown there.) As you can see on the demo pages I linked to above, the ordering seem to be lagging in the default 1.21 setup, and this must be because of some session cache handling changes I did for 1.21. I am looking at that now, and will get back to you in a jiffy on where the actual problem lies.
I have also inserted the above into the upcoming 1.21.1 files, so this will be available out of the box for the next release. (With the exception that I of course added the "Last Active" into language files and put in a language tag instead.)