2 /****************************************************************************/
4 /****************************************************************************/
5 /* Copyright (c) 2002-2006 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 /****************************************************************************/
15 define('AT_INCLUDE_PATH', '../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
18 $fid = intval($_GET['fid']);
20 if (!isset($_GET['fid']) || !$fid) {
21 header('Location: list.php');
24 require(AT_INCLUDE_PATH.'lib/forums.inc.php');
26 if (!valid_forum_user($fid)) {
27 require(AT_INCLUDE_PATH.'header.inc.php');
28 $msg->addError('FORUM_DENIED');
30 require(AT_INCLUDE_PATH.'footer.inc.php');
33 $_pages['forum/index.php']['title'] = get_forum_name($fid);
34 $_pages['forum/index.php']['parent'] = 'forum/list.php';
35 $_pages['forum/index.php']['children'] = array('forum/new_thread.php?fid='.$fid);
37 $_pages['forum/new_thread.php?fid='.$fid]['title_var'] = 'new_thread';
38 $_pages['forum/new_thread.php?fid='.$fid]['parent'] = 'forum/index.php';
40 /* the last accessed field */
41 $last_accessed = array();
42 if ($_SESSION['valid_user'] && $_SESSION['enroll']) {
43 $sql = "SELECT post_id, last_accessed + 0 AS last_accessed, subscribe FROM ".TABLE_PREFIX."forums_accessed WHERE member_id=$_SESSION[member_id]";
44 $result = mysql_query($sql, $db);
45 while ($row = mysql_fetch_assoc($result)) {
46 $post_id = $row['post_id'];
47 unset($row['post_id']);
48 $last_accessed[$post_id] = $row;
52 require(AT_INCLUDE_PATH . 'header.inc.php');
54 require(AT_INCLUDE_PATH . 'html/forum.inc.php');
56 require(AT_INCLUDE_PATH . 'footer.inc.php');