forked from Bigjoos/U-232-V1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getrss.php
59 lines (54 loc) · 2.43 KB
/
getrss.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
<?php
/**
* http://btdev.net:1337/svn/test/Installer09_Beta
* Licence Info: GPL
* Copyright (C) 2010 BTDev Installer v.1
* A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
* Project Leaders: Mindless,putyn.
**/
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'bittorrent.php');
require_once(INCL_DIR.'user_functions.php');
dbconn();
loggedinorreturn();
$lang = array_merge( load_language('global'), load_language('getrss') );
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$cats = isset($_POST['cats']) ? $_POST['cats'] : array();
if(count($cats) == 0)
stderr($lang['getrss_error'],$lang['getrss_nocat']);
$feed = isset($_POST['feed']) && $_POST['feed'] == 'dl' ? 'dl' : 'web';
$rsslink = $TBDEV['baseurl'].'/rss.php?cats='.join(',',$cats).($feed == 'dl' ? '&type=dl' : '').'&passkey='.$CURUSER['passkey'];
$HTMLOUT = "<div align=\"center\"><h2>{$lang['getrss_result']}</h2><br/>
<input type=\"text\" size=\"120\" readonly=\"readonly\" value=\"{$rsslink}\" onclick=\"select()\" />
</div>";
print(stdhead($lang['getrss_head2']).$HTMLOUT.stdfoot());
} else {
$HTMLOUT = <<<HTML
<form action="{$_SERVER['PHP_SELF']}" method="post">
<table width="500" cellpadding="2" cellspacing="0" align="center">
<tr>
<td colspan="2" align="center" class="colhead">{$lang['getrss_title']}</td>
</tr>
<tr>
<td align="right" valign="top">{$lang['getrss_cat']}</td><td align="left" width="100%">
HTML;
$q1 = sql_query('SELECT id,name,image FROM categories order by id') or sqlerr();
$i=0;
while($a = mysql_fetch_assoc($q1)) {
if($i%5 == 0 && $i>0)
$HTMLOUT .="<br/>";
$HTMLOUT .= "<label for=\"cat_{$a['id']}\"><img src=\"{$TBDEV['pic_base_url']}caticons/{$a['image']}\" alt=\"{$a['name']}\" title=\"{$a['name']}\" /><input type=\"checkbox\" name=\"cats[]\" id=\"cat_{$a['id']}\" value=\"{$a['id']}\" /></label>\n";
$i++;
}
$HTMLOUT .= <<<HTML
</td>
</tr>
<tr>
<td align="right">{$lang['getrss_feed']}</td><td align="left"><input type="radio" checked="checked" name="feed" id="std" value="web"/><label for="std">{$lang['getrss_web']}</label><br/><input type="radio" name="feed" id="dl" value="dl"/><label for="dl">{$lang['getrss_dl']}</label></td>
</tr>
<tr><td colspan="2" align="center"><input type="submit" value="{$lang['getrss_btn']}" /></td></tr>
</table>
</form>
HTML;
print(stdhead($lang['getrss_head2']).$HTMLOUT.stdfoot());
}
?>