url->getUrl('core:core', 'main', 'action=index')); 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->url->getUrl('core:core', 'main', 'action=index')); exit; } require_once(HEADERF); if (isset($_POST['deletepollconfirm'])) { $sql->db_Delete("poll", "poll_id='".intval($thread_parent)."' "); $sql->db_Select("forum_t", "*", "thread_id='".$thread_id."' "); $row = $sql->db_Fetch(); extract($row); $thread_name = str_replace("[poll] ", "", $thread_name); $sql->db_Update("forum_t", "thread_name='$thread_name' WHERE thread_id='$thread_id' "); $message = FORLAN_5; $url = e_PLUGIN."forum/forum_viewtopic.php?".$thread_id; } if (isset($_POST['move'])) { require_once(e_PLUGIN."forum/forum_class.php"); $forum = new e107forum; $new_forum = intval($_POST['forum_move']); $replies = $sql->db_Select("forum_t", "*", "thread_parent='$thread_id' "); $sql->db_Select("forum_t", "thread_name, thread_forum_id", "thread_id ='".$thread_id."' "); $row = $sql->db_Fetch(); $old_forum = $row['thread_forum_id']; $new_thread_name = $row['thread_name']; if($_POST['rename_thread'] == 'add') { $new_thread_name = "[".FORLAN_27."] ".$new_thread_name; } elseif($_POST['rename_thread'] == 'rename' && trim($_POST['newtitle']) != "") { $new_thread_name = $tp->toDB($_POST['newtitle']); } $sql->db_Update("forum_t", "thread_forum_id='$new_forum', thread_name='{$new_thread_name}' WHERE thread_id='$thread_id' "); $sql->db_Update("forum_t", "thread_forum_id='$new_forum' WHERE thread_parent='$thread_id' "); $sql->db_Update("forum", "forum_threads=forum_threads-1, forum_replies=forum_replies-$replies WHERE forum_id='$old_forum' "); $sql->db_Update("forum", "forum_threads=forum_threads+1, forum_replies=forum_replies+$replies WHERE forum_id='$new_forum' "); // update lastposts $forum->update_lastpost('forum', $old_forum, FALSE); $forum->update_lastpost('forum', $new_forum, FALSE); $message = FORLAN_9; $url = e_PLUGIN."forum/forum_viewforum.php?".$new_forum; } if (isset($_POST['movecancel'])) { $message = FORLAN_10; $url = e_PLUGIN."forum/forum_viewforum.php?".$info['forum_id']; } if ($message) { $text = "