76 lines
2.4 KiB
PHP
76 lines
2.4 KiB
PHP
<?
|
|
/* ===========================
|
|
|
|
gelato CMS development version
|
|
http://www.gelatocms.com/
|
|
|
|
gelato CMS is a free software licensed under GPL (General public license)
|
|
|
|
=========================== */
|
|
?>
|
|
<?
|
|
header("Content-type: text/xml; charset=utf-8");
|
|
|
|
require_once("classes/configuration.class.php");
|
|
$conf = new configuration();
|
|
|
|
echo "<?xml version=\"1.0\""." encoding=\"UTF-8\"?>\n";
|
|
|
|
include("classes/gelato.class.php");
|
|
$tumble = new gelato();
|
|
$rs = $tumble->getPosts("20");
|
|
if ($tumble->contarRegistros()>0) {
|
|
?>
|
|
|
|
<rss version="2.0">
|
|
<channel>
|
|
<title><?=htmlspecialchars(replaceAccents($conf->title));?></title>
|
|
<link><?=$conf->urlGelato;?></link>
|
|
<description><?=htmlspecialchars(replaceAccents($conf->description));?></description>
|
|
<language>EN</language>
|
|
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
|
|
<generator>gelato CMS</generator>
|
|
<image>
|
|
<url><?=$conf->urlGelato;?>/images/information.png</url>
|
|
<title><?=htmlspecialchars(replaceAccents($conf->description));?></title>
|
|
<link><?=$conf->urlGelato;?></link>
|
|
</image>
|
|
<?
|
|
while($register = mysql_fetch_array($rs)) {
|
|
$tit = ($register["title"]=="") ? htmlspecialchars($register["url"]) : htmlspecialchars($register["title"]);
|
|
$desc = htmlspecialchars($register["description"]);
|
|
$url = htmlspecialchars($conf->urlGelato."/index.php/post/".$register["id_post"]."/");
|
|
$formatedDate = gmdate("D, d M Y H:i:s \G\M\T", strtotime($register["date"]));
|
|
?>
|
|
|
|
<item>
|
|
<title><?=$tit;?></title>
|
|
<link><?=$url;?></link>
|
|
<description><?=$desc;?></description>
|
|
<pubDate><?=$formatedDate;?></pubDate>
|
|
<category>system:unfiled</category>
|
|
<guid isPermaLink="true"><?=$conf->urlGelato."/index.php/post/".$register["id_post"]."/";?></guid>
|
|
</item>
|
|
|
|
<?
|
|
}
|
|
}
|
|
?>
|
|
</channel>
|
|
</rss>
|
|
|
|
<?
|
|
function replaceAccents($texto="") {
|
|
$texto = str_replace("Á","A", $texto);
|
|
$texto = str_replace("É","E", $texto);
|
|
$texto = str_replace("Í","I", $texto);
|
|
$texto = str_replace("Ó","O", $texto);
|
|
$texto = str_replace("Ú","U", $texto);
|
|
$texto = str_replace("á","a", $texto);
|
|
$texto = str_replace("é","e", $texto);
|
|
$texto = str_replace("í","i", $texto);
|
|
$texto = str_replace("ó","o", $texto);
|
|
$texto = str_replace("ú","u", $texto);
|
|
return $texto;
|
|
}
|
|
?>
|