2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
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: index.php 2526 2004-11-25 18:54:16Z greg$
15 define('AT_INCLUDE_PATH', '../../../../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
17 include(AT_INCLUDE_PATH.'../mods/_standard/forums/lib/forums.inc.php');
19 $fid = intval($_REQUEST['fid']);
21 // check if they have access
22 if (!valid_forum_user($fid) || !$_SESSION['enroll']) {
23 $msg->addError('FORUM_NOT_FOUND');
24 header('Location: list.php');
28 $sql = "SELECT title FROM ".TABLE_PREFIX."forums WHERE forum_id=$fid";
29 $result = mysql_query($sql, $db);
30 if ($row = mysql_fetch_assoc($result)) {
31 $forum_title = $row['title'];
33 $msg->addError('FORUM_NOT_FOUND');
34 header('Location: list.php');
38 if (isset($_GET['us'])) {
39 $sql = "DELETE from ".TABLE_PREFIX."forums_subscriptions WHERE forum_id = $fid AND member_id = $_SESSION[member_id]";
40 $result = mysql_query($sql, $db);
41 $msg->addFeedback(array(FORUM_UNSUBSCRIBED, $forum_title));
44 $sql = "INSERT into ".TABLE_PREFIX."forums_subscriptions VALUES($fid, '$_SESSION[member_id]')";
45 mysql_query($sql, $db);
47 $msg->addFeedback(array(FORUM_SUBSCRIBED,$forum_title));
50 header('Location: list.php');