function module_fid_cache() { global $db, $_pre, $webdb; $query = $db->query("SELECT * FROM {$_pre}sort ORDER BY list DESC LIMIT 800"); while ($rs = $db->fetch_array($query)) { if ($rs[index_show]) { $Fid_db[index_show][$rs[fid]] = $rs[name]; } if ($rs[tableid]) { $Fid_db[tableid][$rs[fid]] = $rs[tableid]; } if ($rs[dir_name]) { $Fid_db[dir_name][$rs[fid]] = $rs[dir_name]; } if ($rs[ifcolor]) { $Fid_db[ifcolor][$rs[fid]] = $rs[ifcolor]; } $Fid_db[$rs[fup]][$rs[fid]] = $rs[name]; $Fid_db[name][$rs[fid]] = $rs[name]; $GuideFid[$rs[fid]] = module_get_guide($rs[fid]); } write_file(Mpath . "data/all_fid.php", "<?php\r\n\$Fid_db=" . var_export($Fid_db, true) . ';?>'); }
function module_get_guide($fid, $url = 'list.php?') { global $db, $_pre; $query = $db->query("SELECT * FROM {$_pre}sort WHERE fid='{$fid}' "); while ($rs = $db->fetch_array($query)) { $show = " -> <A href='{$url}fid={$rs['fid']}'>{$rs['name']}</A>" . $show; if ($rs[fup]) { $show = module_get_guide($rs[fup], $url) . $show; } } return $show; }