Example #1
0
 function delete($itemid)
 {
     $this->db->query("DELETE FROM {$this->table} WHERE itemid={$itemid} AND item='{$this->item}'");
     cache_keylink($this->item);
 }
Example #2
0
                             cache_clear('fields');
                             cache_fields();
                             cache_clear('option');
                             msg('自定义字段更新成功', '?action=' . $action . '&step=' . ($step + 1));
                         } else {
                             if ($step == 7) {
                                 cache_clear_ad();
                                 tohtml('index');
                                 msg('全部缓存更新成功');
                             } else {
                                 cache_clear('group');
                                 cache_group();
                                 cache_clear('type');
                                 cache_type();
                                 cache_clear('keylink');
                                 cache_keylink();
                                 cache_pay();
                                 cache_banip();
                                 cache_banword();
                                 cache_bancomment();
                                 msg('正在开始更新缓存', '?action=' . $action . '&step=' . ($step + 1));
                             }
                         }
                     }
                 }
             }
         }
     }
     break;
 case 'cacheclear':
     if ($CFG['cache'] == 'file') {
Example #3
0
function cache_keylink($item = '')
{
    global $db;
    if ($item) {
        $keylinks = array();
        $result = $db->query("SELECT title,url FROM {$db->pre}keylink WHERE item='{$item}' ORDER BY listorder DESC,itemid DESC");
        while ($r = $db->fetch_array($result)) {
            $keylinks[] = $r;
        }
        cache_write('keylink-' . $item . '.php', $keylinks);
        return $keylinks;
    } else {
        $arr = array();
        $result = $db->query("SELECT item FROM {$db->pre}keylink");
        while ($r = $db->fetch_array($result)) {
            if (!in_array($r['item'], $arr)) {
                $arr[] = $r['item'];
                cache_keylink($r['item']);
            }
        }
    }
}