<?
# EXCLUDE FILES
# HOW TO USE
# "filename" separated by comma
$Exclude_Files = ARRAY("/content.html", "/z-gallery.html","/mail_script.php", "/sitemap.html", "/sitemap.xml", "/floor_plan_list.html", "/staff-contact.html", "/gallery_print.html", "/staff-view.html", "/gallery_view.html", "/customer_tesimonials.html", "/floor_plan_view.html", "/maufacturers.html");

#############################################################
# DO NOT EDIT BELOW

INCLUDE_ONCE ($_SERVER["DOCUMENT_ROOT"] . "/admin/config/_inc-config.inc");
MYSQL_CONNECT ($DB_HOST, $DB_USER, $DB_PASS) or die ("ERROR");
MYSQL_SELECT_DB ($DB);
INCLUDE_ONCE ($_SERVER["DOCUMENT_ROOT"] . "/admin/_load-config.inc");
INCLUDE_ONCE ($_SERVER["DOCUMENT_ROOT"] . "/admin/_inc-functions.inc");
UNSET($Domain);

$Domain = $_SERVER["SERVER_NAME"];
$Domain = "http://www." . EREGI_REPLACE("www.","",$Domain);

PRINT '<?xml version="1.0" encoding="UTF-8"?>';
?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
<url><loc><?=$Domain?>/</loc><lastmod><?=DATE("Y-m-d")?></lastmod><priority>1</priority><changefreq>weekly</changefreq></url>

<?
$Domain = $_SERVER["SERVER_NAME"];
$Domain = "http://www." . EREGI_REPLACE("www.","",$Domain);
$Date = DATE("Y-m-d\TH:i:s\+00:00");

$ContentQ = MQ("SELECT * FROM Content ORDER BY Sort, Link_Name");
WHILE ($ContentR = MF($ContentQ)) {
	IF (!IN_ARRAY($ContentR["Page_URL"], $Exclude_Files)) {
		if (!$ContentR["Page_URL"]) {
			$ContentR["Page_URL"] = "/content.html?ID=".$ContentR["ID"];
		} ELSE {
			$Exclude_Files[] = SUBSTR($ContentR["Page_URL"], 1, STRLEN($ContentR["Page_URL"])-1);
		}
		?>
	<url>
		<loc><?=$Domain?><?=$ContentR["Page_URL"]?></loc>
		<lastmod><?=DATE("Y-m-d")?></lastmod>
		<priority>0.5</priority>
		<changefreq>weekly</changefreq>
	</url>
<?
	}
}
?>
</urlset>

