﻿<?
/**
 * Sitemap de la web
 *
 * @author Víctor Estévez Gómez <victor.estevez@isertia.grupobittia.com>
 * @category Public
 * @copyright Copyright © 2009, ISERTIA - Grupo BITTIA
 * @filesource
 * @package Public
 * @version 1.0 2008/10/01
 */


/**
 * Inicializador de las cosas
 */
include('inc/init_public.php');

/**
 * Obtener datos de la base de datos
 */
require_once(INSTALATION_DIR_ABS.'/inc/data.class.php');

//Noticias
$data['news']['id'] = array('type' => 'int');
$data['news']['id_language'] = array('type' => 'id_language', 'default' => $GLOBALS['krnl']->lng_content_get());
$data['news']['title'] = array('type' => 'string');
$data['news']['time'] = array('type' => 'time', 'format' => '%d/%m/%y', 'time'=>'no', 'local'=>'yes');
//Configuración
$config['sql']['show']['order'] = '';
//Datos
$news = new data(&$data, &$config);
$news->load();

//Trabajos
$data2['portfolio']['id'] = array('type' => 'int');
$data2['portfolio']['id_language'] = array('type' => 'id_language', 'default' => $GLOBALS['krnl']->lng_content_get());
$data2['portfolio']['title'] = array('type' => 'string');
$data2['portfolio']['time'] = array('type' => 'time', 'format' => '%d/%m/%y', 'time'=>'no', 'local'=>'yes');
//Configuración
$config2['sql']['show']['order'] = '';
//Datos
$portfolio = new data(&$data2, &$config2);
$portfolio->load();

//Compañia
$data3['contents']['id'] = array('type' => 'int');
$data3['contents']['id_language'] = array('type' => 'id_language', 'default' => $GLOBALS['krnl']->lng_content_get());
$data3['contents']['title'] = array('type' => 'string');
//Configuración
$config3['sql']['show']['order'] = '';
$contents = new data(&$data3, &$config3);
$contents->load();

//Servicios
$data4['businessareas']['id'] = array('type' => 'int');
$data4['businessareas']['title'] = array('type' => 'string');
//Configuración
$config4['sql']['show']['order'] = '';
$services = new data(&$data4, &$config4);
$services->load();


header('content-type: application/xml');
echo '<?xml version="1.0" encoding="UTF-8" ?>
';
?>
<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">
<url>
  <loc><?=$krnl->make_url('companies')?></loc>
  <priority>0.5</priority>
  <changefreq>monthly</changefreq>
</url>
<url>
  <loc><?=$krnl->make_url('services')?></loc>
  <priority>0.6</priority>
  <changefreq>monthly</changefreq>
</url>
<url>
  <loc><?=$krnl->make_url('portfolio')?></loc>
  <priority>0.8</priority>
  <changefreq>monthly</changefreq>
</url>
<url>
  <loc><?=$krnl->make_url('news')?></loc>
  <priority>0.7</priority>
  <changefreq>monthly</changefreq>
</url>
<url>
  <loc><?=$krnl->make_url('legal-notice')?></loc>
  <priority>0.1</priority>
  <changefreq>yearly</changefreq>
</url>
<url>
  <loc><?=$krnl->make_url('sitemap')?></loc>
  <priority>0.6</priority>
  <changefreq>daily</changefreq>
</url>
<?
//Portfolio
while($portfolio->next_row())
{
	?>
	<url>
	  <loc><?=$krnl->make_url('portfolio', $krnl->make_permalink($portfolio->get('title')).'_'.$portfolio->get('id'))?></loc>
	  <priority>0.8</priority>
	  <changefreq>monthly</changefreq>
	</url>
	<?
}
//News
while($news->next_row())
{
	?>
	<url>
	  <loc><?=$krnl->make_url('news', $krnl->make_permalink($news->get('title')).'_'.$news->get('id'))?></loc>
	  <priority>0.7</priority>
	  <changefreq>monthly</changefreq>
	</url>
	<?
}
//Contenidos empresa
while($contents->next_row())
{
	?>
	<url>
	  <loc><?=$krnl->make_url('companies', $krnl->make_permalink($contents->get('title').'_'.$contents->get('id')))?></loc>
	  <priority>0.6</priority>
	  <changefreq>monthly</changefreq>
	</url>
	<?
}
//Servicios
while($services->next_row())
{
	?>
	<url>
	  <loc><?=$krnl->make_url('services', $krnl->make_permalink($services->get('title')).'_'.$services->get('id'))?></loc>
	  <priority>0.5</priority>
	  <changefreq>monthly</changefreq>
	</url>
	<?
}
?>
</urlset>
