public function __construct($themes_system = 'frontend') { // Parent Method parent::__construct(); // Development Profiler if (ENVIRONMENT == 'development') { $this->output->enable_profiler(TRUE); } // Load Libraries $this->load->library('user_agent'); // Load Drivers $this->load->driver('session'); // Load Database $this->load->database(); // Load Helpers $this->load->helper('route'); $this->load->helper('auth'); $this->load->helper('date'); $this->load->helper('url'); $this->load->helper('cookie'); $this->load->helper('text_helper'); $this->load->helper('form'); $this->load->helper('pagination'); $this->load->helper('translate'); $this->load->helper('breadcrumb'); // Load Specific Models $this->load->model('settings_model'); // Load System Config $this->settings_model->load('system'); // Check if session is locked if (is_locked()) { redirect('auth/locked'); } else { // Otherwise update last activity update_last_activity(); } // Load System Config $this->settings_model->load('system'); // Load Other Model $this->load->model('auth_model'); $this->load->model('mailer_model'); $this->load->model('translate_model'); // Load Library $this->load->library('template', array('themes_system' => $themes_system, 'themes_default' => $this->settings_model->system['_system_theme_frontend_'])); }
include 'header.php'; foreach (array('forum', 'topic_id', 'post_id', 'order', 'pid') as $getint) { ${$getint} = isset($HTTP_GET_VARS[$getint]) ? intval($HTTP_GET_VARS[$getint]) : 0; } $viewmode = isset($HTTP_GET_VARS['viewmode']) && $HTTP_GET_VARS['viewmode'] != 'flat' ? 'thread' : 'flat'; if (empty($forum)) { redirect_header("index.php", 2, _MD_ERRORFORUM); exit; } elseif (empty($topic_id)) { redirect_header("viewforum.php?forum={$forum}", 2, _MD_ERRORTOPIC); exit; } elseif (empty($post_id)) { redirect_header("viewtopic.php?topic_id={$topic_id}&order={$order}&viewmode={$viewmode}&pid={$pid}&forum={$forum}", 2, _MD_ERRORPOST); exit; } else { if (is_locked($topic_id)) { redirect_header("viewtopic.php?topic_id={$topic_id}&order={$order}&viewmode={$viewmode}&pid={$pid}&forum={$forum}", 2, _MD_TOPICLOCKED); exit; } $sql = "SELECT forum_type, forum_name, forum_access, allow_html, allow_sig, posts_per_page, hot_threshold, topics_per_page FROM " . $xoopsDB->prefix("bb_forums") . " WHERE forum_id = {$forum}"; if (!($result = $xoopsDB->query($sql))) { redirect_header('index.php', 1, _MD_ERROROCCURED); exit; } $forumdata = $xoopsDB->fetchArray($result); $myts =& MyTextSanitizer::getInstance(); if ($forumdata['forum_type'] == 1) { // To get here, we have a logged-in user. So, check whether that user is allowed to post in // this private forum. $accesserror = 0; //initialize
$rowQ1 = Q_Select("SELECT forum_name, forum_moderator, forum_type, forum_pass, forum_access, arbre FROM " . $NPDS_Prefix . "forums WHERE forum_id = '{$forum}'", 3600); if (!$rowQ1) { forumerror('0001'); } list(, $myrow) = each($rowQ1); $forum_name = $myrow['forum_name']; $forum_access = $myrow['forum_access']; $forum_type = $myrow['forum_type']; $mod = $myrow['forum_moderator']; if ($forum_type == 1 and $Forum_passwd != $myrow['forum_pass']) { header("Location: forum.php"); } if ($forum_access == 9) { header("Location: forum.php"); } if (is_locked($topic)) { forumerror('0025'); } if (!does_exists($forum, "forum") || !does_exists($topic, "topic")) { forumerror('0026'); } settype($submitS, 'string'); settype($stop, 'integer'); if ($submitS) { if ($message == '') { $stop = 1; } if (!isset($user)) { if ($forum_access == 0) { $userdata = array("uid" => 1); $modo = "";