<?xml version="1.0" encoding="UTF-8"?> 

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"> 
<? 
include "/home/elvallen/public_html/text.php";

/* Conectar Bases de Datos Noticias*/
include "/home/elvallen/public_html/config/config.php";

/* Conectar Bases de Datos Noticias*/
$db = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db ($db_name) or die ("Cannot connect to database");

$query = "SELECT id_cnt, menutex, menu, titulo, main, imagen, textope, date FROM noticias ORDER BY `date` DESC  LIMIT  0, 50";
$result = mysql_query($query);

while($r=mysql_fetch_array($result))  {
 	$id=$r['id_cnt']; 
 	$title=strip_tags($r['titulo']);
 	$body=$r["textope"];
 	$pubDate = $r['date'];
 	$pubDate= date('r', $pubDate);
 
 $title= xmlentities ($title);
 $body= xmlentities ($body);
 $mas = str_replace (' ', '-', $title);
?>
<url>
     <loc>https://www.elvallenato.com/noticias/<? echo $id;?>/<? echo $mas;?>.htm</loc>
     <news:news>
        <news:publication>
            <news:name><? echo $title;?></news:name>
            <news:language>es</news:language>
        </news:publication>
        <news:genres>PressRelease, Blog</news:genres>
        <news:publication_date>2008-12-23</news:publication_date>
        <news:title>Companies A, B in Merger Talks</news:title>
        <news:keywords>business, merger, acquisition, A, B</news:keywords>
        <news:stock_tickers>NASDAQ:A, NASDAQ:B</news:stock_tickers>
    </news:news>
</url>
<? } ?>
</urlset>
<?
function xmlentities ( $string ){
    $string = preg_replace("/\[(.*?)\]/i", "", $string);  
    $string = str_replace('<','&lt;',$string); 
    $string = str_replace("\n",'',$string); 
    $string = str_replace("\r",'',$string); 
    $string = str_replace ( array ( '&', '"', "'", '<', '>' ), array ( 'Y' , '', '' , '' , '' ), $string );
       return $string;
}
?>