<?php
	include( "connect.php" );
	$pages = mysql_query( "select id,title,0 as type from content where rid=0 or rid=2 order by rid, n" );
	while ( $page = mysql_fetch_array( $pages ) ) {
		$pages_print .= "<url>
<loc>http://www.scforensicpsychiatry.com/" . (($page[id]!=1)?( htmlentities( preg_replace( "/-+/", "-",  str_replace( " ", "-", preg_replace( "/[^a-zA-Z0-9 ]/", "", $page["title"] ) ) ) ) . "_" . $page["id"] . ".html" ):("")) . "</loc>
<priority>" . (($page["id"]==1)?("1.0"):("0.8")) . "</priority>
<changefreq>monthly</changefreq>
</url>\n";
	}
	print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>

<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">

<?
	print $pages_print;
?>
</urlset>