paid torrent

This commit is contained in:
xiaomlove
2023-02-11 16:08:48 +08:00
parent 43b35b4e77
commit 3c64e76011
50 changed files with 556 additions and 87 deletions
+11
View File
@@ -97,6 +97,17 @@ $onlyBrowseSection = get_setting('main.spsct') != 'yes' || !user_can('view_speci
if ($onlyBrowseSection) {
$where .= ($where ? " AND " : "") . "categories.mode = $browseMode";
}
//check price
if (isset($_GET['paid']) && in_array($_GET['paid'], ['0', '1', '2'], true)) {
$paidFilter = $_GET['paid'];
} else {
$paidFilter = '0';
}
if ($paidFilter === '0') {
$where .= ($where ? " AND " : "") . "torrents.price = 0";
} elseif ($paidFilter === '1') {
$where .= ($where ? " AND " : "") . "torrents.price > 0";
}
function get_where($tablename = "sources", $itemname = "source", $getname = "sou")
{