Пример #1
0
function restoreTrackbackTrash($blogid, $id)
{
    global $database;
    $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;
    }
    if (updateTrackbacksOfEntry($blogid, $entry)) {
        return $entry;
    }
    return false;
}
Пример #2
0
function restoreTrackbackTrash($blogid, $id)
{
    $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;
    }
    if (updateTrackbacksOfEntry($blogid, $entry)) {
        return $entry;
    }
    return false;
}