<?
// please give feedbacks to bomool.net
include_once("./_common.php");

$url = "http://" . $_SERVER["HTTP_HOST"] ;//::::::::::::::: write your root path

header("Content-type: text/xml;charset=\"UTF-8\"");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
	<loc><?=$url?></loc>
</url>
<url>
	<loc><?=$url?>/contact.php</loc>
</url>
<url>
	<loc><?=$url?>/introduce.php</loc>
</url>
<?
$mb_id = get_subdomain_mb_id();
$sql = "select * from $ns[menu_table] where mb_id = '$mb_id' order by cpd_rank asc ";
$result = sql_query( $sql );


while($row = sql_fetch_array( $result )){

	echo "<url>\n";
	echo "<loc>$url/list.php?c=$row[cpd_code]</loc>\n";
	echo "<priority>0.9</priority>\n";
	echo "</url>\n";
	
	$search_all = " and ld_manager = '$mb_id'  and ld_category = '$row[cpd_code]'and ld_ad_type != '' and ld_lock = 'N' ";
	$all_sql = "select * from $ns[land_table] where (1) $search_all order by ld_date desc";
	$all_result = sql_query($all_sql);
	
	while($allrow = sql_fetch_array($all_result)){
		echo "<url>\n";
		echo "<loc>$url/view.php?no =$allrow[ld_id]</loc>\n";
		echo "<changefreq>weekly</changefreq>";
		echo "<priority>0.5</priority>\n";
		echo "</url>\n";
	}
	
	
}// end for i

$thm_sql = "select * from $ns[thema_table] where (1) and mb_id = '$mb_id' order by thm_rank asc, thm_id asc ";
$thm_result = sql_query($thm_sql);
while( $row = sql_fetch_array($thm_result)) {
	echo "<url>\n";
	echo "<loc>$url/thema.php?thema=$row[thm_id]</loc>\n";
	echo "<changefreq>weekly</changefreq>";
	echo "<priority>0.3</priority>\n";
	echo "</url>\n";
	
}// end for i

?>
</urlset>
