Example #1
0
         rebuildIndexes();
         if ($post['parent'] != TINYIB_NEWTHREAD) {
             rebuildThread($post['parent']);
         }
         $text .= manageInfo('Post No.' . $post['id'] . ' deleted.');
     } else {
         fancyDie("Sorry, there doesn't appear to be a post with that ID.");
     }
 } elseif (isset($_GET['approve'])) {
     if ($_GET['approve'] > 0) {
         $post = postByID($_GET['approve']);
         if ($post) {
             approvePostByID($post['id']);
             $thread_id = $post['parent'] == TINYIB_NEWTHREAD ? $post['id'] : $post['parent'];
             if (strtolower($post['email']) != 'sage' && (TINYIB_MAXREPLIES == 0 || numRepliesToThreadByID($thread_id) <= TINYIB_MAXREPLIES)) {
                 bumpThreadByID($thread_id);
             }
             threadUpdated($thread_id);
             $text .= manageInfo('Post No.' . $post['id'] . ' approved.');
         } else {
             fancyDie("Sorry, there doesn't appear to be a post with that ID.");
         }
     }
 } elseif (isset($_GET['moderate'])) {
     if ($_GET['moderate'] > 0) {
         $post = postByID($_GET['moderate']);
         if ($post) {
             $text .= manageModeratePost($post);
         } else {
             fancyDie("Sorry, there doesn't appear to be a post with that ID.");
         }
Example #2
0
    if ($post['file'] == '') {
        // No file uploaded
        if ($post['parent'] == '0') {
            fancyDie("An image is required to start a thread.");
        }
        if (str_replace('<br>', '', $post['message']) == "") {
            fancyDie("Please enter a message and/or upload an image to make a reply.");
        }
    }
    $post['id'] = insertPost($post);
    trimThreads();
    echo 'Updating thread page...<br>';
    if ($post['parent'] != '0') {
        rebuildThread($post['parent']);
        if (strtolower($post['email']) != "sage") {
            bumpThreadByID($post['parent']);
        }
    } else {
        rebuildThread($post['id']);
    }
    echo 'Updating thread index...<br>';
    rebuildIndexes();
    // Check if the request is to delete a post and/or its associated image
} elseif (isset($_GET['delete']) && !isset($_GET['manage'])) {
    if (isset($_POST['delete'])) {
        $post = postByID($_POST['delete']);
        if ($post) {
            if ($post['password'] != '' && md5(md5($_POST['password'])) == $post['password']) {
                deletePostByID($post['id']);
                if ($post['parent'] == 0) {
                    threadUpdated($post['id']);