* @package dokeos.social */ $language_file = array('registration','messages','userInfo','admin','forum','blog'); $cidReset = true; require '../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'; $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==false) { // 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(SOCIALPARENT, SOCIALFRIEND, SOCIALGOODFRIEND))) { $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(SOCIALPARENT, SOCIALFRIEND, SOCIALGOODFRIEND))) { $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(); $htmlHeadXtra[] = ''; //jQuery $htmlHeadXtra[] = ''; //jQuery corner $htmlHeadXtra[] = ''; $htmlHeadXtra[] = ''; $htmlHeadXtra[] = ' '; $htmlHeadXtra[] = ''; if (isset($_GET['shared'])) { $my_link='../social/index.php'; $link_shared='shared='.Security::remove_XSS($_GET['shared']); } else { $my_link='../auth/profile.php'; $link_shared=''; } $interbreadcrumb[]= array ('url' =>$my_link,'name' => get_lang('ModifyProfile') ); $interbreadcrumb[]= array ( 'url' => '../social/profile.php?'.$link_shared.'#remote-tab-1', 'name' => get_lang('ViewMySharedProfile') ); if (isset($_GET['u']) && is_numeric($_GET['u'])) { $info_user=api_get_user_info($_GET['u']); $interbreadcrumb[]= array ( 'url' => 'javascript: void(0);', 'name' => api_get_person_name($info_user['firstName'], $info_user['lastName']) ); } 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'] = $user_id; /** * Display */ Display :: display_header(null); // @todo here we must show the user information as read only //User picture size is calculated from SYSTEM path $img_array= UserManager::get_user_picture_path_by_id($user_id,'web',true,true); //print_r($user_info); // Added by Ivan Tcholakov, 03-APR-2009. if (USE_JQUERY_CORNERS_SCRIPT) { echo $s=""; } //echo '
'.get_lang('TryAndFindSomeFriends').'
'; //javascript:register_friend(this) //var_dump($pending_invitations); echo '
'; echo '
'; for ($i=0;$i<$count_pending_invitations;$i++) { //var_dump($invitations); echo '
'; echo ''.get_lang('SocialAddToFriends').''; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; } if (!empty($user_info['diplomas'])) { echo '
'; } if (!empty($user_info['openarea'])) { echo '
'; } if (!empty($user_info['teach'])) { echo '
'; } echo '
'; } echo '
'; echo '
'; echo '
'; }*/ // Extra information if ($show_full_profile) { //-- Extra Data $t_uf = Database :: get_main_table(TABLE_MAIN_USER_FIELD); $t_ufo = Database :: get_main_table(TABLE_MAIN_USER_FIELD_OPTIONS); $extra_user_data = UserManager::get_extra_user_data($user_id); $extra_information = ''; if (is_array($extra_user_data) && count($extra_user_data)>0 ) { $extra_information = '
'; $extra_information .='
'; } else { if ($field_type == USER_FIELD_TYPE_DOUBLE_SELECT) { $id_options = explode(';',$data); $value_options = array(); // get option display text from user_field_options table foreach ($id_options as $id_option) { $sql = "SELECT option_display_text FROM $t_ufo WHERE id = '$id_option'"; $res_options = Database::query($sql,__FILE__,__LINE__); $row_options = Database::fetch_row($res_options); $value_options[] = $row_options[0]; } $extra_information_value .= ''.ucfirst($field_display_text).': '.implode(' ',$value_options).'
'; } elseif($field_type == USER_FIELD_TYPE_TAG ) { $user_tags = UserManager::get_user_tags($user_id, $field_id); $tag_tmp = array(); foreach ($user_tags as $tags) { //$tag_tmp[] = $tags['tag']; $tag_tmp[] = ''.$tags['tag'].''; } if (is_array($user_tags) && count($user_tags)>0) { $extra_information_value .= ''.ucfirst($field_display_text).': '.implode(', ',$tag_tmp).'
'; } } else { $extra_information_value .= ''.ucfirst($field_display_text).': '.$data.'
'; } } } } // if there are information to show if (!empty($extra_information_value)) { $extra_information .= $extra_information_value; } $extra_information .= '
'; } // if there are information to show if (!empty($extra_information_value)) echo $extra_information; // ---- My Agenda Items $my_agenda_items = show_simple_personal_agenda($user_id); if (!empty($my_agenda_items)) { echo '
'; echo '
'; } } if(!empty($announcement_content)) { echo '
'; echo '
'; echo '