echo $retext; require_once FOOTERF; exit; } if ($_GET['f'] != 'last') { $thread->init(); } } e107::getScBatch('view', 'forum')->setScVar('thread', $thread); $pm_installed = e107::isInstalled('pm'); //Only increment thread views if not being viewed by thread starter if (USER && (USERID != $thread->threadInfo['thread_user'] || $thread->threadInfo['thread_total_replies'] > 0) || !$thread->noInc) { $forum->threadIncview($thread->threadInfo['thread_id']); } define('e_PAGETITLE', strip_tags($tp->toHTML($thread->threadInfo['thread_name'], true, 'no_hook, emotes_off')) . ' / ' . $tp->toHTML($thread->threadInfo['forum_name'], true, 'no_hook, emotes_off') . ' / ' . LAN_FORUM_1001); $forum->modArray = $forum->forumGetMods($thread->threadInfo['forum_moderators']); define('MODERATOR', USER && $forum->isModerator(USERID)); e107::getScBatch('view', 'forum')->setScVar('forum', $forum); //var_dump(e107::getScBatch('forum', 'forum')); if (MODERATOR && isset($_POST['mod'])) { require_once e_PLUGIN . "forum/forum_mod.php"; $thread->message = forum_thread_moderate($_POST); $thread->threadInfo = $forum->threadGet($thread->threadId); } $num = $thread->page ? $thread->page - 1 : 0; $postList = $forum->PostGet($thread->threadId, $num * $thread->perPage, $thread->perPage); // SEO - meta description (auto) if (count($postList)) { define("META_DESCRIPTION", $tp->text_truncate(str_replace(array('"', "'"), '', strip_tags($tp->toHTML($postList[0]['post_entry']))), 250, '...')); } $gen = new convert();
$ns = e107::getRender(); $tp = e107::getParser(); require_once e_PLUGIN . 'forum/forum_class.php'; $forum = new e107forum(); e107::lan('forum', 'admin'); //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 = "\nSELECT t.*, f.*, fp.forum_id AS forum_parent_id FROM #forum_thread as t\nLEFT JOIN #forum AS f ON t.thread_forum_id = f.forum_id\nLEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent\nWHERE t.thread_id = {$thread_id}\n"; $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_thread", "*", "thread_id='" . $thread_id . "' "); $row = $sql->fetch(); extract($row); $thread_name = str_replace("[poll] ", "", $thread_name); $sql->update("forum_thread", "thread_name='{$thread_name}' WHERE thread_id='{$thread_id}' ");