From b20e7489d79389d8803b3788eae3f17007f05187 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Tue, 28 Mar 2023 12:28:47 +0700 Subject: [PATCH] Reworked info.php (#664) --- info.php | 60 +++++++------------------------ styles/templates/default/info.tpl | 32 +++++++++++++++++ 2 files changed, 44 insertions(+), 48 deletions(-) create mode 100644 styles/templates/default/info.tpl diff --git a/info.php b/info.php index 12a10476b..5e04a7041 100644 --- a/info.php +++ b/info.php @@ -16,9 +16,9 @@ $user->session_start(); global $lang; -$info = array(); +$info = []; $html_dir = LANG_DIR . 'html/'; -$req_mode = !empty($_REQUEST['show']) ? (string)$_REQUEST['show'] : 'not_found'; +$req_mode = (string)$_REQUEST['show']; switch ($req_mode) { case 'advert': @@ -31,59 +31,23 @@ switch ($req_mode) { $info['src'] = 'copyright_holders.html'; break; - case 'not_found': - $info['title'] = $lang['NOT_FOUND']; - $info['src'] = 'not_found.html'; - break; - case 'user_agreement': $info['title'] = $lang['USER_AGREEMENT']; $info['src'] = 'user_agreement.html'; break; default: - bb_simple_die('Invalid request'); + case 'not_found': + $info['title'] = $lang['NOT_FOUND']; + $info['src'] = 'not_found.html'; + break; } -$require = file_exists($html_dir . $info['src']) ? $html_dir . $info['src'] : $html_dir . 'not_found.html'; +$require = file_exists($html_dir . $info['src']) ? $html_dir . $info['src'] : false; -?> - - - - - - - - -
-
-
- -
- -
-
-

[ ] -

-
- - +print_page('info.tpl', 'simple'); diff --git a/styles/templates/default/info.tpl b/styles/templates/default/info.tpl new file mode 100644 index 000000000..625770c72 --- /dev/null +++ b/styles/templates/default/info.tpl @@ -0,0 +1,32 @@ + + +
+
+
+ {PAGE_TITLE} + +
{REQUIRE}
+ +
+

[ {L_LOCK} ] +

+
+