Viewing file: rss2.php (2.66 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php include "conn.php"; $hosting="http://www.papyrefb2.net";
echo '<?xml version="1.0" encoding="iso-8859-1"?> <!-- generator=creado a puro huevo by darklooker" --> <rss version="2.0"> <channel> <title>www.papyrefb2.net</title> <description>libros en fb2 para papyre</description> <link>http://www.papyrefb2.net</link> <lastBuildDate>Tue, 20 Jan 2009 09:07:27 +0100</lastBuildDate> <generator>FeedCreator 1.7.2</generator> <image> <url>'.$hosting.'/frames/papyreicon.gif</url> <title>www.papyrefb2.net</title> <link>http://www.papyrefb2.net</link> <description>feeds de papyrefb2.net</description> </image>';
// aqui sacamos los ultimos libros en stock $query="select autor, titulo,id,genero,subgenero,fecha_subida,anyo from libros where inftp=1 order by id desc limit 20"; $res=mysql_query($query,$conn); while ($row=mysql_fetch_array($res)){ $query2="select * from sinopsis where id_book={$row['id']}"; $res2=mysql_query($query2,$conn); $row2=mysql_fetch_array($res2); unset ($feed); $feed=elimina_acentos2(" <item> <title>Nuevo libro: {$row['autor']}-{$row['titulo']}</title> <link>{$hosting}/frames/buskador.php?id={$row['id']}</link> <description><![CDATA[ autor: {$row['autor']} <p>Titulo:<a href='{$hosting}/frames/buskador.php?id={$row['id']}'>{$row['titulo']}</a> <p>genero: {$row['genero']}-{$row['subgenero']} "); if ($row['anyo']>""){ $feed.="<p>A�o de publicacion del original:".$row['anyo']."<p>"; }else{ $feed.="<p>no se dispone de la informacion de a�o de publicacion del original.<p>"; } $feed.=elimina_acentos2("<P><center><img src='{$hosting}/includes/{$row2['imagename']}' width='155', height='216'></center> <p><STRONG>SINOPSIS</STRONG>: {$row2['sinopsis']} <p>libro subido el dia {$row['fecha_subida']} <hr> <p><p>]]></description> <category>Ultimos libros en FB2</category> <pubDate>{$row['fecha_subida']}</pubDate> </item>"); echo $feed; // <pubDate>Sat, 03 Jan 2009 11:40:46 +0100</pubDate> } // fin echo "</channel> </rss>"; mysql_close($conn);
function elimina_acentos2($cadena){ $tofind = "&���'�"; $replac = "y N "; return(strtr($cadena,$tofind,$replac)); }
?>
|