123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?php
- require_once __DIR__.'/../inc/global.inc.php';
- api_protect_course_script(true);
- $nameTools = get_lang('ToolForum');
- Display::display_reduced_header();
- require 'forumconfig.inc.php';
- require_once 'forumfunction.inc.php';
- $current_thread = get_thread_information(
- $_GET['forum'],
- $_GET['thread']
- );
- $current_forum = get_forum_information($current_thread['forum_id']);
- $current_forum_category = get_forumcategory_information(
- $current_forum['forum_category']
- );
- if (!api_is_allowed_to_edit(false, true) && ($current_forum['visibility'] == 0 || $current_thread['visibility'] == 0)) {
- api_not_allowed(false);
- }
- $course_id = api_get_course_int_id();
- $sql = "SELECT * FROM $table_posts posts, $table_users users
- WHERE
- posts.c_id = $course_id AND
- posts.thread_id='".$current_thread['thread_id']."' AND
- posts.poster_id=users.user_id
- ORDER BY posts.post_id ASC";
- $result = Database::query($sql);
- echo "<table width=\"100%\" height=\"100%\" cellspacing=\"5\" border=\"0\">";
- while ($row = Database::fetch_array($result)) {
- echo "<tr>";
- echo "<td rowspan=\"2\" class=\"forum_message_left\">";
- $username = api_htmlentities(sprintf(get_lang('LoginX'), $row['username']), ENT_QUOTES);
- if ($row['user_id'] == '0') {
- $name = $row['poster_name'];
- } else {
- $name = api_get_person_name($row['firstname'], $row['lastname']);
- }
- echo Display::tag('span', $name, array('title'=>$username)).'<br />';
- echo api_convert_and_format_date($row['post_date']).'<br /><br />';
- echo "</td>";
- echo "<td class=\"forum_message_post_title\">".Security::remove_XSS($row['post_title'])."</td>";
- echo "</tr>";
- echo "<tr>";
- echo "<td class=\"forum_message_post_text\">".Security::remove_XSS($row['post_text'], STUDENT)."</td>";
- echo "</tr>";
- }
- echo "</table>";
- ?>
- </body>
- </html>
|