$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, $Votes); if ($ForumID == STAFF_FORUM_ID) { send_irc('PRIVMSG '.MOD_CHAN.' :Poll created by '.$LoggedUser['Username'].": \"$Question\" ".SITE_URL."/forums.php?action=viewthread&threadid=$threadId"); } } if (isset($_POST['subscribe'])) { (new Gazelle\Manager\Subscription($LoggedUser['ID']))->subscribe($threadId); } header("Location: forums.php?action=viewthread&threadid=$threadId");