a thread */ $vForumId = new Valid_UInt('forum_id'); $vForumId->required(); if ($request->valid($vForumId)) { $forum_id = $request->get('forum_id'); // Check permissions if (!forum_utils_access_allowed($forum_id)) { exit_error($Language->getText('global', 'error'), $Language->getText('forum_forum', 'forum_restricted')); } //If the forum is associated to a private news, non-allowed users shouldn't be able to monitor this forum // but they should be able to disable monitoring news that have been set from public to private $qry = "SELECT * FROM news_bytes WHERE forum_id=" . db_ei($forum_id); $res = db_query($qry); if (db_numrows($res) > 0) { if (!forum_utils_news_access($forum_id) && !user_monitor_forum($forum_id, user_getid())) { exit_error($Language->getText('global', 'error'), $Language->getText('news_admin_index', 'permission_denied')); } } $forum_monitor_error = false; if (user_monitor_forum($forum_id, user_getid())) { // If already monitored then stop monitoring forum_delete_monitor($forum_id, user_getid()); } else { // Not yet monitored so add it $forum_monitor_error = !forum_add_monitor($forum_id, user_getid()); } /* Set up navigation vars */ $result = db_query("SELECT group_id,forum_name,is_public FROM forum_group_list WHERE group_forum_id=" . db_ei($forum_id));
/* User obviously has to be logged in to save place */ $vForumId = new Valid_UInt('forum_id'); $vForumId->required(); if ($request->valid($vForumId)) { $forum_id = $request->get('forum_id'); // Check permissions if (!forum_utils_access_allowed($forum_id)) { exit_error($Language->getText('global', 'error'), $Language->getText('forum_forum', 'forum_restricted')); } //If the forum is associated to a private news, non-allowed users shouldn't be able to save their places in this forum $qry = "SELECT * FROM news_bytes WHERE forum_id=" . db_ei($forum_id); $res = db_query($qry); if (db_numrows($res) > 0) { if (!forum_utils_news_access($forum_id)) { exit_error($Language->getText('global', 'error'), $Language->getText('news_admin_index', 'permission_denied')); } } /* First check to see if they already saved their place If they have NOT, then insert a row into the db ELSE update the time() */ /* Set up navigation vars */ $result = db_query("SELECT group_id,forum_name,is_public FROM forum_group_list WHERE group_forum_id=" . db_ei($forum_id)); $group_id = db_result($result, 0, 'group_id'); $forum_name = db_result($result, 0, 'forum_name');