$_GET['forum_id'], 'thread_id' => $_GET['thread_id'], 'post_id' => $_GET['post_id'], 'vote_points' => $points, 'vote_user' => $userdata['user_id'], 'vote_datestamp' => time(), ]; $hasVoted = dbcount("('vote_user')", DB_FORUM_VOTES, "vote_user='".intval($userdata['user_id'])."' AND thread_id='".intval($_GET['thread_id'])."'"); if (!$hasVoted) { $isSelfPost = dbcount("('post_id')", DB_FORUM_POSTS, "post_id='".intval($_GET['post_id'])."' AND post_user='".intval($userdata['user_id']).""); if (!$isSelfPost) { $result = dbquery_insert(DB_FORUM_VOTES, $data, 'save', ['noredirect' => 1, 'no_unique' => 1]); if ($result && $info['forum_answer_threshold'] > 0) { $vote_result = dbquery("SELECT SUM('vote_points'), thread_id FROM ".DB_FORUM_VOTES." WHERE post_id='".$data['post_id']."'"); $v_data = dbarray($vote_result); if ($info['forum_answer_threshold'] != 0 && $v_data['vote_points'] >= $info['forum_answer_threshold']) { dbquery("UPDATE ".DB_FORUM_THREADS." SET 'thread_locked'='1' WHERE thread_id='".$v_data['thread_id']."'"); } } redirect(FORUM."viewthread.php?thread_id=".$_GET['thread_id']."&post_id=".$_GET['post_id']); } else { redirect(FORUM."viewthread.php?thread_id=".$_GET['thread_id']."&post_id=".$_GET['post_id'].'&error=vote_self'); } } else { redirect(FORUM."viewthread.php?thread_id=".$_GET['thread_id']."&post_id=".$_GET['post_id'].'&error=vote'); } } } function parse_forumMods($forum_mods) { return PHPFusion\Forums\Moderator::parse_forum_mods($forum_mods); } function get_recentTopics($forum_id = 0) { return PHPFusion\Forums\ForumServer::get_recentTopics($forum_id); } function set_forumIcons(array $icons = []) { PHPFusion\Forums\ForumServer::set_forumIcons($icons); } function get_forum($forum_id = 0, $forum_branch = 0) { return PHPFusion\Forums\Forum::get_forum($forum_id, $forum_branch); } function get_forumIcons($type = '') { return \PHPFusion\Forums\ForumServer::get_ForumIcons($type); }