/** * Get the list of user_ids of users who are online. */ public static function users_connected_by_id() { $count = who_is_online_count(); $user_connect = who_is_online(0, $count, null, null, 30, true); $user_id_list = array(); for ($i = 0; $i < count($user_connect); $i++) { $user_id_list[$i] = $user_connect[$i][0]; } return $user_id_list; }
<?php include "header.php"; ?> <table border="0" align="center"> <tr> <td align="center" bgcolor="#000000"> <img src="lang/<?php echo $lang; ?> _images/whos_online.png"><br> <small><?php echo $lang_who["msg"]; ?> </small> </td> </tr><tr> <td align="center"> <?php echo who_is_online(); ?> </td> </tr> </table> <?php include "footer.php";
$chatid = intval($_GET['chatid']); if ($_GET['chatid'] == strval(intval($_GET['chatid']))) { $sql = "update $track_user_table set chatcall_user_id = ".intval($_user['user_id']).", chatcall_date = '".Database::escape_string($time)."', chatcall_text = '' where (user_id = ".(int)Database::escape_string($chatid).")"; $result = Database::query($sql); //redirect caller to chat header("Location: ".api_get_path(WEB_CODE_PATH)."chat/chat.php?".api_get_cidreq()."&origin=whoisonline&target=".Security::remove_XSS($chatid)); exit; } } */ // This if statement prevents users accessing the who's online feature when it has been disabled. if (api_get_setting('showonline', 'world') == 'true' && !$_user['user_id'] || (api_get_setting('showonline', 'users') == 'true' || api_get_setting('showonline', 'course') == 'true') && $_user['user_id']) { if (isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0) { $user_list = who_is_online_in_this_course(0, 9, api_get_user_id(), api_get_setting('time_limit_whosonline'), $_GET['cidReq']); } else { $user_list = who_is_online(0, 9); } /* if (!isset($_GET['id'])) { if (api_get_setting('allow_social_tool') == 'true') { if (!api_is_anonymous()) { //this include the social menu div $social_left_content = SocialManager::show_social_menu('whoisonline'); } } } */ if ($user_list) { if (!isset($_GET['id'])) { if (api_get_setting('allow_social_tool') == 'true') { if (!api_is_anonymous()) { $query = isset($_GET['q']) ? $_GET['q'] : null;
/* For licensing terms, see /license.txt */ require_once '../global.inc.php'; $action = $_GET['a']; switch ($action) { case 'load_online_user': if (isset($_SESSION['who_is_online_counter'])) { $_SESSION['who_is_online_counter']++; } else { $_SESSION['who_is_online_counter'] = 2; } $images_to_show = 9; $page = intval($_REQUEST['online_page_nr']); $max_page = ceil(who_is_online_count() / $images_to_show); $page_rows = ($page - 1) * 9; if (!empty($max_page) && $page <= $max_page) { if (isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0) { $user_list = who_is_online_in_this_course($page_rows, $images_to_show, api_get_user_id(), api_get_setting('time_limit_whosonline'), $_GET['cidReq']); } else { $user_list = who_is_online($page_rows, $images_to_show); } if (!empty($user_list)) { echo SocialManager::display_user_list($user_list, false); exit; } } echo 'end'; break; default: break; }
</tr><?php } ?> </table></center></td></tr><?php } ?> <tr> <td align="left"> <br><br> <b><?php echo $lang_town["ot_on"]; ?> </b><br> <?php echo who_is_online($char_loc); ?> <br><br> <b><?php echo $lang_town["ot_of"]; ?> </b><br> <?php echo who_is_offline($char_loc); ?> </td> </tr> </table> </td> </tr>