Exemplo n.º 1
0
function revertRemoteResponse($blogid, $id)
{
    global $database;
    requireModel('blog.entry');
    if (!is_numeric($id)) {
        return null;
    }
    $entry = POD::queryCell("SELECT entry FROM {$database['prefix']}RemoteResponses WHERE blogid = {$blogid} AND id = {$id}");
    if ($entry === null) {
        return false;
    }
    if (!POD::execute("UPDATE {$database['prefix']}RemoteResponses SET isfiltered = 0 WHERE blogid = {$blogid} AND id = {$id}")) {
        return false;
    }
    CacheControl::flushDBCache('trackback');
    CacheControl::flushDBCache('remoteResponse');
    if (updateRemoteResponsesOfEntry($blogid, $entry)) {
        return $entry;
    }
    return false;
}
Exemplo n.º 2
0
function revertRemoteResponse($blogid, $id)
{
    if (!is_numeric($id)) {
        return null;
    }
    $pool = DBModel::getInstance();
    $pool->reset("RemoteResponses");
    $pool->setQualifier("blogid", "eq", $blogid);
    $pool->setQualifier("id", "eq", $id);
    $entry = $pool->getCell("entry");
    if ($entry === null) {
        return false;
    }
    $pool->setAttribute("isfiltered", 0);
    if (!$pool->update()) {
        return false;
    }
    CacheControl::flushDBCache('trackback');
    CacheControl::flushDBCache('remoteResponse');
    importlib('model.blog.entry');
    if (updateRemoteResponsesOfEntry($blogid, $entry)) {
        return $entry;
    }
    return false;
}