Exemplo n.º 1
0
function deletePostByID($id)
{
    $posts = postsInThreadByID($id);
    foreach ($posts as $post) {
        if ($post['id'] != $id) {
            deletePostImages($post);
            mysql_query("DELETE FROM `" . $GLOBALS['mysql_posts_table'] . "` WHERE `id` = " . $post['id'] . " LIMIT 1");
        } else {
            $thispost = $post;
        }
    }
    if (isset($thispost)) {
        deletePostImages($thispost);
        mysql_query("DELETE FROM `" . $GLOBALS['mysql_posts_table'] . "` WHERE `id` = " . $thispost['id'] . " LIMIT 1");
    }
}
Exemplo n.º 2
0
function deletePostByID($id)
{
    $posts = postsInThreadByID($id, false);
    foreach ($posts as $post) {
        if ($post['id'] != $id) {
            deletePostImages($post);
            $GLOBALS['db']->deleteWhere(POSTS_FILE, new SimpleWhereClause(POST_ID, '=', $post['id'], INTEGER_COMPARISON));
        } else {
            $thispost = $post;
        }
    }
    if (isset($thispost)) {
        if ($thispost['parent'] == 0) {
            @unlink('res/' . $thispost['id'] . '.html');
        }
        deletePostImages($thispost);
        $GLOBALS['db']->deleteWhere(POSTS_FILE, new SimpleWhereClause(POST_ID, '=', $thispost['id'], INTEGER_COMPARISON));
    }
}
Exemplo n.º 3
0
function deletePostByID($id)
{
    global $link;
    $posts = postsInThreadByID($id, false);
    foreach ($posts as $post) {
        if ($post['id'] != $id) {
            deletePostImages($post);
            mysqli_query($link, "DELETE FROM `" . TINYIB_DBPOSTS . "` WHERE `id` = " . $post['id'] . " LIMIT 1");
        } else {
            $thispost = $post;
        }
    }
    if (isset($thispost)) {
        if ($thispost['parent'] == TINYIB_NEWTHREAD) {
            @unlink('res/' . $thispost['id'] . '.html');
        }
        deletePostImages($thispost);
        mysqli_query($link, "DELETE FROM `" . TINYIB_DBPOSTS . "` WHERE `id` = " . $thispost['id'] . " LIMIT 1");
    }
}
Exemplo n.º 4
0
function deletePostByID($id)
{
    $posts = postsInThreadByID($id, false);
    foreach ($posts as $post) {
        if ($post['id'] != $id) {
            deletePostImages($post);
            pdoQuery("DELETE FROM " . TINYIB_DBPOSTS . " WHERE id = ?", array($id));
        } else {
            $thispost = $post;
        }
    }
    if (isset($thispost)) {
        if ($thispost['parent'] == TINYIB_NEWTHREAD) {
            @unlink('res/' . $thispost['id'] . '.html');
        }
        deletePostImages($thispost);
        pdoQuery("DELETE FROM " . TINYIB_DBPOSTS . " WHERE id = ?", array($thispost['id']));
    }
}