torrentpier/info.php
Roman Kelesidis e5aaaf4abd
Use DEFAULT_CHARSET constant instead of hardcoded string (#1734)
* Use `DEFAULT_CHARSET` constant instead of hardcoded string

* Update CHANGELOG.md

* Update defines.php

* Update info.php

* Updated

* Update page_header.tpl

* Update index.tpl

* Update index.tpl
2025-01-05 00:57:20 +07:00

51 lines
1.3 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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'], DEFAULT_CHARSET),
'REQUIRE' => $require ? file_get_contents($require) : $lang['NOT_FOUND'],
]);
print_page('info.tpl', 'simple');