<?php
/**
* ¹«¸æ²å¼þº¯Êý¿â
* @author moufer<moufer@163.com>
* @package modoer_plugin
* @copyright phpdp.com
* @version $Id function.inc.php 1 2008-5-10 19:27 $
*/
!defined('IN_MUDDER') && exit('Access Denied');

function Announcement_Cache($refurbish = false) {
    global $timestamp, $db, $dbpre;

    $cachefile = MUDDER_CACHEDIR.'cache_plugins_announcement.php';
    if(!$refurbish && file_exists($cachefile) && check_cache($cachefile, $cachetime)) {
        return read_cache($cachefile);
    }
    $query = $db->query("SELECT id,title,author,dateline FROM {$dbpre}announcements WHERE available=1 ORDER BY orders,dateline desc LIMIT 10");
    $result = array();
    while($row = $db->fetch_array($query)) {
        $result[$row['id']] = $row;
    }
    write_cache('plugins_announcement', arrayeval($result), '', 'return');
    return $result;
}


?>
