function thread_new_find_cache()
{
    global $conf;
    $threadlist = cache_get('thread_new_list');
    if ($threadlist === NULL) {
        $threadlist = thread_new_find();
        cache_set('thread_new_list', $threadlist);
    } else {
        foreach ($threadlist as &$thread) {
            thread_format_last_date($thread);
        }
    }
    return $threadlist;
}
Ejemplo n.º 2
0
function thread_new_find_cache()
{
    global $conf, $time;
    $threadlist = cache_get('thread_new_list');
    if ($threadlist === NULL) {
        $threadlist = thread_new_find();
        cache_set('thread_new_list', $threadlist);
    } else {
        foreach ($threadlist as &$thread) {
            thread_format_last_date($thread);
        }
        // 重新格式化时间
        foreach ($threadlist as &$thread) {
            $time - $thread['last_date'] < 86400 and thread_format_last_date($thread);
        }
    }
    return $threadlist;
}
function thread_lastpid_find_cache()
{
    global $conf;
    static $cache = FALSE;
    if ($cache !== FALSE) {
        return $cache;
    }
    $threadlist = cache_get('thread_lastpid_list');
    if ($threadlist === NULL) {
        $threadlist = thread_lastpid_find();
        cache_set('thread_lastpid_list', $threadlist);
    } else {
        foreach ($threadlist as &$thread) {
            thread_format_last_date($thread);
        }
    }
    $cache = $threadlist;
    return $threadlist;
}