/
info.php
50 lines (39 loc) · 1.34 KB
/
info.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* TorrentPier – Bull-powered BitTorrent tracker engine
*
* @copyright Copyright (c) 2005-2024 TorrentPier (https://torrentpier.com)
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
*/
define('BB_SCRIPT', 'info');
require __DIR__ . '/common.php';
// Start session management
$user->session_start();
$info = [];
$htmlDir = LANG_DIR . 'html/';
switch ((string)$_REQUEST['show'] ?? 'not_found') {
case 'advert':
$info['title'] = $lang['ADVERT'];
$info['src'] = 'advert.html';
break;
case 'copyright_holders':
$info['title'] = $lang['COPYRIGHT_HOLDERS'];
$info['src'] = 'copyright_holders.html';
break;
case 'user_agreement':
$info['title'] = $lang['USER_AGREEMENT'];
$info['src'] = 'user_agreement.html';
break;
default:
case 'not_found':
$info['title'] = $lang['NOT_FOUND'];
$info['src'] = 'not_found.html';
break;
}
$require = is_file($htmlDir . $info['src']) ? ($htmlDir . $info['src']) : false;
$template->assign_vars([
'PAGE_TITLE' => mb_strtoupper($info['title'], 'UTF-8'),
'REQUIRE' => $require ? file_get_contents($require) : $lang['NOT_FOUND'],
]);
print_page('info.tpl', 'simple');