📄 cache.php
字号:
<?php
XYDW == OK or exit('Forbidden');
function cache_root($root=''){
global $db;
if($root==''){
$root = $db->getone("SELECT * FROM xydw_root");
$root = str_replace("\"","\\\"",$root);
}
$root['uplast'] = ltrim($root['uplast']);
foreach($root as $rootkey => $rootdb){
$roots .= "\$".$rootkey." = \"$rootdb\";\n";
}
$roots = str_replace("\$email","\$siteemail",$roots);
$roots = "<?php\n".$roots."?>";
writeover(R_P."data/cache/root.php",$roots);
}
function cache_lanmu(){
global $db;
$query = $db->query("SELECT lid,name,lup,kind,type FROM xydw_lanmu ORDER BY 'lup' ASC");
while($lanmu = $db->fetch_array($query)){
if($lanmu[type] == '1'){
$bigls[$lanmu[lid]] = $lanmu['name'];
$bigl .= " '$lanmu[lid]' => '$lanmu[name]',\n";
}
if($lanmu[type] == '2'){
$smals[$lanmu[kind]] .= " '$lanmu[lid]' => '$lanmu[name]',\n";
$smalb .= " '$lanmu[lid]' => '$lanmu[name]',\n";
$opt .= "<option value={$lanmu[lid]}>{$lanmu[name]}</option>\n";
$smalab .= " '$lanmu[lid]' => '$lanmu[kind]',\n";
}
}
foreach($bigls as $bigkey => $bigdb){
$cache .= "\$smal[$bigkey] = array(".$smals[$bigkey].");\n";
}
$smalb = "array(".substr($smalb,0,-2).")";
$smalab = "array(".substr($smalab,0,-2).")";
$bigl = "array(".substr($bigl,0,-2).")";
$cache = "<?php\n\$bigl = {$bigl};\n\$smalb = {$smalb};\n\$smalab = {$smalab};\n\$opt = \"{$opt}\";\n{$cache}\n?>";
writeover(R_P."data/cache/lanmu.php",$cache);
}
function cache_link(){
global $db;
$query = $db->query("SELECT * FROM xydw_link");
while($link = $db->fetch_array($query)){
if($link[logo]){
$ilink .= "<a href='$link[url]' target=_blank><img src='$link[logo]' title='$link[js]' border=0></a> ";
} else {
$tlink .= "<a href='$link[url]' target=_blank title='$link[js]'>$link[name]</a> ";
}
}
$cache = "<?php\n \$ilink=\"$ilink\";\n \$tlink=\"$tlink\";\n?>";
writeover(R_P."data/cache/link.php",$cache);
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -