$language_file = array('index','registration','messages','userInfo'); $cidReset = true; require_once 'main/inc/global.inc.php'; /** * Access permissions check */ api_block_anonymous_users(); /** * Treat URL arguments */ $array_keys = array_keys($_GET); if (!empty($array_keys)) { $username = substr($array_keys[0],0,20); // max len of an username $friend_id = UserManager::get_user_id_from_username($username); if ($friend_id) { SocialManager::display_individual_user($friend_id); } else { // we cant find your friend header('Location: whoisonline.php'); exit; } } else { // we cant find your friend header('Location: whoisonline.php'); exit; }
if (!isset($_GET['id'])) { if (api_get_setting('allow_social_tool') == 'true') { if (!api_is_anonymous()) { $query = isset($_GET['q']) ? $_GET['q'] : null; $social_right_content .= '<div class="span9">' . UserManager::get_search_form($query) . '</div>'; } } $social_right_content .= SocialManager::display_user_list($user_list); } } if (isset($_GET['id'])) { if (api_get_setting('allow_social_tool') == 'true') { header("Location: " . api_get_path(WEB_CODE_PATH) . "social/profile.php?u=" . intval($_GET['id'])); exit; } else { SocialManager::display_individual_user($_GET['id']); } } } else { api_not_allowed(); exit; } $app['title'] = get_lang('UsersOnLineList'); $tpl = $app['template']; if (api_get_setting('allow_social_tool') == 'true' && !api_is_anonymous()) { $tpl->setHelp('Groups'); $tpl->assign('social_left_content', $social_left_content); $tpl->assign('social_right_content', $social_right_content); $social_layout = $tpl->get_template('layout/social_layout.tpl'); $tpl->display($social_layout); } else {
if (api_get_setting('allow_social_tool') == 'true') { if (!api_is_anonymous()) { $query = isset($_GET['q']) ? $_GET['q'] : null; $social_search .= UserManager::get_search_form($query); } } //$social_right_content .= SocialManager::display_user_list($user_list); } } $whoisonline_list .= SocialManager::display_user_list($user_list); if (isset($_GET['id'])) { if (api_get_setting('allow_social_tool') == 'true' && api_user_is_login()) { header("Location: " . api_get_path(WEB_CODE_PATH) . "social/profile.php?u=" . intval($_GET['id'])); exit; } else { $social_right_content .= SocialManager::display_individual_user($_GET['id']); } } } else { api_not_allowed(); exit; } $tpl = new Template(get_lang('UsersOnLineList')); if (api_get_setting('allow_social_tool') == 'true' && !api_is_anonymous()) { $tpl->assign('whoisonline', $whoisonline_list); $tpl->assign('social_search', $social_search); $social_layout = $tpl->get_template('social/whoisonline.tpl'); $tpl->display($social_layout); } else { $content = $social_right_content; $tpl->assign('actions', $actions);