Finally got AJAXed Who’s Online 0.61 to work through trial and error. Had to change the way the date was called as well as the format of the lastping record in the sql database. It does take a while to list all offline names if you have many members as it calculates time and links all posts for each member before display.
What I want to do now, and I certainly could use a little help on this, is to show those currently online and “only” those who were on in the past 24 hours for all pages “except” the profile/member page. On the profile/member page I want to show everyone both online and offline.
I have the code to do this working, but since plugin online_users.php is called from the sidebar (Andreas04 & 09), I am finding IF (is_page(’80’)) doesn’t work. My Profile/Member page is ?page_id=80. This is the code and it does work if I plug in the values:
if (is_page (’80’)) {
$query_offline = “SELECT user_id FROM tms_online_users WHERE lastping<FROM_UNIXTIME(‘”.$datetime[‘0’].”‘) ORDER BY lastping DESC”;
} else {
$query_offline = “SELECT user_id FROM tms_online_users WHERE lastping<FROM_UNIXTIME(‘”.$datetime[‘0’].”‘) && lastping>FROM_UNIXTIME(‘”.($datetime[‘0’] -86380).”‘) ORDER BY lastping DESC”;
}
It looks like is_page is not available when the plugin is called. I can force it to execute either one or the other by plugging the value but then one or the other always executes.
Would appreciate it if someone could offer a suggestion or tell me why the if stmt doesn’t work.