diff --git a/main/announcements/announcements.inc.php b/main/announcements/announcements.inc.php index 2102fae766..a03e0bf99b 100644 --- a/main/announcements/announcements.inc.php +++ b/main/announcements/announcements.inc.php @@ -1,4 +1,4 @@ -0) { - while ($myrow = Database::fetch_array($result)) { - $content.= ''.$myrow['title'].'

'; - $content.= $myrow['content']; + while ($myrow = Database::fetch_array($result)) { + if ($i<=4) { + $content.= ''.$myrow['title'].'

'; + $content.= $myrow['content']; + } else { + break; + } + $i++; } return $content; } else { diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index 823a1793c2..a58f780848 100644 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -3792,37 +3792,45 @@ function get_thread_user_post($course_db, $thread_id, $user_id ) function get_all_post_from_user($user_id, $course_db) { + $j=0; $forums = get_forums(); - foreach($forums as $forum) { - $threads = get_threads($forum['forum_id']); - if (is_array($threads)) { - echo '
'; - echo Display::return_icon('forum.gif'); - echo $forum['forum_title']; - echo '
'; echo '
'; - foreach($threads as $thread) { - $post_list = get_thread_user_post_limit($course_db, $thread['thread_id'], $user_id, 1); - if (is_array($post_list) && count($post_list)>0) { - echo '
'; - echo Display::return_icon('forumthread.gif'); - echo $thread['thread_title'].' '; - /* echo '
'; echo '
'; - echo ''.$thread['post_title'].''; echo '
'; - echo cut($thread['post_text'], 150); - echo '
'; - */ - foreach($post_list as $posts) { - echo '
'; - echo ''.$posts['post_title'].''; echo '
'; - echo cut($posts['post_text'], 150); - echo '
'; - echo '
'; - } - } - echo '
'; + krsort($forums); + foreach($forums as $forum) { + if ($j<=4) { + $threads = get_threads($forum['forum_id']); + if (is_array($threads)) { + echo '
'; + echo Display::return_icon('forum.gif'); + echo $forum['forum_title']; + echo '
'; echo '
'; + $i=0; + foreach($threads as $thread) { + if ($i<=4) { + $post_list = get_thread_user_post_limit($course_db, $thread['thread_id'], $user_id, 1); + if (is_array($post_list) && count($post_list)>0) { + echo '
'; + echo Display::return_icon('forumthread.gif'); + echo $thread['thread_title'].' '; + /* echo '
'; echo '
'; + echo ''.$thread['post_title'].''; echo '
'; + echo cut($thread['post_text'], 150); + echo '
'; + */ + foreach($post_list as $posts) { + echo '
'; + echo ''.$posts['post_title'].''; echo '
'; + echo cut($posts['post_text'], 150); + echo '
'; + echo '
'; + } + } + echo '
'; + } + $i++; + } } - } - echo '
'; + echo '
'; + } $j++; } //$list = get_thread_user_post($course['dbName'],$thread_id, $user_id); } diff --git a/main/social/profile.php b/main/social/profile.php index d80f4dc988..f7ae5a5795 100644 --- a/main/social/profile.php +++ b/main/social/profile.php @@ -5,7 +5,7 @@ Copyright (c) 2009 Dokeos SPRL Copyright (c) Julio Montoya Armas - + Copyright (c) Isaac Flores Paz For a full list of contributors, see "credits.txt". The full license can be read in "license.txt". @@ -24,6 +24,7 @@ ============================================================================== * This is the profile social main page * @author Julio Montoya +* @author Isaac Flores Paz ============================================================================= */ @@ -513,10 +514,10 @@ echo '
'; } //$friend_html.='
'; // close the div friend-container } else { - $friend_html.= '
'; - $friend_html .= api_display_tool_title(get_lang('Friends')); + $friend_html.= '
'; + $friend_html .= '
'.api_display_tool_title(get_lang('Friends')).'
'; $friend_html.= '
'; - $friend_html.= '
0 '.get_lang('Friends').'
'; + $friend_html.= '
'.get_lang('Friends').'
'; $friend_html.= '
'.get_lang('SeeAll').'
'; $friend_html.= '


'; // close div friend-header } @@ -556,7 +557,9 @@ echo '
'; $production_list = UserManager::build_production_list($user_id); if (!empty($production_list )) { echo '

'; + echo '
'; api_display_tool_title(get_lang('Productions')); + echo '
'; echo '
'; echo $production_list; echo '
'; @@ -568,8 +571,11 @@ echo '
'; $file_list.= UserManager::get_user_upload_files_by_course($user_id,$course['code']); } if (!empty($file_list)) { + echo '

'; + echo '
'; api_display_tool_title(get_lang('ImagesUploaded')); - echo '
'; + echo '
'; + echo '
'; echo $file_list; echo '
'; } @@ -607,7 +613,9 @@ echo '
'; //-- Extra Data $extra_user_data = UserManager::get_extra_user_data($user_id); if (is_array($extra_user_data) && count($extra_user_data)>0 ) { + echo '
'; api_display_tool_title(get_lang('ExtraInformation')); + echo '
'; echo '
'; foreach($extra_user_data as $key=>$data) { echo ucfirst($key).': '.$data; @@ -618,8 +626,10 @@ echo '
'; } // ---- My Agenda Items $my_agenda_items = show_simple_personal_agenda($user_id); - if (!empty($my_agenda_items)) { + if (!empty($my_agenda_items)) { + echo '
'; api_display_tool_title(get_lang('MyAgenda')); + echo '
'; $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); echo '
'; echo $my_agenda_items; @@ -632,9 +642,9 @@ echo '
'; $announcement_content = ''; foreach ($course_list_code as $course) { - $content = get_all_annoucement_by_user_course($course['dbName'],$user_id); + $content = get_all_annoucement_by_user_course($course['dbName'],$user_id); if (!empty($content)) { - $announcement_content.= '

'.$course['title'].'

'; + $announcement_content.= '

'.$course['title'].'

'; $announcement_content.= '
'; $announcement_content.= $content; $announcement_content.= '
'; @@ -643,7 +653,9 @@ echo '
'; } if(!empty($announcement_content)) { + echo '
'; api_display_tool_title(get_lang('Announcements')); + echo '
'; echo $announcement_content; } } @@ -651,9 +663,10 @@ echo '
'; // CENTER COLUMN echo '
'; - //--- Basic Information + //--- Basic Information + echo '
'; api_display_tool_title(get_lang('Information')); //class="social-profile-info" - + echo '
'; if ($show_full_profile) { echo '