From 11d906a869be0ee8bb7650a6fe99103739e896d5 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Thu, 9 Jun 2022 01:47:33 +0800 Subject: [PATCH] require lang_functions every page --- include/core.php | 2 +- public/shoutbox.php | 2 +- public/torrentrss.php | 4 ++-- public/torrents.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/core.php b/include/core.php index 4c5b0f65..ab37a53a 100644 --- a/include/core.php +++ b/include/core.php @@ -18,8 +18,8 @@ ini_set('date.timezone', nexus_config('nexus.timezone')); $Cache = new class_cache_redis(); //Load the caching class $Cache->setLanguageFolderArray(get_langfolder_list()); require $rootpath . 'include/config.php'; +require $rootpath . get_langfile_path("functions.php"); if (!isRunningInConsole() && !in_array(nexus()->getScript(), ['announce', 'scrape', 'torrentrss', 'download'])) { - require $rootpath . get_langfile_path("functions.php"); checkGuestVisit(); } diff --git a/public/shoutbox.php b/public/shoutbox.php index 43240903..3bcf0b93 100644 --- a/public/shoutbox.php +++ b/public/shoutbox.php @@ -127,7 +127,7 @@ else $username .= $lang_shoutbox['text_to_guest']; } else $username = $lang_shoutbox['text_guest']; - if ($CURUSER['timetype'] != 'timealive') + if (isset($CURUSER) && $CURUSER['timetype'] != 'timealive') $time = strftime("%m.%d %H:%M",$arr["date"]); else $time = get_elapsed_time($arr["date"]).$lang_shoutbox['text_ago']; print("[".$time."] ". diff --git a/public/torrentrss.php b/public/torrentrss.php index 957f89f9..dd837404 100644 --- a/public/torrentrss.php +++ b/public/torrentrss.php @@ -105,7 +105,7 @@ get_where("audiocodecs", "audiocodec", "aud"); if ($where) $where = "WHERE ".$where; $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 torrents.added DESC LIMIT $limit"; -$res = sql_query($query); +$list = \Nexus\Database\NexusDB::select($query); $torrentRep = new \App\Repositories\TorrentRepository(); $url = get_protocol_prefix().$BASEURL; $year = substr($datefounded, 0, 4); @@ -143,7 +143,7 @@ print(' ');*/ print(' '); -while ($row = mysql_fetch_array($res)) +foreach ($list as $row) { $title = ""; if ($row['anonymous'] == 'yes') diff --git a/public/torrents.php b/public/torrents.php index 0856b701..df650f3a 100644 --- a/public/torrents.php +++ b/public/torrents.php @@ -1142,7 +1142,7 @@ if ($count) { $rows[] = $row; } } - $rows = apply_filter('torrent_list', $rows, $page, 'list'); + $rows = apply_filter('torrent_list', $rows, $page, $sectiontype); print($pagertop); if ($sectiontype == $browsecatmode) torrenttable($rows, "torrents");