// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // | GNU General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to the Free Software Foundation, | // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ // require_once "../lib-common.php"; require_once $_CONF['path_html'] . 'forum/include/gf_format.php'; require_once $_CONF['path_html'] . 'forum/include/gf_showtopic.php'; require_once $_CONF['path'] . 'plugins/forum/debug.php'; // Common Debug Code // Display Common headers gf_siteHeader(); // Check for access privilege and pass true to check that user is signed in. forum_chkUsercanAccess(true); $forum = COM_applyFilter($_REQUEST['forum'], true); $showtopic = COM_applyFilter($_REQUEST['showtopic'], true); ForumHeader($forum, $showtopic); // Pass thru filter any get or post variables to only allow numeric values and remove any hostile data $fortopicid = COM_applyFilter($_REQUEST['fortopicid'], true); $moveid = COM_applyFilter($_REQUEST['moveid'], true); $top = COM_applyFilter($_REQUEST['top']); $movetoforum = COM_applyFilter($_REQUEST['movetoforum'], true); $msgid = COM_applyFilter($_REQUEST['msgid'], true); $msgpid = COM_applyFilter($_REQUEST['msgpid'], true); $fortopicid = COM_applyFilter($_REQUEST['fortopicid'], true); $modfunction = COM_applyFilter($_REQUEST['modfunction']); $submit = $_POST['submit'];
$tsql = DB_query("SELECT id FROM {$_TABLES['gf_topic']} WHERE forum={$frecord['forum_id']} and pid=0"); while ($trecord = DB_fetchArray($tsql)) { $log_sql = DB_query("SELECT * FROM {$_TABLES['gf_log']} WHERE uid={$_USER['uid']} AND topic={$trecord['id']} AND forum={$frecord['forum_id']}"); if (DB_numRows($log_sql) == 0) { DB_query("INSERT INTO {$_TABLES['gf_log']} (uid,forum,topic,time) VALUES ('{$_USER['uid']}','{$frecord['forum_id']}','{$trecord['id']}','{$now}')"); } } } } } echo COM_refresh($_CONF['site_url'] . '/forum/index.php'); exit; } // Display Common headers ob_start(); echo gf_siteHeader(); //Check if anonymous users allowed to access forum forum_chkUsercanAccess(); if ($op == 'newposts' and $_USER['uid'] > 1) { $report = new Template($_CONF['path_layout'] . 'forum/layout'); $report->set_file(array('report' => 'reports/report_results.thtml', 'records' => 'reports/report_record.thtml', 'outline_header' => 'forum_outline_header.thtml', 'outline_footer' => 'forum_outline_footer.thtml', 'markread' => 'links/markread.thtml', 'return' => 'links/return.thtml')); switch ($order) { case 1: $orderby = 'subject'; break; case 2: $orderby = 'views'; break; case 3: $orderby = 'replies'; break;