, 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 check if there is an attachment $attachment_list=get_attachment($row['post_id']); if (!empty($attachment_list)) { 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') { if (api_get_course_setting('allow_user_image_forum')) { echo '
'.display_user_image($row['user_id'],$name).'
'; } 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(false,true) && !(api_is_course_coach() && $current_forum['session_id']!=$_SESSION['id_session']))) { echo "".icon('../img/edit.gif',get_lang('Edit'))."\n"; } if (api_is_allowed_to_edit(false,true) && !(api_is_course_coach() && $current_forum['session_id']!=$_SESSION['id_session'])) { echo "".icon('../img/delete.gif',get_lang('Delete'))."\n"; display_visible_invisible_icon('post', $row['post_id'], $row['visible'],array('forum'=>Security::remove_XSS($_GET['forum']),'thread'=>Security::remove_XSS($_GET['thread']), 'origin'=>$origin )); echo "\n"; echo "".icon('../img/deplacer_fichier.gif',get_lang('MovePost')).""; } 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(false,true)) { 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'])."
'; $realname=$attachment_list['path']; $user_filename=$attachment_list['filename']; echo Display::return_icon('attachment.gif',get_lang('Attachment')); echo ' '.$user_filename.' '; echo ''.$attachment_list['comment'].'
'; echo '
"; } ?>