|
|
|
@ -3898,23 +3898,28 @@ function get_thread_user_post($course_db, $thread_id, $user_id ) |
|
|
|
|
$j=0; |
|
|
|
|
$forums = get_forums(); |
|
|
|
|
krsort($forums); |
|
|
|
|
$forum_results = ''; |
|
|
|
|
$forum_results = ''; |
|
|
|
|
|
|
|
|
|
foreach($forums as $forum) { |
|
|
|
|
if ($j<=4) { |
|
|
|
|
$threads = get_threads($forum['forum_id']); |
|
|
|
|
$threads = get_threads($forum['forum_id']); |
|
|
|
|
|
|
|
|
|
if (is_array($threads)) { |
|
|
|
|
/*echo Display::return_icon('forum.gif'); |
|
|
|
|
echo $forum['forum_title'];*/ |
|
|
|
|
$my_course_db=explode('_',$course_db); |
|
|
|
|
$my_course_code=$my_course_db[1]; |
|
|
|
|
//$my_course_db=explode('_',$course_db); |
|
|
|
|
//$my_course_code=$my_course_db[1]; |
|
|
|
|
$my_course_code=CourseManager::get_course_id_by_database_name($course_db); |
|
|
|
|
$i=0; |
|
|
|
|
$hand_forums = ''; |
|
|
|
|
$post_counter = 0; |
|
|
|
|
foreach($threads as $thread) { |
|
|
|
|
if ($i<=4) { |
|
|
|
|
$post_list = get_thread_user_post_limit($course_db, $thread['thread_id'], $user_id, 1); |
|
|
|
|
|
|
|
|
|
$post_counter = count($post_list); |
|
|
|
|
if (is_array($post_list) && count($post_list)>0) { |
|
|
|
|
|
|
|
|
|
$hand_forums.= '<div id="social-thread">'; |
|
|
|
|
$hand_forums.= Display::return_icon('forumthread.gif'); |
|
|
|
|
$hand_forums.= $thread['thread_title'].' '; |
|
|
|
@ -3930,17 +3935,18 @@ function get_thread_user_post($course_db, $thread_id, $user_id ) |
|
|
|
|
$hand_forums.= '</div>'; |
|
|
|
|
} |
|
|
|
|
$i++; |
|
|
|
|
} |
|
|
|
|
if ($post_counter > 0 ) { |
|
|
|
|
$forum_results .='<div id="social-forum">'; |
|
|
|
|
$forum_results .='<div class="clear"></div><br />'; |
|
|
|
|
$forum_results .='<div class="actions" style="margin-left:5px;margin-right:5px;">'.Display::return_icon('forum.gif').' '.$forum['forum_title'].' <div style="float:right;margin-top:-18px"><a href="../forum/viewforum.php?cidReq='.$my_course_code.'&gidReq=&forum='.$forum['forum_id'].' " >'.get_lang('SeeForum').'</a></div></div>'; |
|
|
|
|
$forum_results .='<br / >'; |
|
|
|
|
$forum_results .=$hand_forums; |
|
|
|
|
$forum_results .='</div>'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} $j++; |
|
|
|
|
|
|
|
|
|
if ($post_counter > 0 ) { |
|
|
|
|
$forum_results .='<div id="social-forum">'; |
|
|
|
|
$forum_results .='<div class="clear"></div><br />'; |
|
|
|
|
$forum_results .='<div class="actions" style="margin-left:5px;margin-right:5px;">'.Display::return_icon('forum.gif').' '.$forum['forum_title'].' <div style="float:right;margin-top:-18px"><a href="../forum/viewforum.php?cidReq='.$my_course_code.'&gidReq=&forum='.$forum['forum_id'].' " >'.get_lang('SeeForum').'</a></div></div>'; |
|
|
|
|
$forum_results .='<br / >'; |
|
|
|
|
$forum_results .=$hand_forums; |
|
|
|
|
$forum_results .='</div>'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} $j++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return $forum_results; |
|
|
|
|
} |
|
|
|
@ -3957,7 +3963,7 @@ function get_thread_user_post_limit($course_db, $thread_id, $user_id, $limit=10) |
|
|
|
|
AND posts.poster_id='".Database::escape_string($user_id)."' |
|
|
|
|
ORDER BY posts.post_id DESC LIMIT $limit "; |
|
|
|
|
$result=api_sql_query($sql, __FILE__, __LINE__); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while ($row=Database::fetch_array($result)) { |
|
|
|
|
$row['status'] = '1'; |
|
|
|
|
$post_list[]=$row; |
|
|
|
|