diff options
author | citizenz7 <citizenz7@protonmail.com> | 2017-04-20 18:50:55 +0200 |
---|---|---|
committer | citizenz7 <citizenz7@protonmail.com> | 2017-04-20 18:50:55 +0200 |
commit | 5fd9fa480f302902328b81f912dd67ce378284f8 (patch) | |
tree | 66234843ae2857fda12442e4f7577c527d48977c /Html/rss.php | |
parent | ebe731862c7c741171138b1083906f391fc35aff (diff) | |
download | freetorrent-5fd9fa480f302902328b81f912dd67ce378284f8.tar.xz freetorrent-5fd9fa480f302902328b81f912dd67ce378284f8.zip |
V.1.4.6
Diffstat (limited to '')
-rw-r--r-- | Html/rss.php | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Html/rss.php b/Html/rss.php new file mode 100644 index 0000000..2a002ec --- /dev/null +++ b/Html/rss.php @@ -0,0 +1,55 @@ +<?php +header('Content-type: text/xml'); +echo '<?xml version="1.0" encoding="UTF-8" ?>'; + +require_once("includes/config.php"); + +//Titre de la page +$pagetitle = 'Flux RSS'; + +//Stats : bbclone +define("_BBC_PAGE_NAME", $pagetitle); +define("_BBCLONE_DIR", "bbclone/"); +define("COUNTER", _BBCLONE_DIR."mark_page.php"); +if (is_readable(COUNTER)) include_once(COUNTER); +?> +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> + +<?php +$nomsite = SITENAMELONG; +?> + + <channel> + <title><?php echo SITEURL; ?></title> + <language>fr</language> + <link><?php echo SITEURL; ?></link> + <lastBuildDate><?php print date("D, d M Y H:i:s O");?></lastBuildDate> + <description><?php echo SITESLOGAN; ?></description> + <copyright><?php print "(copyleft)". date("Y",time())." " .$nomsite; ?></copyright> + <atom:link href="<?php echo SITEURL; ?>/rss.php" rel="self" type="application/rss+xml" /> + + <?php + $stmt = $db->query("SELECT * FROM blog_posts_seo,xbt_files WHERE blog_posts_seo.postID = xbt_files.fid ORDER BY postDate DESC LIMIT 10"); + while($data = $stmt->fetch()) { + $id=html($data['postID']); + $filename = preg_replace(array('/</', '/>/', '/"/'), array('<', '>', '"'), $data['postTitle']); + $seeders = strip_tags($data['seeders']); + $leechers = strip_tags($data['leechers']); + $desc = nl2br(bbcode($data['postDesc'])); + $torrent = html($data['postTorrent']); + $f= rawurlencode(html($data['postTitle'])); + $taille = strip_tags($data['postTaille']); + + // on affiche dans le navigateur + echo "<item>\n"; + echo "<title><![CDATA[$filename [seeders ($seeders)/leechers ($leechers)]]]></title>\n"; + echo "<link>".SITEURL."/".$data['postSlug']."</link>\n"; + echo "<guid>".SITEURL."/".$data['postSlug']."</guid>\n"; + echo "<description><![CDATA[".$desc."]]></description>\n"; + echo "<enclosure url=\"".SITEURL."/torrents/".$torrent."\" length=\"".$taille."\" type=\"application/x-bittorrent\" />"; + echo "<pubDate>".$data["postDate"]." GMT</pubDate>\n"; + echo "</item>\n"; + } + ?> + </channel> +</rss> |