Exemple #1
0
function deleteCommentNotifiedInOwner($blogid, $id)
{
    global $database;
    if (!is_numeric($id)) {
        return false;
    }
    fireEvent('DeleteCommentNotified', $id);
    $entryId = POD::queryCell("SELECT entry FROM {$database['prefix']}CommentsNotified WHERE blogid = {$blogid} AND id = {$id}");
    if (POD::queryCount("DELETE FROM {$database['prefix']}CommentsNotified WHERE blogid = {$blogid} AND id = {$id}") == 1) {
        if (POD::query("DELETE FROM {$database['prefix']}CommentsNotified WHERE blogid = {$blogid} AND parent = {$id}")) {
            updateCommentsOfEntry($blogid, $entryId);
            CacheControl::flushCommentNotifyRSS();
            return true;
        }
    }
    return false;
}
Exemple #2
0
function deleteCommentNotifiedInOwner($blogid, $id)
{
    if (!is_numeric($id)) {
        return false;
    }
    fireEvent('DeleteCommentNotified', $id);
    $pool = DBModel::getInstance();
    $pool->reset('CommentsNotified');
    $pool->setQualifier('blogid', 'eq', $blogid);
    $pool->setQualifier('id', 'eq', $id);
    $entryId = $pool->getCell('entry');
    if ($pool->delete()) {
        $pool->unsetQualifier('id');
        $pool->setQualifier('parent', 'eq', $id);
        if ($pool->delete()) {
            updateCommentsOfEntry($blogid, $entryId);
            CacheControl::flushCommentNotifyRSS();
            return true;
        }
    }
    return false;
}