isInstalled('forum')) { header('Location: '.e_BASE.'index.php'); exit; } $ns = e107::getRender(); $tp = e107::getParser(); require_once(e_PLUGIN.'forum/forum_class.php'); $forum = new e107forum; include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_conf.php'); $e_sub_cat = 'forum'; if(!USER || !isset($_GET['f']) || !isset($_GET['id'])) { header('location:'.$e107::getUrl()->create('/'), array(), array('encode' => false, 'full' => 1)); exit; } $id = (int)$_GET['id']; $action = $_GET['f']; $qry = " SELECT t.*, f.*, fp.forum_id AS forum_parent_id FROM #forum_t as t LEFT JOIN #forum AS f ON t.thread_forum_id = f.forum_id LEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent WHERE t.thread_id = {$thread_id} "; $threadInfo = $forum->threadGet($id); $modList = $forum->forumGetMods($threadInfo->forum_moderators); //var_dump($threadInfo); //var_dump($modList); //If user is not a moderator of indicated forum, redirect to index page if(!in_array(USERID, array_keys($modList))) { header('location:'.$e107::getUrl()->create('/'), array(), array('encode' => false, 'full' => 1)); exit; } require_once(HEADERF); if (isset($_POST['deletepollconfirm'])) { $sql->delete("poll", "poll_id='".intval($thread_parent)."' "); $sql->select("forum_t", "*", "thread_id='".$thread_id."' "); $row = $sql->fetch(); extract($row); $thread_name = str_replace("[poll] ", "", $thread_name); $sql->update("forum_t", "thread_name='$thread_name' WHERE thread_id='$thread_id' "); $message = FORCONF_5; $url = e_PLUGIN."forum/forum_viewtopic.php?".$thread_id; } if (isset($_POST['move'])) { // print_a($_POST); require_once(e_PLUGIN.'forum/forum_class.php'); $forum = new e107forum; $newThreadTitle = ''; if($_POST['rename_thread'] == 'add') { $newThreadTitle = '['.FORCONF_27.']'; $newThreadTitleType = 0; } elseif($_POST['rename_thread'] == 'rename' && trim($_POST['newtitle']) != '') { $newThreadTitle = $tp->toDB($_POST['newtitle']); $newThreadTitleType = 1; } $threadId = $_GET['id']; $toForum = $_POST['forum_move']; $forum->threadMove($threadId, $toForum, $newThreadTitle, $newThreadTitleType); $message = FORCONF_9;// XXX _URL_ thread name $url = $e107::getUrl()->create('forum/thread/view', 'id='.$threadId); } if (isset($_POST['movecancel'])) { require_once(e_PLUGIN.'forum/forum_class.php'); $forum = new e107forum; $postInfo = $forum->postGet($id, 0, 1); $message = FORCONF_10; // $url = e_PLUGIN."forum/forum_viewforum.php?".$info['forum_id']; $url = $e107::getUrl()->create('forum/forum/view', 'id='.$postInfo[0]['post_forum']);// XXX _URL_ thread name } if ($message) { $text = "