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 '
'; - 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 '
'; - echo ''.$thread['post_title'].''; echo '
'; - echo cut($thread['post_text'], 150); - echo '
'; - */ - foreach($post_list as $posts) { - echo '
'; - echo cut($posts['post_text'], 150); - echo '
'; - } - } - 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 '
'; + echo ''.$thread['post_title'].''; echo '
'; + echo cut($thread['post_text'], 150); + echo '
'; + */ + foreach($post_list as $posts) { + echo '
'; + echo cut($posts['post_text'], 150); + echo '
'; + } + } + echo '