<?php
//µ¼º½
$topdaohangarray = $applicationarray["topdaohangarray"];
$arrays = $applicationarray["daohangarray"];
$typearrays = $applicationarray["daohangtplist"];

if(is_array($topdaohangarray) && Count($topdaohangarray)>0){
	for($i=0;$i<Count($topdaohangarray);$i++){
		if($topdaohangarray[$i][2]!=""){
			$url = $topdaohangarray[$i][2];
		}else{
				$url = getsearchurl($topdaohangarray[$i][3],$topdaohangarray[$i][1],$topdaohangarray[$i]["isshop"]);
		}
		$topdaohangarray[$i]["url"]=$url;
	}
}

if(is_array($arrays) && Count($arrays)>0){
	$nowdaohang = -1;
	for($i=0;$i<Count($arrays);$i++){
		if($arrays[$i][2]!=""){
			$url = $arrays[$i][2];
		
		}else{
			$url = getsearchurl($arrays[$i][3],$arrays[$i][1],$arrays[$i]["isshop"]);
			
			
			if($q==$arrays[$i][3] && $catid == $arrays[$i][1]){
				$nowdaohang = $i;
			}
		}
		$arrays[$i]["url"]=$url;
	}
}

if(is_array($typearrays) && Count($typearrays)>0){
	for($i=0;$i<Count($typearrays);$i++){
		if($typearrays[$i][2]!=""){
			$url = $typearrays[$i][2];
		}else{
				$url = getsearchurl($typearrays[$i][3],$typearrays[$i][1],$typearrays[$i]["isshop"]);
		}
		$typearrays[$i]["url"]=$url;
	}
}
$arraykeywords = application("daohangkeyword",ROOT."keyworddate.php");
//¼ÆËãËæ»ú¹Ø¼ü´Ê



foreach($arraykeywords as $k=>$v){
	
	if(!empty($v["rnd"]) && $v["rnd"]>0){
		
		$arraykw = explode(",",$v["keyword"]);
		
		
		$arraykwnew = array_rand($arraykw,$v["rnd"]);
		
		$kw = "";
		for($i = 0; $i<$v["rnd"];$i++){
			$kw.=$arraykw[$arraykwnew[$i]].",";
		}
		
		$arraykeywords[$k]["keyword"] = substr($kw,0,-1);
	}
}

?>