Files
nexusphp/public/getrss.php

355 lines
15 KiB
PHP
Raw Normal View History

2020-12-26 01:42:23 +08:00
<?php
2021-01-13 19:32:26 +08:00
require "../include/bittorrent.php";
2020-12-26 01:42:23 +08:00
dbconn();
require_once(get_langfile_path());
loggedinorreturn();
$brsectiontype = $browsecatmode;
$spsectiontype = $specialcatmode;
if ($enablespecial == 'yes' && user_can('view_special_torrent'))
2020-12-26 01:42:23 +08:00
$allowspecial = true;
else $allowspecial = false;
$showsubcat = (get_searchbox_value($brsectiontype, 'showsubcat') || ($allowspecial && get_searchbox_value($spsectiontype, 'showsubcat')));
$showsource = (get_searchbox_value($brsectiontype, 'showsource') || ($allowspecial && get_searchbox_value($spsectiontype, 'showsource'))); //whether show sources or not
$showmedium = (get_searchbox_value($brsectiontype, 'showmedium') || ($allowspecial && get_searchbox_value($spsectiontype, 'showmedium'))); //whether show media or not
$showcodec = (get_searchbox_value($brsectiontype, 'showcodec') || ($allowspecial && get_searchbox_value($spsectiontype, 'showcodec'))); //whether show codecs or not
$showstandard = (get_searchbox_value($brsectiontype, 'showstandard') || ($allowspecial && get_searchbox_value($spsectiontype, 'showstandard'))); //whether show standards or not
$showprocessing = (get_searchbox_value($brsectiontype, 'showprocessing') || ($allowspecial && get_searchbox_value($spsectiontype, 'showprocessing'))); //whether show processings or not
$showteam = (get_searchbox_value($brsectiontype, 'showteam') || ($allowspecial && get_searchbox_value($spsectiontype, 'showteam'))); //whether show teams or not
$showaudiocodec = (get_searchbox_value($brsectiontype, 'showaudiocodec') || ($allowspecial && get_searchbox_value($spsectiontype, 'showaudiocodec'))); //whether show audio codecs or not
$brcatsperror = (int)get_searchbox_value($brsectiontype, 'catsperrow');
$catsperrow = (int)get_searchbox_value($spsectiontype, 'catsperrow');
$catsperrow = !$allowspecial ? $brcatsperror : $catsperrow; //show how many cats per line
2020-12-26 01:42:23 +08:00
$brcatpadding = get_searchbox_value($brsectiontype, 'catpadding');
$spcatpadding = get_searchbox_value($spsectiontype, 'catpadding');
$catpadding = (!$allowspecial ? $brcatpadding : ($brcatpadding < $spcatpadding ? $brcatpadding : $spcatpadding)); //padding space between categories in pixel
$brcats = genrelist($brsectiontype);
$spcats = genrelist($spsectiontype);
if ($showsubcat){
if ($showsource) $sources = searchbox_item_list("sources", $brsectiontype);
if ($showmedium) $media = searchbox_item_list("media", $brsectiontype);
if ($showcodec) $codecs = searchbox_item_list("codecs", $brsectiontype);
if ($showstandard) $standards = searchbox_item_list("standards", $brsectiontype);
if ($showprocessing) $processings = searchbox_item_list("processings", $brsectiontype);
if ($showteam) $teams = searchbox_item_list("teams", $brsectiontype);
if ($showaudiocodec) $audiocodecs = searchbox_item_list("audiocodecs", $brsectiontype);
2020-12-26 01:42:23 +08:00
}
stdhead($lang_getrss['head_rss_feeds']);
2021-05-05 22:28:19 +08:00
$query = [];
$query[] = "passkey=" . $CURUSER['passkey'];
2020-12-26 01:42:23 +08:00
if ($_SERVER['REQUEST_METHOD'] == "POST") {
2022-11-02 17:31:14 +08:00
$allowed_showrows=array('10','50','100','200');
2020-12-26 01:42:23 +08:00
$link = get_protocol_prefix(). $BASEURL ."/torrentrss.php";
if (isset($_POST['showrows']) && in_array($_POST['showrows'], $allowed_showrows, 1))
$query[] = "rows=".(int)$_POST['showrows'];
else {
stdmsg($lang_getrss['std_error'],$lang_getrss['std_no_row']);
stdfoot();
die();
}
foreach ($brcats as $cat)
{
2020-12-28 20:52:54 +08:00
if (!empty($_POST["cat{$cat['id']}"]))
2020-12-26 01:42:23 +08:00
{
2020-12-28 20:52:54 +08:00
$query[] = "cat{$cat['id']}=1";
2020-12-26 01:42:23 +08:00
}
}
if ($enablespecial == 'yes')
{
foreach ($spcats as $cat)
{
2020-12-28 20:52:54 +08:00
if (!empty($_POST["cat{$cat['id']}"]))
2020-12-26 01:42:23 +08:00
{
2020-12-28 20:52:54 +08:00
$query[] = "cat{$cat['id']}=1";
2020-12-26 01:42:23 +08:00
}
}
}
if ($showsubcat){
if ($showsource)
foreach ($sources as $source)
{
2020-12-28 20:52:54 +08:00
if (!empty($_POST["sou{$source['id']}"]))
2020-12-26 01:42:23 +08:00
{
2020-12-28 20:52:54 +08:00
$query[] = "sou{$source['id']}=1";
2020-12-26 01:42:23 +08:00
}
}
if ($showmedium)
foreach ($media as $medium)
{
2020-12-28 20:52:54 +08:00
if (!empty($_POST["med{$medium['id']}"]))
2020-12-26 01:42:23 +08:00
{
2020-12-28 20:52:54 +08:00
$query[] = "med{$medium['id']}=1";
2020-12-26 01:42:23 +08:00
}
}
if ($showcodec)
foreach ($codecs as $codec)
{
2020-12-28 20:52:54 +08:00
if (!empty($_POST["cod{$codec['id']}"]))
2020-12-26 01:42:23 +08:00
{
2020-12-28 20:52:54 +08:00
$query[] = "cod{$codec['id']}=1";
2020-12-26 01:42:23 +08:00
}
}
if ($showstandard)
foreach ($standards as $standard)
{
2020-12-28 20:52:54 +08:00
if (!empty($_POST["sta{$standard['id']}"]))
2020-12-26 01:42:23 +08:00
{
2020-12-28 20:52:54 +08:00
$query[] = "sta{$standard['id']}=1";
2020-12-26 01:42:23 +08:00
}
}
if ($showprocessing)
foreach ($processings as $processing)
{
2020-12-28 20:52:54 +08:00
if (!empty($_POST["pro{$processing['id']}"]))
2020-12-26 01:42:23 +08:00
{
2020-12-28 20:52:54 +08:00
$query[] = "pro{$processing['id']}=1";
2020-12-26 01:42:23 +08:00
}
}
if ($showteam)
foreach ($teams as $team)
{
2020-12-28 20:52:54 +08:00
if (!empty($_POST["tea{$team['id']}"]))
2020-12-26 01:42:23 +08:00
{
2020-12-28 20:52:54 +08:00
$query[] = "tea{$team['id']}=1";
2020-12-26 01:42:23 +08:00
}
}
if ($showaudiocodec)
foreach ($audiocodecs as $audiocodec)
{
2020-12-28 20:52:54 +08:00
if (!empty($_POST["aud{$audiocodec['id']}"]))
2020-12-26 01:42:23 +08:00
{
2020-12-28 20:52:54 +08:00
$query[] = "aud{$audiocodec['id']}=1";
2020-12-26 01:42:23 +08:00
}
}
}
2020-12-28 20:52:54 +08:00
if (!empty($_POST["itemcategory"]))
2020-12-26 01:42:23 +08:00
{
$query[] = "icat=1";
}
2020-12-28 20:52:54 +08:00
if (!empty($_POST["itemsmalldescr"]))
2020-12-26 01:42:23 +08:00
{
$query[] = "ismalldescr=1";
}
2020-12-28 20:52:54 +08:00
if (!empty($_POST["itemsize"]))
2020-12-26 01:42:23 +08:00
{
$query[] = "isize=1";
}
2020-12-28 20:52:54 +08:00
if (!empty($_POST["itemuploader"]))
2020-12-26 01:42:23 +08:00
{
$query[] = "iuplder=1";
}
2020-12-28 20:52:54 +08:00
$searchstr = mysql_real_escape_string(trim($_POST["search"] ?? ''));
2020-12-29 21:49:37 +08:00
// if (empty($searchstr))
// unset($searchstr);
2020-12-26 01:42:23 +08:00
if ($searchstr)
{
$query[] = "search=".rawurlencode($searchstr);
if ($_POST["search_mode"]){
$search_mode = intval($_POST["search_mode"] ?? 0);
2020-12-26 01:42:23 +08:00
if (!in_array($search_mode,array(0,1,2)))
{
$search_mode = 0;
}
$query[] = "search_mode=".$search_mode;
}
}
$inclbookmarked=intval($_POST['inclbookmarked'] ?? 0);
2020-12-26 01:42:23 +08:00
if($inclbookmarked)
{
if (!in_array($inclbookmarked,array(0,1)))
{
$inclbookmarked = 0;
}
$addinclbm = "&inclbookmarked=".$inclbookmarked;
}
else
{
$addinclbm="";
}
$queries = implode("&", $query);
if ($queries)
$link .= "?".$queries;
$msg = $lang_getrss['std_use_following_url'] ."\n".$link."\n\n".$lang_getrss['std_utorrent_feed_url']."\n".$link."&linktype=dl".$addinclbm;
2020-12-26 01:42:23 +08:00
stdmsg($lang_getrss['std_done'],format_comment($msg));
stdfoot();
die();
}
2020-12-26 01:42:23 +08:00
?>
<h1 align="center"><?php echo $lang_getrss['text_rss_feeds']?></h1>
<form method="post" action="getrss.php">
2021-05-26 21:38:39 +08:00
<table cellspacing="1" cellpadding="5" width="97%">
2020-12-26 01:42:23 +08:00
<tr>
<td class="rowhead"><?php echo $lang_getrss['row_categories_to_retrieve']?>
</td>
<td class="rowfollow" align="left">
<?php
/*
2020-12-26 01:42:23 +08:00
$categories = "<table><tr><td class=\"embedded\" align=\"left\"><b>".$lang_getrss['text_category']."</b></td></tr><tr>";
$i = 0;
foreach ($brcats as $cat)//print category list of Torrents section
{
$numinrow = $i % $catsperrow;
$rownum = (int)($i / $catsperrow);
if ($i && $numinrow == 0){
$categories .= "</tr>".($brenablecatrow ? "<tr><td class=\"embedded\" align=\"left\"><b>".$brcatrow[$rownum]."</b></td></tr>" : "")."<tr>";
}
2020-12-28 20:52:54 +08:00
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"cat".$cat['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cat".$cat['id']."]") !== false ? " checked=\"checked\"" : "")." value='yes' />".return_category_image($cat['id'], "torrents.php?allsec=1&amp;")."</td>\n";
2020-12-26 01:42:23 +08:00
$i++;
}
$categories .= "</tr>";
if ($allowspecial) //print category list of Special section
{
$categories .= "<tr>";
$i = 0;
foreach ($spcats as $cat)
{
$numinrow = $i % $catsperrow;
$rownum = (int)($i / $catsperrow);
if ($i && $numinrow == 0){
$categories .= "</tr>".($spenablecatrow ? "<tr><td class=\"embedded\" align=\"left\"><b>".$spcatrow[$rownum]."</b></td></tr>" : "")."<tr>";
}
2020-12-28 20:52:54 +08:00
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"cat".$cat['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cat".$cat['id']."]") !== false ? " checked=\"checked\"" : "")." value='yes' />".return_category_image($cat['id'], "torrents.php?allsec=1&amp;")."</td>\n";
2020-12-26 01:42:23 +08:00
$i++;
}
$categories .= "</tr>";
}
if ($showsubcat)//Show subcategory (i.e. source, codecs) selections
{
if ($showsource){
$categories .= "<tr><td class=\"embedded\" align=\"left\"><b>".$lang_getrss['text_source']."</b></td></tr><tr>";
$i = 0;
foreach ($sources as $source)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
2020-12-28 20:52:54 +08:00
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"sou".$source['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[sou".$source['id']."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$source['name']."</td>\n";
2020-12-26 01:42:23 +08:00
$i++;
}
$categories .= "</tr>";
}
if ($showmedium){
$categories .= "<tr><td class=\"embedded\" align=\"left\"><b>".$lang_getrss['text_medium']."</b></td></tr><tr>";
$i = 0;
foreach ($media as $medium)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
2020-12-28 20:52:54 +08:00
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"med".$medium['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[med".$medium['id']."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$medium['name']."</td>\n";
2020-12-26 01:42:23 +08:00
$i++;
}
$categories .= "</tr>";
}
if ($showcodec){
$categories .= "<tr><td class=\"embedded\" align=\"left\"><b>".$lang_getrss['text_codec']."</b></td></tr><tr>";
$i = 0;
foreach ($codecs as $codec)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
2020-12-28 20:52:54 +08:00
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"cod".$codec['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[cod".$codec['id']."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$codec['name']."</td>\n";
2020-12-26 01:42:23 +08:00
$i++;
}
$categories .= "</tr>";
}
if ($showaudiocodec){
$categories .= "<tr><td class=\"embedded\" align=\"left\"><b>".$lang_getrss['text_audio_codec']."</b></td></tr><tr>";
$i = 0;
foreach ($audiocodecs as $audiocodec)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
2020-12-28 20:52:54 +08:00
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"aud".$audiocodec['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[aud".$audiocodec['id']."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$audiocodec['name']."</td>\n";
2020-12-26 01:42:23 +08:00
$i++;
}
$categories .= "</tr>";
}
if ($showstandard){
$categories .= "<tr><td class=\"embedded\" align=\"left\"><b>".$lang_getrss['text_standard']."</b></td></tr><tr>";
$i = 0;
foreach ($standards as $standard)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
2020-12-28 20:52:54 +08:00
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"sta".$standard['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[sta".$standard['id']."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$standard['name']."</td>\n";
2020-12-26 01:42:23 +08:00
$i++;
}
$categories .= "</tr>";
}
if ($showprocessing){
$categories .= "<tr><td class=\"embedded\" align=\"left\"><b>".$lang_getrss['text_processing']."</b></td></tr><tr>";
$i = 0;
foreach ($processings as $processing)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
2020-12-28 20:52:54 +08:00
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"pro".$processing['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[pro".$processing['id']."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$processing['name']."</td>\n";
2020-12-26 01:42:23 +08:00
$i++;
}
$categories .= "</tr>";
}
if ($showteam){
$categories .= "<tr><td class=\"embedded\" align=\"left\"><b>".$lang_getrss['text_team']."</b></td></tr><tr>";
$i = 0;
foreach ($teams as $team)
{
$categories .= ($i && $i % $catsperrow == 0) ? "</tr><tr>" : "";
2020-12-28 20:52:54 +08:00
$categories .= "<td align=\"left\" class=\"bottom\" style=\"padding-bottom: 4px;padding-left: ".$catpadding."px\"><input name=\"tea".$team['id']."\" type=\"checkbox\" " . (strpos($CURUSER['notifs'], "[tea".$team['id']."]") !== false ? " checked=\"checked\"" : "") . " value='yes' />".$team['name']."</td>\n";
2020-12-26 01:42:23 +08:00
$i++;
}
$categories .= "</tr>";
}
}
$categories .= "</table>";
*/
2022-10-27 20:21:54 +08:00
$categories = build_search_box_category_table($browsecatmode, 'yes', 'torrents.php?allsec=1&', false, 3, '', ['section_name' => true]);
2020-12-26 01:42:23 +08:00
print($categories);
2022-10-30 17:30:24 +08:00
if (get_setting('main.spsct') == 'yes') {
print '<div style="height: 1px;background-color: #eee;margin: 10px 0"></div>';
$categoriesSpecial = build_search_box_category_table($specialcatmode, 'yes', 'torrents.php?allsec=1&', false, 3, '', ['section_name' => true]);
print($categoriesSpecial);
}
2020-12-26 01:42:23 +08:00
?>
</td>
</tr>
<tr>
<td class="rowhead"><?php echo $lang_getrss['row_show_bookmarked']?>
</td>
<td class="rowfollow" align="left">
<input type="radio" name="inclbookmarked" id="inclbookmarked0" value="0" checked="checked" /><label for="inclbookmarked0"><?php echo $lang_getrss['text_all']?></label>&nbsp;<input type="radio" name="inclbookmarked" id="inclbookmarked1" value="1" /><label for="inclbookmarked1"><?php echo $lang_getrss['text_only_bookmarked']?></label><div><?php echo $lang_getrss['text_show_bookmarked_note']?></div>
</td>
</tr>
<tr>
<td class="rowhead"><?php echo $lang_getrss['row_item_title_type']?>
</td>
<td class="rowfollow" align="left">
<input type="checkbox" name="itemcategory" value="1" /><?php echo $lang_getrss['text_item_category']?>&nbsp;<input type="checkbox" name="itemtitle" checked="checked" disabled="disabled" /><?php echo $lang_getrss['text_item_title']?>&nbsp;<input type="checkbox" name="itemsmalldescr" value="1" /><?php echo $lang_getrss['text_item_small_description']?>&nbsp;<input type="checkbox" name="itemsize" value="1" /><?php echo $lang_getrss['text_item_size']?>&nbsp;<input type="checkbox" name="itemuploader" value="1" /><?php echo $lang_getrss['text_item_uploader']?>
</td>
</tr>
<tr><td class="rowhead"><?php echo $lang_getrss['row_rows_per_page']?></td><td class="rowfollow" align="left"><select name="showrows">
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
</select></td></tr>
<tr><td class="rowhead"><?php echo $lang_getrss['row_keyword']?></td>
<td class="rowfollow" align="left">
2021-05-05 22:28:19 +08:00
<input type="text" name="search" style="width: 200px;" /> <?php echo $lang_getrss['text_with']?>
2020-12-26 01:42:23 +08:00
<select name="search_mode" style="width: 60px;">
<option value="0"><?php echo $lang_getrss['select_and'] ?></option>
<option value="1" selected="selected"><?php echo $lang_getrss['select_or'] ?></option>
<option value="2"><?php echo $lang_getrss['select_exact'] ?></option>
</select>
<?php echo $lang_getrss['text_mode']?>
<div><?php echo $lang_getrss['text_keyword_note'] ?></div>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="<?php echo $lang_getrss['submit_generatte_rss_link']?>" />
</td>
</tr>
</table>
</form>
<?php
stdfoot();