Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/05/2009, 16:57
NiB
 
Fecha de Ingreso: octubre-2005
Mensajes: 59
Antigüedad: 18 años, 6 meses
Puntos: 0
Problema con creación de feed

Hola,

Llevo días con este script para generar un feed de noticias y no consigo que funcione correctamente.
No estaba seguro si poner el tema en xml o php, he decidido ponerlo aquí.

Me muestra todos los títulos de las noticias y a continuación, todas las descripciones de las mismas noticias, tampoco me muestra las fechas de los artículos.

este es el código:
Código PHP:
<?php
header
("Content-Type: application/rss+xml"); 
echo 
'<?xml version="1.0" encoding="windows-1252"?>';
?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
<channel> 
<title><![CDATA[Kiske Official Fanclub]]></title>
<image>
<url>http://www.michaelkiske.net/kiskelogo01.jpg</url>
<title>Kiske Official Fanclub</title>
<link>http://www.michaelkiske.net</link>
</image>
<link><![CDATA[http://www.michaelkiske.net]]></link> 
<description><![CDATA[All about Michael Kiske and related]]></description>
<language>en-en</language> 
<copyright><![CDATA[michaelkiske.net]]></copyright>
<atom:link href="http://www.michaelkiske.net/news-rss.php" rel="self"
 type="application/rss+xml" />
<ttl>15</ttl> 

<?php

include ("news-rss-functions.php");// solo tiene la función para conectar a la bd
$bbdd nombre_bd;
$link conectarse($bbdd);

$sql "SELECT * FROM tabla_news ORDER BY id DESC";    
$result mysql_query($sql) or die('No se ha podido realizar la consulta.');
while (
$row mysql_fetch_array($result)) {
    
$news_id $row['id'];
    
$news_subject htmlentities(strip_tags($row['subject']), ENT_QUOTES);
    
$news_date $row['time'];
    
$fecha_con_formato date("r",$news_date);
/*    $descripcion=substr($row['titletext'],0,300)."...";*/
    
$news_text htmlentities(strip_tags($row['titletext']), ENT_QUOTES);
    
$enlace "http://michaelkiske.net/index_en.php?action=fullnews&showcomments=1&id=$news_id";
    echo(
"<item>");
    echo(
"<title><![CDATA[$news_subject]]></title>");
    echo(
"<pubDate><![CDATA[$fecha_con_formato]]></pubDate>");
    echo(
"<description><![CDATA[$news_text]]></description>");
    echo(
"<link><![CDATA[$enlace]]></link>");
    echo(
"<guid isPermaLink=\"true\"><![CDATA[$enlace]]></guid>");
    echo(
"</item>");
}
?>
</channel>
</rss>
Por si queréis agregar el feed para ver el problema http://www.michaelkiske.net/news-rss.php , yo uso google reader, no he probado en otros.

gracias de antemano