Ver Mensaje Individual
  #6 (permalink)  
Antiguo 03/10/2005, 07:03
Avatar de Reynier
Reynier
 
Fecha de Ingreso: noviembre-2002
Ubicación: Por ahí en algún sitio
Mensajes: 1.844
Antigüedad: 21 años, 5 meses
Puntos: 1
Disculpas

Hola jam1138:
Te explico.
Código PHP:
if ( $rscantidad[0] > 
esto lo que hace es veficar si existen o no noticias en la tabla. Entonces si te fijas en mi código incluyo un fichero llamado dBug.php que se encarga de imprimirme los arreglos de una forma amigable. Fijate que la instancion y le paso como parametro el arreglo.
Código PHP:
include_once('../includes/dBug.php'); 
new 
dBug($noticias); 
Me he ido por otra via. O sea esta:
Código PHP:
# RSS File
$res="";
$res.="<?xml version="1.0\" encoding=\"UTF-8\"?>\n";
$res.="<rss version=\"2.0\">\n";
$res.="\t<channel>\n";
$res.="\t\t<title><![CDATA[RSS Portal de los Joven Club de Computaci&oacute;n y Electr&oacute;nica de Granma]]></title>\n";
$res.="\t\t<description><![CDATA[RSS Portal de los Joven Club de Computaci&oacute;n y Electr&oacute;nica de Granma]]></description>\n";
$res.="\t\t<language>es-es</language>\n";
$res.="\t\t<generator>RSS Portal JClub Granma</generator>\n";

if ( 
$rscantidad[0] > ){
    
$fecha_noticias $db->SQLDate('d M Y - h:i:s A','FechaN');
    
$noticia $db->Execute("SELECT IDN, IDC, $fecha_noticias, TituloN, DescN, AutorN FROM noticia WHERE (NACtiva<>0) ORDER BY FechaN DESC");
    while(
$rs $noticia->fetchRow()){
        
$res.="\t\t<item>\n";
        
$res.="\t\t\t<title><![CDATA[".stripslashes($rs['TituloN'])."]]></title>\n";
        
$res.="\t\t\t<description><![CDATA[".stripslashes($rs['DescN'])."]]></description>\n";
        
$res.="\t\t\t<pubDate>".stripslashes($fecha_noticias)."</pubDate>\n";
        
$res.="\t\t\t<link>".stripslashes($PageAdress."&amp;IDC=".$rs['IDC']."&amp;IDN=".$rs['IDN'])."</link>\n";
        
$res.="\t\t\t<author>".stripslashes($rs["AutorN"])."</author>\n";
        
$res.="\t\t</item>\n";
    }
}

$res.="\t</channel>\n";
$res.="</rss>\n";

$actual date("Ymd");

$handler  fopen("noticias-".$actual.".xml",'w+');
if(!
fputs($handler$res)) {
    echo 
"No se pudo crear el Rss";
}
fclose($handler);
pero ahora me da error en el fichero XML pues me dice que esta mal formado.

Salu2
__________________
Ing. Reynier Pérez Mira