$query = $db->query("SELECT data FROM {$tablepre}caches WHERE cachename in(".implodeids($cachenames).")");
while($data = $db->fetch_array($query)) {
$cachedata .= $data['data'];
}
writetocache($script, $cachenames, $cachedata);
}
}
//假如参数为空,或者参数为styles 就处理模板风格等缓存
if(!$cachename || $cachename == 'styles') {
$stylevars = $styledata = $styleicons = array();
$defaultstyleid = $db->result_first("SELECT value FROM {$tablepre}settings WHERE variable = 'styleid'");
list(, $imagemaxwidth) = explode("\t", $db->result_first("SELECT value FROM {$tablepre}settings WHERE variable = 'zoomstatus'"));
$query = $db->query("SELECT sv.* FROM {$tablepre}stylevars sv LEFT JOIN {$tablepre}styles s ON s.styleid = sv.styleid AND (s.available=1 OR s.styleid='$defaultstyleid')");
$query = $db->query("SELECT s.*, t.directory AS tpldir FROM {$tablepre}styles s LEFT JOIN {$tablepre}templates t ON s.templateid=t.templateid WHERE s.available=1 OR s.styleid='$defaultstyleid'");
$allowthreadplugin = $threadplugins ? unserialize($db->result_first("SELECT value FROM {$tablepre}settings WHERE variable='allowthreadplugin'")) : array();
$query = $db->query("SELECT * FROM {$tablepre}usergroups u
LEFT JOIN {$tablepre}admingroups a ON u.groupid=a.admingid");
while($data = $db->fetch_array($query)) {
$ratearray = array();
if($data['raterange']) {
foreach(explode("\n", $data['raterange']) as $rating) {
$query = $db->query("SELECT * FROM {$tablepre}advertisements WHERE available>'0' AND starttime<='$timestamp' ORDER BY displayorder");