} elseif ($_GET['error'] == 5) { $errorb = $locale['forum_0555']; } elseif ($_GET['error'] == 6) { $errorb = sprintf($locale['forum_0556'], $forum_settings['forum_edit_timelimit']); } $valid_get = array("on", "off", "new", "reply", "edit", "newpoll", "editpoll", "deletepoll", "voteup", "votedown"); if (!iMEMBER || !in_array($_GET['post'], $valid_get)) { redirect(INFUSIONS . "forum/index.php"); } // When voting up or down if ($_GET['post'] == 'voteup' or $_GET['post'] == 'votedown') { // @todo: extend on user's rank threshold before can vote. - Reputation threshold- Roadmap 9.1 include INFUSIONS . 'forum/classes/Viewthread.php'; include INFUSIONS . 'forum/forum_include.php'; include INFUSIONS . 'forum/classes/Functions.php'; $thread = new \PHPFusion\Forums\Viewthread(); $thread_info = $thread->get_thread_data(); if ($thread_info['permissions']['can_rate']) { // init vars $data = array('forum_id' => $thread_info['forum_id'], 'thread_id' => $thread_info['thread_id'], 'post_id' => $thread_info['post_id'], 'vote_user' => $userdata['user_id'], 'vote_datestamp' => time()); if ($_GET['post'] == 'voteup') { $data['vote_points'] = 1; } elseif ($_GET['post'] == 'votedown') { $data['vote_points'] = -1; } $res = dbcount("('vote_user')", DB_FORUM_VOTES, "vote_user='******'user_id']) . "' AND thread_id='" . intval($data['thread_id']) . "'"); if (!$res) { // has not voted $self_post = dbcount("('post_id')", DB_FORUM_POSTS, "post_id='" . intval($data['post_id']) . "' AND post_user='******'user_id'] . ""); if (!$self_post) { // cannot vote at your own post.
include INFUSIONS . "forum/locale/" . LOCALESET . "forum.php"; } else { include INFUSIONS . "forum/locale/English/forum.php"; } require_once THEMES . "templates/header.php"; require_once INCLUDES . "infusions_include.php"; require_once INFUSIONS . "forum/classes/Viewthread.php"; require_once INFUSIONS . "forum/classes/Functions.php"; require_once INFUSIONS . "forum/classes/Moderator.php"; require_once INFUSIONS . "forum/forum_include.php"; // Load Template include INFUSIONS . "forum/templates/forum_main.php"; include INFUSIONS . "forum/templates/forum_thread.php"; include INFUSIONS . "forum/templates/forum_input.php"; $forum_settings = get_settings('forum'); $thread = new PHPFusion\Forums\Viewthread(); if (isset($_GET['action'])) { switch ($_GET['action']) { case 'editpoll': $thread->render_poll_form(true); break; case 'deletepoll': $thread->delete_poll(); break; case 'newpoll': $thread->render_poll_form(); break; case 'edit': $thread->render_edit_form(); break; case 'reply':