, Ghent University * @Copyright Ghent University * @Copyright Patrick Cool * * @package dokeos.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 ************************************************************************** */ $rows=get_posts($current_thread['thread_id']); foreach ($rows as $row) { echo "\n"; // the style depends on the status of the message: approved or not if ($row['visible']=='0') { $titleclass='forum_message_post_title_2_be_approved'; $messageclass='forum_message_post_text_2_be_approved'; $leftclass='forum_message_left_2_be_approved'; } else { $titleclass='forum_message_post_title'; $messageclass='forum_message_post_text'; $leftclass='forum_message_left'; } echo "\t\n"; echo "\t\t\n"; // show the if (isset($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]) and !empty($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]) and !empty($whatsnew_post_info[$_GET['forum']][$row['thread_id']])) { $post_image=icon('../img/forumpostnew.gif'); } else { $post_image=icon('../img/forumpost.gif'); } if ($row['post_notification']=='1' AND $row['poster_id']==$_user['user_id']) { $post_image.=icon('../img/forumnotification.gif',get_lang('YouWillBeNotified')); } // The post title echo "\t\t\n"; echo "\t\n"; // The post message echo "\t\n"; echo "\t\t\n"; echo "\t\n"; // The added resources /* echo ""; */ // The post has been displayed => it can be removed from the what's new array unset($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]); 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']]); echo "
"; if ($row['user_id']=='0') { $name=prepare4display($row['poster_name']); } else { $name=$row['firstname'].' '.$row['lastname']; } if($origin!='learnpath') { echo display_user_link($row['user_id'], $name).'
'; } else { echo $name. '
'; } echo $row['post_date'].'

'; // The user who posted it can edit his thread only if the course admin allowed this in the properties of the forum // The course admin him/herself can do this off course always if (($current_forum['allow_edit']==1 AND $row['user_id']==$_user['user_id']) or api_is_allowed_to_edit()) { echo "".icon('../img/edit.gif',get_lang('Edit'))."\n"; } if (api_is_allowed_to_edit()) { echo "".icon('../img/delete.gif',get_lang('Delete'))."\n"; display_visible_invisible_icon('post', $row['post_id'], $row['visible'],array('forum'=>$_GET['forum'],'thread'=>$_GET['thread'], 'origin'=>$origin )); echo "\n"; echo "".icon('../img/deplacer_fichier.gif',get_lang('Edit')).""; } echo '

'; //if (($current_forum_category['locked']==0 AND $current_forum['locked']==0 AND $current_thread['locked']==0) OR api_is_allowed_to_edit()) if ($current_forum_category['locked']==0 AND $current_forum['locked']==0 AND $current_thread['locked']==0 OR api_is_allowed_to_edit()) { if ($_user['user_id'] OR ($current_forum['allow_anonymous']==1 AND !$_user['user_id'])) { echo ''.get_lang('ReplyToMessage').'
'; echo ''.get_lang('QuoteMessage').'

'; } } else { if ($current_forum_category['locked']==1) { echo get_lang('ForumcategoryLocked').'
'; } if ($current_forum['locked']==1) { echo get_lang('ForumLocked').'
'; } if ($current_thread['locked']==1) { echo get_lang('ThreadLocked').'
'; } } echo "
".prepare4display($row['post_title'])."
".prepare4display($row['post_text'])."
"; if (check_added_resources("forum_post", $row["post_id"])) { echo "".get_lang("AddedResources")."
"; if ($row['visible']=='0') { $addedresource_style="invisible"; } display_added_resources("forum_post", $row["post_id"], $addedresource_style); } echo "
"; } ?>