2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Joel Kronenberg & Heidi Hazelton*/
6 /* Adaptive Technology Resource Centre / University of Toronto */
9 /* This program is free software. You can redistribute it and/or */
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /************************************************************************/
13 // $Id: posts.inc.php 4812 2005-06-07 19:52:15Z joel $
15 if (!defined('AT_INCLUDE_PATH')) { exit; }
20 //Number of posts to display
25 $forum_list = get_group_concat('forums_courses', 'forum_id', "course_id={$_SESSION['course_id']}");
26 if ($forum_list != 0) {
27 $sql = "SELECT subject, post_id, forum_id, member_id FROM ".TABLE_PREFIX."forums_threads WHERE parent_id=0 AND forum_id IN ($forum_list) ORDER BY last_comment DESC LIMIT $post_limit";
28 $result = mysql_query($sql, $db);
30 if (mysql_num_rows($result) > 0) {
31 while ($row = mysql_fetch_assoc($result)) {
32 echo '° <a href="' . $_base_path.url_rewrite('forum/view.php?fid=' . $row['forum_id'] . SEP . 'pid=' . $row['post_id']) . '" title="' . $row['subject'] . ': ' . htmlspecialchars(get_display_name($row['member_id'])) . '">' . AT_print(validate_length($row['subject'], 20, VALIDATE_LENGTH_FOR_DISPLAY), 'forums_threads.subject') . '</a><br />';
35 echo '<em>'._AT('none_found').'</em>';
38 echo '<em>'._AT('none_found').'</em>';
41 $savant->assign('dropdown_contents', ob_get_contents());
44 $savant->assign('title', _AT('forum_posts'));
45 $savant->display('include/box.tmpl.php');