<?



function google_map_data($rows=5){

	global $page,$city_id,$fid,$Fid_db,$db,$_pre,$totalNum;

	if($page<1){

		$page=1;

	}

	$min = ($page-1)*$rows;

	$SQL=" city_id='$city_id' ";

	if($fid){

		$fid_array = array($fid);

		foreach($Fid_db[$fid] AS $key=>$value){

			$fid_array[] = $key;

		}

		$SQL.=" AND A.fid IN (".implode(',',$fid_array).") ";

	}

	$query = $db->query("SELECT SQL_CALC_FOUND_ROWS A.* FROM {$_pre}content A WHERE $SQL ORDER BY A.list DESC LIMIT $min,$rows");

	$RS=$db->get_one("SELECT FOUND_ROWS()");

	$totalNum=$RS['FOUND_ROWS()'];

	while($rs = $db->fetch_array($query)){

		$ts = $db->get_one("SELECT * FROM {$_pre}content_$rs[mid] WHERE id='$rs[id]'");

		if($ts){

			$rs+=$ts;

		}

		$listdb[]=$rs;

	}

	return $listdb;

}






?>