-
Notifications
You must be signed in to change notification settings - Fork 7
/
get_rss.php
73 lines (63 loc) · 2.63 KB
/
get_rss.php
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
//Torrent RSS by DiemThuy ( jul 2012 ) TBDEV conversion with some improvements; Adapated by Yupy for BtiTracker...
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'functions.php');
dbconn();
if (user::$current['view_torrents'] == 'yes') {
standardheader('RSS');
$res = $db->query("SELECT id, name, image FROM categories ORDER BY name");
while ($cat = $res->fetch_assoc())
if ($cat['image'] == '') {
$catoptions .= '';
} else {
$catoptions .= "<a href='torrents.php?category=" . $cat['id'] . "'>" . image_or_link(($cat['image'] == ''?'':"$STYLEPATH/images/categories/" . $cat['image']), '', security::html_safe($cat['name']))."</a><input type='checkbox' name='cat[]' value='" . (int)$cat['id'] . "' " . (strpos($CURUSER['notifs'], "[cat$cat[id]]") !== false ? " checked" : '') . "/>";
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (empty($_POST['cat']))
stderr('Error', 'You need to chose at least one Category !');
if (empty($_POST['feed']))
stderr('Error', 'You need to chose a feed type !');
$link = $BASEURL . '/rss_torrents.php';
if ($_POST['feed'] == 'dl')
$query[] = 'feed=dl';
foreach($_POST['cat'] as $cat)
$query[] = 'cat[]=' . $cat;
$query[] = 'pid=' . user::$current['pid'];
$queries = implode('&', $query);
if ($queries)
$link .= '?' . $queries;
if ($_POST['feed'] == 'dl') {
err_msg('RSS Link', 'Use the following url in your RSS reader:<br><b>' . $link . '</b><br>');
stdfoot();
exit();
} else
header('Refresh: 0; url=' . $link);
}
block_begin('Get RSS');
?>
<form method='POST' action='get_rss.php'>
<table class='header' width='80%' align='center'>
<tr>
<td class='header' width='30%'>Categories:</td>
<td class='lista' width='50%'><?php echo $catoptions; ?></td>
</tr>
<tr>
<td width='30%'><br /></td>
</tr>
<tr>
<td class='header'>Feed Type:</td>
<td>
<input type='radio' name='feed' value='web' />Web Link
<input type='radio' name='feed' value='dl' />Download Link
<br />
</td>
</tr>
<tr>
<td style="text-align:center"><br><button type="submit">Get RSS<br></button></td>
</tr>
</table>
</form>
<?php
block_end();
stdfoot();
}
?>