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

jacine’s picture

Status: Active » Needs review

Thank you Windslash for posting your solution. I will take a further look and commit it ASAP.

jacine’s picture

Status: Needs review » Closed (fixed)

I just committed a fix for this, should be online shortly. Thanks again :)