Ejemplo n.º 1
0
function blog_delete_article($id)
{
    global $blog;
    $article = blog_load_article($id, true);
    $blog['pdo']->beginTransaction();
    $stmt = $blog['pdo']->prepare("DELETE FROM {$blog['tablePrefix']}Articles WHERE ID=:idArticle");
    $stmt->bindValue(":idArticle", $id);
    $stmt->execute();
    $stmt = $blog['pdo']->prepare("DELETE FROM {$blog['tablePrefix']}Comments WHERE IDArticle=:idArticle");
    $stmt->bindValue(":idArticle", $id);
    $stmt->execute();
    $blog['pdo']->commit();
}
Ejemplo n.º 2
0
function delete_comment($articleid, $commentid)
{
    jabCanUser("author", true);
    // Get the article
    $article = blog_load_article($articleid, true);
    if ($article == null) {
        return false;
    }
    // Accept the comment
    blog_delete_comment($commentid);
    // Redirect
    jabRedirect($article->FullUrl());
}