<?php

$basePath=realpath('../../');
/**************************************************************************************
Setting
**************************************************************************************/
include_once($basePath."/library/noias.php");
include_once($basePath."/library/info.php");

$info=new info($basePath);


/**************************************************************************************
Execution
**************************************************************************************/

$url=$info->xGetInfo("site","url");
$changefreq_array=array("always","hourly","daily","weekly","monthly","yearly","never");

header("Content-Type: text/xml; charset=utf-8");
print "<?xml version='1.0' encoding='UTF-8'?>\n";
print "<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>\n";

foreach($info->pageinfo_obj as $key=>$value){
	if($value['crawl']){
		print "\t<url>\n";
		print "\t\t<loc>{$url}{$value['url']}</loc>\n";
		print "\t\t<changefreq>{$changefreq_array[$value['changefreq']]}</changefreq>\n";
		print "\t\t<priority>{$value['priority']}</priority>\n";
		print "\t</url>\n";
	}
}

print "</urlset>";
?>

