下面说一下如何操作缓存文件:
1、写入操作
$contents[]="你要写入的数据";
$cacheArray .= "\$contents=".arrayeval($contents).";\n";
writetocache('it618_contents', $cacheArray);
2、读取操作
include_once DISCUZ_ROOT.'./data/sysdata/cache_it618_contents'.php';
$strall=$contents[0];
3、根据缓存时间判断操作
$cache_file = DISCUZ_ROOT.'./data/sysdata/cache_it618_contents.php';
if(($_G['timestamp'] - @filemtime($cache_file)) > $it618['cachetime']*60) {
//你可以写缓存文件了
}else{
//你可以从缓存文件里读了
}