<? header('Content-type: text/xml'); ?>
<?= "<?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>http://www.<?=$_SERVER['SERVER_NAME']?>/</loc>
      <lastmod>2006-06-04</lastmod>
      <changefreq>daily</changefreq>
      <priority>0.6</priority>
    </url>
    <url>
      <loc>http://www.<?=$_SERVER['SERVER_NAME']?>/listings.php</loc>
      <lastmod>2006-08-17</lastmod>
      <changefreq>daily</changefreq>
      <priority>0.6</priority>
    </url>
    <url>
      <loc>http://www.<?=$_SERVER['SERVER_NAME']?>/page-about.htm</loc>
      <lastmod>2006-08-17</lastmod>
      <changefreq>daily</changefreq>
      <priority>0.6</priority>
    </url>
    <url>
      <loc>http://www.<?=$_SERVER['SERVER_NAME']?>/page-contact.htm</loc>
      <lastmod>2006-08-17</lastmod>
      <changefreq>daily</changefreq>
      <priority>0.6</priority>
        </url>
<?
  require_once('config/setup.php');
        require_once($rootfolder.'config/setlocale.php');
        require_once($rootfolder.'tools/widgets.php');
        $rootdir = '';
        $link = mysql_connect($dbserver, $dbuser, $dbpwd)
          or die ("Impossible de se connecter". mysql_error());
  mysql_select_db ($dbname,$link)
          or die ("Impossible d'accder  la base de donnes". mysql_error());
  $query="SELECT prop_id, date_created, date_modified FROM dr_properties AS prop WHERE prop.Display = 1 AND prop.user_id = 60 ORDER BY prop_id ASC";
  $doquery = mysql_query($query,$link);

  while($result = mysql_fetch_assoc($doquery)){
          if ($result['date_modified'] == '0000-00-00') {
            $lastmod = $result['date_created'];
                } else {
                  $lastmod = $result['date_modified'];
                }
        $prop_id = $result['prop_id'];
        ?>
        <url>
        <?php
$language = 'en_EN.ISO8859-1';

putenv("LANG=$language");
$locale = setlocale(LC_ALL, $language);

$domain = 'messages';

bindtextdomain("$domain", "/home/drlistin/public_html/lang/locale");
//bindtextdomain("$domain", "F:/www/DRlisting/lang/locale");
textdomain("$domain"); ?>
      <loc>http://www.<?=$_SERVER['SERVER_NAME']?>/<?= urlencode(sprintf("listing-%s-%d.html", BuildPropertyTitle($prop_id), $prop_id))?></loc>
      <lastmod><?= $lastmod?></lastmod>
      <changefreq>weekly</changefreq>
      <priority>0.9</priority>
        </url>
        <url>
        <?php
$language = 'fr_FR.ISO8859-1';

putenv("LANG=$language");
$locale = setlocale(LC_ALL, $language);

$domain = 'messages';

bindtextdomain("$domain", "/home/drlistin/public_html/lang/locale");
//bindtextdomain("$domain", "F:/www/DRlisting/lang/locale");
textdomain("$domain"); ?>
      <loc>http://www.<?=$_SERVER['SERVER_NAME']?>/<?= urlencode(sprintf("annonce-%s-%d.html", BuildPropertyTitle($prop_id), $prop_id))?></loc>
      <lastmod><?= $lastmod?></lastmod>
      <changefreq>weekly</changefreq>
      <priority>0.9</priority>
        </url>
        <url>
        <?php
$language = 'es_ES.ISO8859-1';

putenv("LANG=$language");
$locale = setlocale(LC_ALL, $language);

$domain = 'messages';

bindtextdomain("$domain", "/home/drlistin/public_html/lang/locale");
//bindtextdomain("$domain", "F:/www/DRlisting/lang/locale");
textdomain("$domain"); ?>
      <loc>http://www.<?=$_SERVER['SERVER_NAME']?>/<?= urlencode(sprintf("anoncio-%s-%d.html", BuildPropertyTitle($prop_id), $prop_id))?></loc>
      <lastmod><?= $lastmod?></lastmod>
      <changefreq>weekly</changefreq>
      <priority>0.9</priority>
        </url>
<?
  }
?>
        </urlset>
