Esempio n. 1
0
 function get_online_peoples($limit = 10, $start = 0)
 {
     $start = intval($start);
     $limit = intval($limit);
     $seconds = intval($this->config->item('online_seconds'));
     if (intval($seconds) < 300) {
         $seconds = 300;
     }
     $time = date("Y-m-d H:i:s", strtotime("-{$seconds} seconds"));
     $this->db->select('sql_calc_found_rows u2_uid')->from('u2_online')->where('u2_stay_time >', $time);
     if ($limit > 0) {
         $this->db->limit($limit, $start);
     }
     $oids = lazy_get_data();
     save_count();
     if (!$oids) {
         return NULL;
     }
     foreach ($oids as $o) {
         $ids[] = $o['u2_uid'];
     }
     $users = $this->get_users_by_ids($ids);
     return $users;
 }
Esempio n. 2
0
function get_count($save = true)
{
    if ($save) {
        save_count();
    }
    if (isset($GLOBALS['__sql_count'])) {
        return $GLOBALS['__sql_count'];
    }
    return 0;
}