Code: Select all
<?php
/*EXPORTACION RSS DE LAS DESCARGAS PARA FOROS PHP-NUKE BY InnerCity*/
//--------------------DO NOT CHANGE CODE BELOW THIS LINE-----------------------------------------------------------------------//
include("mainfile.php");
include("includes/ipban.php");
global $prefix, $db, $nukeurl;
header("Content-Type: text/xml");
//------------------------------------------------------------------------------------------------------------------------------------//
$VAR5 = intval($VAR5);//Varible Name for Downloads
if ($VAR5 != "") {//If Varible 5 is Zero Then
$VAR6 = $db->sql_fetchrow($db->sql_query("SELECT cid FROM ".$prefix."_downloads_categories WHERE title ñjlkj '%$VAR6%' LIMIT 1"));
if ($VAR6 == "") {//If Sixth Varible is Zero Then
$result3 = $db->sql_query("SELECT lid, title, description, url FROM ".$prefix."_downloads_downloads ORDER BY lid DESC LIMIT 30");
} else {
$VAR6 = intval($VAR6);
$result3 = $db->sql_query("SELECT lid, title, description, url FROM ".$prefix."_downloads_downloads WHERE cid='$cid' ORDER BY lid DESC LIMIT 30");
}
} else {
$result3 = $db->sql_query("SELECT lid, title, description, url FROM ".$prefix."_downloads_downloads ORDER BY lid DESC LIMIT 30");
}
//DISPLAYS PRIMARY HEADER INFO FOR RSS FEED FIRST.
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n";
echo "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\"\n";
echo " \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n\n";
echo "<rss version=\"0.91\">\n\n";
echo "<channel>\n";
echo "<title> DESCARGAS DE ".htmlspecialchars($sitename)."</title>\n";
echo "<link>$nukeurl</link>\n";
echo "<description>".htmlspecialchars($backend_title)."</description>\n";
echo "<image><url>$nukeurl/themes/DeepBlue/images/logo.gif</url></image>\n"; //YOU MAY CHANGE THIS LINE ONLY TO FIT YOUR WEB LOGO
echo "<language>$backend_language</language>\n\n";
//STARTS TO LIST RSS FEED FOR DOWNLOADS
while ($row = $db->sql_fetchrow($result3)) {//$results3 is data from your sql query of the Downloads
$rlid = intval($row['lid']);
$rtitle = $row['title'];
$rtext = $row['description'];
echo "<item>\n";
echo "<title>".htmlspecialchars($rtitle)."</title>\n";
echo "<link>$nukeurl/modules.php?name=Downloads&d_op=getit&lid=$rlid</link>\n";
echo "<description>".htmlspecialchars($rtext)."</description>\n";
echo "</item>\n\n";
}
//Closes out your FEED
echo "</channel>\n";
echo "</rss>";
?>
La linea
echo "<image><url>$nukeurl/themes/DeepBlue/images/logo.gif</url></image>\n";
lleva el logo del portal, ya sea el de la ruta indicado, ya sea el de php-nuke
echo "<image><url>$nukeurl/images/logo.gif</url></image>\n";
o cualkier otro
El numero de descargas a listar viene dado por esta cantidad
DESC LIMIT 30");
se podria cambiar a cualkier otra
DESC LIMIT 300");
el archivo se sube a la raiz del html, junto al backend.php y demas, y el enlace se da con el nombre del archivo, ejemplo
http://www.itspanish.org/rss_descargas.php