* @author Isaac Flores Paz * @package chamilo.social */ $language_file = array('userInfo'); $cidReset = true; require_once '../inc/global.inc.php'; require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php'; require_once api_get_path(LIBRARY_PATH).'social.lib.php'; require_once api_get_path(LIBRARY_PATH).'array.lib.php'; require_once api_get_path(LIBRARY_PATH).'group_portal_manager.lib.php'; $user_id = api_get_user_id(); $show_full_profile = true; //social tab $this_section = SECTION_SOCIAL; //I'm your friend? I can see your profile? if (isset($_GET['u'])) { $user_id = (int) Database::escape_string($_GET['u']); // It's me! if (api_get_user_id() != $user_id) { $user_info = UserManager::get_user_info_by_id($user_id); $show_full_profile = false; if (!$user_info) { // user does no exist !! api_not_allowed(); } else { //checking the relationship between me and my friend $my_status= SocialManager::get_relation_between_contacts(api_get_user_id(), $user_id); if (in_array($my_status, array(USER_RELATION_TYPE_PARENT, USER_RELATION_TYPE_FRIEND, USER_RELATION_TYPE_GOODFRIEND))) { $show_full_profile = true; } //checking the relationship between my friend and me $my_friend_status = SocialManager::get_relation_between_contacts($user_id, api_get_user_id()); if (in_array($my_friend_status, array(USER_RELATION_TYPE_PARENT, USER_RELATION_TYPE_FRIEND, USER_RELATION_TYPE_GOODFRIEND))) { $show_full_profile = true; } else { // im probably not a good friend $show_full_profile = false; } } } else { $user_info = UserManager::get_user_info_by_id($user_id); } } else { $user_info = UserManager::get_user_info_by_id($user_id); } $libpath = api_get_path(LIBRARY_PATH); require_once api_get_path(SYS_CODE_PATH).'calendar/myagenda.inc.php'; require_once api_get_path(SYS_CODE_PATH).'announcements/announcements.inc.php'; require_once $libpath.'course.lib.php'; require_once $libpath.'formvalidator/FormValidator.class.php'; require_once $libpath.'magpierss/rss_fetch.inc'; api_block_anonymous_users(); //jquery thickbox already called from main/inc/header.inc.php $htmlHeadXtra[] = ' '; $htmlHeadXtra[] = ''; $nametool = get_lang('Social'); if (isset($_GET['shared'])) { $my_link='../social/profile.php'; $link_shared='shared='.Security::remove_XSS($_GET['shared']); } else { $my_link='../social/profile.php'; $link_shared=''; } $interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('Social') ); $interbreadcrumb[]= array ('url' => 'profile.php?u='.api_get_user_id(), 'name' => get_lang('ViewMySharedProfile')); if (isset($_GET['u']) && is_numeric($_GET['u']) && $_GET['u'] != api_get_user_id()) { $info_user=api_get_user_info($_GET['u']); $interbreadcrumb[]= array ('url' => '#','name' => api_get_person_name($info_user['firstName'], $info_user['lastName'])); $nametool = ''; } if (isset($_GET['u'])) { $param_user='u='.Security::remove_XSS($_GET['u']); }else { $info_user=api_get_user_info(api_get_user_id()); $param_user=''; } $_SESSION['social_user_id'] = intval($user_id); /** * Display */ Display :: display_header($nametool); //Setting some course info $my_user_id=isset($_GET['u']) ? Security::remove_XSS($_GET['u']) : api_get_user_id(); $personal_course_list = UserManager::get_personal_session_course_list($my_user_id); $course_list_code = array(); $i=1; //print_r($personal_course_list); if (is_array($personal_course_list)) { foreach ($personal_course_list as $my_course) { if ($i<=10) { $list[] = SocialManager::get_logged_user_course_html($my_course,$i); //$course_list_code[] = array('code'=>$my_course['c'],'dbName'=>$my_course['db'], 'title'=>$my_course['i']); cause double $course_list_code[] = array('code'=>$my_course['c'],'dbName'=>$my_course['db']); } else { break; } $i++; } //to avoid repeted courses $course_list_code = array_unique_dimensional($course_list_code); } $user_online_list = who_is_online(api_get_setting('time_limit_whosonline'), true); $user_online_count = count($user_online_list); echo '
'; echo '
'; //this include the social menu div SocialManager::show_social_menu('shared_profile', null, $user_id, $show_full_profile); echo '
'; echo '
'; echo ' '; // close div tag .socialContentRight echo '
 
'; echo '
'; Display :: display_footer();