diff --git a/main/css/public_admin/default.css b/main/css/public_admin/default.css index 9281f5197a..11270a9a70 100644 --- a/main/css/public_admin/default.css +++ b/main/css/public_admin/default.css @@ -2469,7 +2469,7 @@ div.image-social-content center.friend { } #social-profile-content { float:right; - width:48%; + width:47%; } #social-profile-right { float:right; diff --git a/main/social/profile.php b/main/social/profile.php index f8dc4e9c51..cfcecb426c 100644 --- a/main/social/profile.php +++ b/main/social/profile.php @@ -15,6 +15,7 @@ $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; @@ -461,16 +462,23 @@ $personal_course_list = UserManager::get_personal_session_course_list($my_user_i $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[] = get_logged_user_course_html($my_course,$i); - $course_list_code[] = array('code'=>$my_course['c'],'dbName'=>$my_course['db'], 'title'=>$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); } echo '
'; @@ -504,6 +512,7 @@ echo '
'; if (count($list_path_friends)!=0) { $friends_count = count($list_path_friends['id_friend']); + for ($z=0;$z< $friends_count ;$z++) { $list_friends_id[] = $list_path_friends['id_friend'][$z]['friend_user_id']; $list_friends_dir[] = $list_path_friends['path_friend'][$z]['dir']; @@ -546,12 +555,12 @@ echo '
'; } } } else { + // No friends!! :( $friend_html .= '
'.get_lang('Friends').'
'; $friend_html.= ''; echo $friend_html; @@ -568,7 +577,7 @@ echo '
'; if ($count_pending_invitations > 0) { echo '
'; echo api_convert_encoding(get_lang('PendingInvitations'),$charset,'UTF-8'); - echo '
'; + echo '

'; for ($i=0;$i<$count_pending_invitations;$i++) { //var_dump($invitations); echo '
'; @@ -601,19 +610,19 @@ echo '
'; } // Images uploaded by course - $file_list = ''; + $file_list = ''; if (is_array($course_list_code) && count($course_list_code)>0) { foreach ($course_list_code as $course) { $file_list.= UserManager::get_user_upload_files_by_course($user_id,$course['code']); - } + } } - + if (!empty($file_list)) { echo '

'; echo '
'; echo get_lang('ImagesUploaded'); - echo '
'; - echo '
'; + echo '

'; + echo '
'; } @@ -670,6 +679,7 @@ echo '
'; echo '
'; // LEFT COLUMN echo '
'; + //--- User image echo '