Closed (fixed)
Project:
Sky
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Sep 2008 at 20:18 UTC
Updated:
16 Sep 2008 at 17:45 UTC
In the forum topics/comments, online users (as indicated in the Who's online block) were shown as offline users. After inspecting, it seems that in template.php lines 411-420:
function _sky_user_status($uid) {
if ($uid > 0) {
$time_period = variable_get('user_block_seconds_online', 600);
$users = db_query('SELECT DISTINCT(uid), access FROM {users} WHERE access >= %d AND uid = "%s"', time() - $time_period, $uid);
$status = db_result($users);
if ($status == 1) {
return TRUE;
}
}
}
That the value of $status was set to $uid from db_result. I've made the following change (on the $status != FALSE check) and it seems to work now:
function _sky_user_status($uid) {
if ($uid > 0) {
$time_period = variable_get('user_block_seconds_online', 600);
$users = db_query('SELECT DISTINCT(uid), access FROM {users} WHERE access >= %d AND uid = "%s"', time() - $time_period, $uid);
$status = db_result($users);
if ($status != FALSE) {
return TRUE;
}
}
}
Running Drupal 6.4 with the sky theme installed in /sites/default/themes (not under all, if that makes any difference).
Comments
Comment #1
jacineThank you Windslash for posting your solution. I will take a further look and commit it ASAP.
Comment #2
jacineI just committed a fix for this, should be online shortly. Thanks again :)