예제 #1
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;
 }