blob: 2a002ece84027684944dbe78aab2d5aaf07ef307 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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>
|