$Answer) { if ($Answer == '') { continue; } $Answers[$i + 1] = $Answer; $Votes[$i + 1] = 0; } if (count($Answers) < 2) { error('You cannot create a poll with only one answer.'); } elseif (count($Answers) > 25) { error('You cannot create a poll with greater than 25 answers.'); } } $forum = new \Gazelle\Forum($ForumID); $threadId = $forum->addThread($LoggedUser['ID'], $Title, $Body); if ($needPoll) { $forum->addPoll($threadId, $Question, $Answers); $Cache->cache_value("polls_$threadId", [$Question, $Answers, $Votes, null, 0], 0); if ($ForumID == STAFF_FORUM) { send_irc('PRIVMSG '.MOD_CHAN.' :!mod Poll created by '.$LoggedUser['Username'].": \"$Question\" ".site_url()."forums.php?action=viewthread&threadid=$threadId"); } } if (isset($_POST['subscribe'])) { $subscription = new \Gazelle\Manager\Subscription($LoggedUser['ID']); $subscription->subscribe($threadId); } header("Location: forums.php?action=viewthread&threadid=$threadId");