*/ /** * Initialization */ $language_file = array('userInfo'); $cidReset = true; require_once '../inc/global.inc.php'; api_block_anonymous_users(); if (api_get_setting('allow_social_tool') != 'true') { api_not_allowed(); } $this_section = SECTION_SOCIAL; $htmlHeadXtra[] = ''; $interbreadcrumb[] = array('url' => 'profile.php', 'name' => get_lang('SocialNetwork')); $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Friends')); $social_left_content = SocialManager::show_social_menu('friends'); $user_id = api_get_user_id(); $user_id = api_get_user_id(); $name_search = isset($_POST['search_name_q']) ? $_POST['search_name_q'] : null; $number_friends = 0; if (isset($name_search) && $name_search != 'undefined') { $friends = SocialManager::get_friends($user_id, null, $name_search); } else { $friends = SocialManager::get_friends($user_id); } $social_right_content = '
'; if (count($friends) == 0) { $social_right_content .= get_lang('NoFriendsInYourContactList').'

'; $social_right_content .= ''.get_lang('TryAndFindSomeFriends').''; } else { $social_right_content .= get_lang('Search').'   :   '; $social_right_content .= ''; $friend_html = '
'; $number_friends = count($friends); $j = 0; $friend_html .= ''; $friend_html .= '
'; $social_right_content .= $friend_html; } $social_right_content .= '
'; $app['title'] = get_lang('Social'); $tpl = $app['template']; $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);