function checkFlood() { if (TINYIB_DELAY > 0) { $lastpost = lastPostByIP(); if ($lastpost) { if (time() - $lastpost['timestamp'] < TINYIB_DELAY) { fancyDie("Please wait a moment before posting again. You will be able to make another post in " . (TINYIB_DELAY - (time() - $lastpost['timestamp'])) . " " . plural("second", TINYIB_DELAY - (time() - $lastpost['timestamp'])) . "."); } } } }
$reason = $ban['reason'] == '' ? '' : '<br>The reason provided was: ' . $ban['reason']; fancyDie('Sorry, it appears that you have been banned from posting on this image board. ' . $expire . $reason); } else { clearExpiredBans(); } } $parent = "0"; if (isset($_POST["parent"])) { if ($_POST["parent"] != "0") { if (!threadExistsByID($_POST['parent'])) { fancyDie("Invalid parent thread ID supplied, unable to create post."); } $parent = $_POST["parent"]; } } $lastpost = lastPostByIP(); if ($lastpost) { if (time() - $lastpost['timestamp'] < 30) { fancyDie("Please wait a moment before posting again. You will be able to make another post in " . (30 - (time() - $lastpost['timestamp'])) . " seconds."); } } if (strlen($_POST["message"]) > 8000) { fancyDie("Please shorten your message, or post it in multiple parts. Your message is " . strlen($_POST["message"]) . " characters long, and the maximum allowed is 8000."); } $post = newPost(); $post['parent'] = $parent; $post['ip'] = $_SERVER['REMOTE_ADDR']; $nt = nameAndTripcode($_POST["name"]); $post['name'] = $nt[0]; $post['tripcode'] = $nt[1]; $post['name'] = cleanString(substr($post['name'], 0, 75));