fix medal page login check

This commit is contained in:
xiaomlove
2023-01-12 03:50:39 +08:00
parent 1ff92df6d2
commit a47bc23138
2 changed files with 6 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
<?php
require "../include/bittorrent.php";
dbconn();
loggedinorreturn();
$query = \App\Models\Medal::query()->where('display_on_medal_page', 1);
$q = htmlspecialchars($_REQUEST['q'] ?? '');
if (!empty($q)) {

View File

@@ -126,7 +126,10 @@ if (!empty($_GET['sort']) && $_GET['sort'] == 'newest') {
//$query = "SELECT torrents.id, torrents.category, torrents.name, torrents.small_descr, torrents.descr, torrents.info_hash, torrents.size, torrents.added, torrents.anonymous, users.username AS username, categories.id AS cat_id, categories.name AS cat_name FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where ORDER BY $sort LIMIT $limit";
$query = "SELECT torrents.id, torrents.category, torrents.name, torrents.small_descr, torrents.descr, torrents.info_hash, torrents.size, torrents.added, torrents.anonymous, torrents.owner, categories.name AS category_name FROM torrents LEFT JOIN categories ON category = categories.id $where ORDER BY $sort LIMIT $limit";
$list = \Nexus\Database\NexusDB::select($query);
$list = apply_filter('torrent_list', $list, $startindex == 0 ? 0 : 1, null, $_GET['search'] ?? '');
if ($inclbookmarked == 0) {
$list = apply_filter('torrent_list', $list, $startindex == 0 ? 0 : 1, null, $_GET['search'] ?? '');
}
//dd($list);
$torrentRep = new \App\Repositories\TorrentRepository();
$url = get_protocol_prefix().$BASEURL;