Subversion Repositories cryptochat

Rev

Rev 5 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5 Rev 6
Line 219... Line 219...
219
 
219
 
220
function count_users($room) {
220
function count_users($room) {
221
        $room_file = chatroom_file($room);
221
        $room_file = chatroom_file($room);
222
        $cont = file_get_contents($room_file);
222
        $cont = file_get_contents($room_file);
223
        preg_match_all('@\(user:(.*)\)@ismU', $cont, $m);
223
        preg_match_all('@\(user:(.*)\)@ismU', $cont, $m);
-
 
224
        $users_lookup = array();
224
        foreach ($m[1] as &$us) {
225
        foreach ($m[1] as &$us) {
225
                $users_lookup[$us] = true;
226
                $users_lookup[$us] = true;
226
        }
227
        }
227
        return count($users_lookup);
228
        return count($users_lookup);
228
}
229
}
Line 283... Line 284...
283
        return array(count($lines), $res, $userstats);
284
        return array(count($lines), $res, $userstats);
284
}
285
}
285
 
286
 
286
// $sajax_debug_mode = true;
287
// $sajax_debug_mode = true;
287
$sajax_failure_redirect = 'http://web.archive.org/web/20090915191608/http://sajax.info/sajaxfail.html';
288
$sajax_failure_redirect = 'http://web.archive.org/web/20090915191608/http://sajax.info/sajaxfail.html';
288
sajax_export(
289
sajax_export( /** @phpstan-ignore-line */ // PHPstan thinks that sajax_export() only accepts 0 parameters?!
289
        array('name' => 'add_line', 'method' => 'POST'),
290
        array('name' => 'add_line', 'method' => 'POST'),
290
        array('name' => 'refresh',  'method' => 'GET')   // TODO: post?
291
        array('name' => 'refresh',  'method' => 'GET')   // TODO: post?
291
);
292
);
292
sajax_handle_client_request();
293
sajax_handle_client_request();
293
 
294