|
|
@ -15,24 +15,12 @@ |
|
|
|
* - new view option: nested view |
|
|
|
* - new view option: nested view |
|
|
|
* - quoting a message |
|
|
|
* - quoting a message |
|
|
|
* |
|
|
|
* |
|
|
|
* @Author Patrick Cool <patrick.cool@UGent.be>, Ghent University |
|
|
|
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University |
|
|
|
* @Copyright Ghent University |
|
|
|
* @author Julio Montoya <gugli100@gmail.com> UI Improvements + lots of bugfixes |
|
|
|
* @Copyright Patrick Cool |
|
|
|
|
|
|
|
* |
|
|
|
* |
|
|
|
* @package dokeos.forum |
|
|
|
* @package chamilo.forum |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
************************************************************************** |
|
|
|
|
|
|
|
* IMPORTANT NOTICE |
|
|
|
|
|
|
|
* Please do not change anything is this code yet because there are still |
|
|
|
|
|
|
|
* some significant code that need to happen and I do not have the time to |
|
|
|
|
|
|
|
* merge files and test it all over again. So for the moment, please do not |
|
|
|
|
|
|
|
* touch the code |
|
|
|
|
|
|
|
* -- Patrick Cool <patrick.cool@UGent.be> |
|
|
|
|
|
|
|
************************************************************************** |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php'; |
|
|
|
require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php'; |
|
|
|
|
|
|
|
|
|
|
|
$rows = get_posts($_GET['thread']); // note: this has to be cleaned first |
|
|
|
$rows = get_posts($_GET['thread']); // note: this has to be cleaned first |
|
|
@ -81,7 +69,7 @@ foreach ($rows as $post) { |
|
|
|
$thread_structure.= $post_image; |
|
|
|
$thread_structure.= $post_image; |
|
|
|
if ($_GET['post']==$post['post_id'] OR ($counter==1 AND !isset($_GET['post']))) |
|
|
|
if ($_GET['post']==$post['post_id'] OR ($counter==1 AND !isset($_GET['post']))) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$thread_structure.='<strong>'.prepare4display(Security::remove_XSS($post['post_title'],STUDENT)).'</strong></div>'; |
|
|
|
$thread_structure.='<strong>'.prepare4display($post['post_title']).'</strong></div>'; |
|
|
|
$prev_next_array[]=$post['post_id']; |
|
|
|
$prev_next_array[]=$post['post_id']; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
@ -95,7 +83,7 @@ foreach ($rows as $post) { |
|
|
|
$class=''; |
|
|
|
$class=''; |
|
|
|
} |
|
|
|
} |
|
|
|
$count_loop=($count==0)?'&id=1' : ''; |
|
|
|
$count_loop=($count==0)?'&id=1' : ''; |
|
|
|
$thread_structure.= "<a href=\"viewthread.php?".api_get_cidreq()."&forum=".Security::remove_XSS($_GET['forum'])."&thread=".Security::remove_XSS($_GET['thread'])."&post=".$post['post_id']."&origin=$origin$count_loop\" $class>".prepare4display(Security::remove_XSS($post['post_title'],STUDENT))."</a></div>"; |
|
|
|
$thread_structure.= "<a href=\"viewthread.php?".api_get_cidreq()."&forum=".Security::remove_XSS($_GET['forum'])."&thread=".Security::remove_XSS($_GET['thread'])."&post=".$post['post_id']."&origin=$origin$count_loop\" $class>".prepare4display($post['post_title'])."</a></div>"; |
|
|
|
$prev_next_array[]=$post['post_id']; |
|
|
|
$prev_next_array[]=$post['post_id']; |
|
|
|
} |
|
|
|
} |
|
|
|
$count++; |
|
|
|
$count++; |
|
|
@ -173,16 +161,14 @@ else |
|
|
|
$leftclass='forum_message_left'; |
|
|
|
$leftclass='forum_message_left'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------- |
|
|
|
|
|
|
|
// Displaying the message |
|
|
|
// Displaying the message |
|
|
|
// -------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// we mark the image we are displaying as set |
|
|
|
// we mark the image we are displaying as set |
|
|
|
unset($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']][$rows[$display_post_id]['post_id']]); |
|
|
|
unset($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']][$rows[$display_post_id]['post_id']]); |
|
|
|
|
|
|
|
|
|
|
|
echo "<table width=\"100%\" class=\"post\" cellspacing=\"5\" border=\"0\">"; |
|
|
|
echo "<table width=\"100%\" class=\"post\" cellspacing=\"5\" border=\"0\">"; |
|
|
|
echo "\t<tr>"; |
|
|
|
echo "<tr>"; |
|
|
|
echo "\t\t<td rowspan=\"3\" class=\"$leftclass\">"; |
|
|
|
echo "<td rowspan=\"3\" class=\"$leftclass\">"; |
|
|
|
if ($rows[$display_post_id]['user_id']=='0') { |
|
|
|
if ($rows[$display_post_id]['user_id']=='0') { |
|
|
|
$name=prepare4display($rows[$display_post_id]['poster_name']); |
|
|
|
$name=prepare4display($rows[$display_post_id]['poster_name']); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -278,13 +264,13 @@ if ($rows[$display_post_id]['post_notification']=='1' AND $rows[$display_post_id |
|
|
|
$post_image.=icon('../img/forumnotification.gif',get_lang('YouWillBeNotified')); |
|
|
|
$post_image.=icon('../img/forumnotification.gif',get_lang('YouWillBeNotified')); |
|
|
|
} |
|
|
|
} |
|
|
|
// The post title |
|
|
|
// The post title |
|
|
|
echo "\t\t<td class=\"$titleclass\">".prepare4display(Security::remove_XSS($rows[$display_post_id]['post_title'], STUDENT))."</td>"; |
|
|
|
echo "<td class=\"$titleclass\">".prepare4display($rows[$display_post_id]['post_title'])."</td>"; |
|
|
|
echo "\t</tr>"; |
|
|
|
echo "</tr>"; |
|
|
|
|
|
|
|
|
|
|
|
// The post message |
|
|
|
// The post message |
|
|
|
echo "\t<tr>"; |
|
|
|
echo "<tr>"; |
|
|
|
echo "\t\t<td class=\"$messageclass\">".prepare4display(Security::remove_XSS($rows[$display_post_id]['post_text'], STUDENT))."</td>"; |
|
|
|
echo "<td class=\"$messageclass\">".prepare4display($rows[$display_post_id]['post_text'])."</td>"; |
|
|
|
echo "\t</tr>"; |
|
|
|
echo "</tr>"; |
|
|
|
|
|
|
|
|
|
|
|
// The check if there is an attachment |
|
|
|
// The check if there is an attachment |
|
|
|
$attachment_list = get_attachment($display_post_id); |
|
|
|
$attachment_list = get_attachment($display_post_id); |
|
|
@ -312,8 +298,6 @@ unset($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id |
|
|
|
unset($_SESSION['whatsnew_post_info'][$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]); |
|
|
|
unset($_SESSION['whatsnew_post_info'][$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]); |
|
|
|
echo "</table>"; |
|
|
|
echo "</table>"; |
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------- |
|
|
|
|
|
|
|
// Displaying the thread (structure) |
|
|
|
// Displaying the thread (structure) |
|
|
|
// -------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo $thread_structure; |
|
|
|
echo $thread_structure; |
|
|
|