<?php

//表单绝对URL地址
function go_link($method,$id){
	global $Project;
	global $Modules;
	
	//return readpath(uripath().$Modules["go"]["http"])."?action=".$method."&id=".$id;	
	return VI_HOST."module/go/content/?id=".$id;	
	
}

//生成关键字缓存
function parseCache($mysql,$appid){
	global $Project;
	global $Modules;
	
    $sql="SELECT id,category,name,link FROM ".VI_DBMODPRE."go where category <>'' and link<>'' order BY id desc";
	
	$result=mysql_query($sql,$mysql);
	
	$cache ='<?php'.chr(13);
	$cache.='/*'.date("Y-m-t H:i:s").'*/'.chr(13);
	$cache.='$VICACHE["mod.go"]=array('.chr(13);
	
	while($row=mysql_fetch_assoc($result)){
	
		$cache.=' "'.$row["name"].'" =>'.var_export($row, TRUE).',';
	
	}
	
	$cache.=");".chr(13).chr(13);
	$cache.="?>";	
		
	//写入缓存
	create_file(VI_ROOT."/".$Project["cache"]."/".$appid."/table.go.php",$cache);
}

?>