whos online widget not working (think it\'s a mysql timezone problem)
Tried the online widget and it don’t show any user also if there is someone else online. Using wpmu 220.127.116.11 and bp 1.2.1.
I’ve looked into it a little and found that a user is selected as online if is last activity not more than 5 min before than mysql time, as you can see in this line from bp-core-classes
if ( 'active' == $type || 'online' == $type )
$sql['where_active'] = "AND um.meta_key = 'last_activity'";
if ( 'online' == $type )
$sql['where_online'] = "AND DATE_ADD( um.meta_value, INTERVAL 5 MINUTE ) >= NOW()";
I’ve looked in the db and tried some queries, i think the problem is that the last_activity is UTC and NOW() is UTC+1.
If I mod the core to check 65 MINUTE it works, but this is only a temporary solution and only valid for this configuration.
Maybe there’s a stupid solution or setting I haven’t found, but please help me find it. I’m on shared hosting so i can’t change the mysql server clock or timezone.
The topic ‘whos online widget not working (think it\'s a mysql timezone problem)’ is closed to new replies.