function flushEntry($entryId = null)
 {
     global $database;
     if (empty($entryId)) {
         $entryId = '';
     } else {
         $entryId = $entryId . '\\_';
     }
     $cache = pageCache::getInstance();
     $Entries = POD::queryColumn("SELECT name\n\t\t\tFROM {$database['prefix']}PageCacheLog\n\t\t\tWHERE blogid = " . getBlogId() . "\n\t\t\tAND (name like 'entry\\_" . $entryId . "%' OR name = 'commentRSS_" . $entryId . "')");
     CacheControl::purgeItems($Entries);
     if (!empty($entryId)) {
         $entry = POD::queryCell("SELECT userid, category FROM {$database['prefix']}Entries\n\t\t\t\tWHERE blogid = " . getBlogId() . " AND id = {$entryId}");
         if (!empty($entry)) {
             CacheControl::flushAuthor($entry['userid']);
             CacheControl::flushCategory($entry['category']);
             CacheControl::flushDBCache();
         }
     } else {
         CacheControl::flushAuthor();
         CacheControl::flushCategory();
         CacheControl::flushDBCache();
     }
     unset($cache);
     return true;
 }
예제 #2
0
function changeAuthorOfEntries($blogid, $entries, $userid)
{
    global $database;
    requireModel("blog.feed");
    $targets = array_unique(preg_split('/,/', $entries, -1, PREG_SPLIT_NO_EMPTY));
    foreach ($targets as $entryId) {
        POD::execute("UPDATE {$database['prefix']}Entries SET userid = {$userid} WHERE blogid = {$blogid} AND id = {$entryId}");
    }
    clearFeed();
    CacheControl::flushAuthor();
    return true;
}
예제 #3
0
파일: entry.php 프로젝트: ni5am/Textcube
function changeAuthorOfEntries($blogid, $entries, $userid)
{
    importlib("model.blog.feed");
    $pool = DBModel::getInstance();
    $targets = array_unique(preg_split('/,/', $entries, -1, PREG_SPLIT_NO_EMPTY));
    foreach ($targets as $entryId) {
        $pool->init("Entries");
        $pool->setQualifier("blogid", "eq", $blogid);
        $pool->setQualifier("id", "eq", $entryId);
        $pool->setAttribute("userid", $userid);
        $pool->update();
    }
    clearFeed();
    CacheControl::flushAuthor();
    return true;
}
예제 #4
0
 function flushEntry($entryId = null)
 {
     global $database;
     if (empty($entryId)) {
         $entryId = '';
     } else {
         $entryId = intval($entryId);
     }
     $Entries = POD::queryColumn("SELECT name\n\t\t\tFROM {$database['prefix']}PageCacheLog\n\t\t\tWHERE blogid = " . getBlogId() . "\n\t\t\tAND (name like 'entry-" . $entryId . "-%' OR name like '%RSS-" . $entryId . "' OR name like '%ATOM-" . $entryId . "')");
     if (!empty($Entries)) {
         CacheControl::purgeItems($Entries);
     }
     if (!empty($entryId)) {
         $entry = POD::queryRow("SELECT userid, category, published FROM {$database['prefix']}Entries\n\t\t\t\tWHERE blogid = " . getBlogId() . " AND id = {$entryId}");
         if (!empty($entry)) {
             $entry['period'] = Timestamp::getYearMonth($entry['published']);
             CacheControl::flushAuthor($entry['userid']);
             CacheControl::flushCategory($entry['category']);
             CacheControl::flushArchive($entry['period']);
             CacheControl::flushDBCache('entry');
         }
     } else {
         CacheControl::flushAuthor();
         CacheControl::flushCategory();
         CacheControl::flushDBCache('entry');
     }
     return true;
 }
예제 #5
0
function changeAuthorOfEntries($blogid, $entries, $userid)
{
    $ctx = Model_Context::getInstance();
    requireModel("blog.feed");
    $targets = array_unique(preg_split('/,/', $entries, -1, PREG_SPLIT_NO_EMPTY));
    foreach ($targets as $entryId) {
        POD::execute("UPDATE " . $ctx->getProperty('database.prefix') . "Entries SET userid = {$userid} WHERE blogid = {$blogid} AND id = {$entryId}");
    }
    clearFeed();
    CacheControl::flushAuthor();
    return true;
}