require lang_functions every page

This commit is contained in:
xiaomlove
2022-06-09 01:47:33 +08:00
parent dfc857061a
commit 11d906a869
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -18,8 +18,8 @@ ini_set('date.timezone', nexus_config('nexus.timezone'));
$Cache = new class_cache_redis(); //Load the caching class $Cache = new class_cache_redis(); //Load the caching class
$Cache->setLanguageFolderArray(get_langfolder_list()); $Cache->setLanguageFolderArray(get_langfolder_list());
require $rootpath . 'include/config.php'; require $rootpath . 'include/config.php';
require $rootpath . get_langfile_path("functions.php");
if (!isRunningInConsole() && !in_array(nexus()->getScript(), ['announce', 'scrape', 'torrentrss', 'download'])) { if (!isRunningInConsole() && !in_array(nexus()->getScript(), ['announce', 'scrape', 'torrentrss', 'download'])) {
require $rootpath . get_langfile_path("functions.php");
checkGuestVisit(); checkGuestVisit();
} }
+1 -1
View File
@@ -127,7 +127,7 @@ else
$username .= $lang_shoutbox['text_to_guest']; $username .= $lang_shoutbox['text_to_guest'];
} }
else $username = $lang_shoutbox['text_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"]); $time = strftime("%m.%d %H:%M",$arr["date"]);
else $time = get_elapsed_time($arr["date"]).$lang_shoutbox['text_ago']; else $time = get_elapsed_time($arr["date"]).$lang_shoutbox['text_ago'];
print("<tr><td class=\"shoutrow\"><span class='date'>[".$time."]</span> ". print("<tr><td class=\"shoutrow\"><span class='date'>[".$time."]</span> ".
+2 -2
View File
@@ -105,7 +105,7 @@ get_where("audiocodecs", "audiocodec", "aud");
if ($where) if ($where)
$where = "WHERE ".$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"; $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(); $torrentRep = new \App\Repositories\TorrentRepository();
$url = get_protocol_prefix().$BASEURL; $url = get_protocol_prefix().$BASEURL;
$year = substr($datefounded, 0, 4); $year = substr($datefounded, 0, 4);
@@ -143,7 +143,7 @@ print('
<atom:link href="'.$url.$_SERVER['REQUEST_URI'].'" rel="self" type="application/rss+xml" />');*/ <atom:link href="'.$url.$_SERVER['REQUEST_URI'].'" rel="self" type="application/rss+xml" />');*/
print(' print('
'); ');
while ($row = mysql_fetch_array($res)) foreach ($list as $row)
{ {
$title = ""; $title = "";
if ($row['anonymous'] == 'yes') if ($row['anonymous'] == 'yes')
+1 -1
View File
@@ -1142,7 +1142,7 @@ if ($count) {
$rows[] = $row; $rows[] = $row;
} }
} }
$rows = apply_filter('torrent_list', $rows, $page, 'list'); $rows = apply_filter('torrent_list', $rows, $page, $sectiontype);
print($pagertop); print($pagertop);
if ($sectiontype == $browsecatmode) if ($sectiontype == $browsecatmode)
torrenttable($rows, "torrents"); torrenttable($rows, "torrents");