forked from NamelessMC/Nameless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaintenance.php
52 lines (43 loc) · 1.41 KB
/
maintenance.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
51
52
<?php
/*
* Made by Samerton
* https://github.com/NamelessMC/Nameless/
* NamelessMC version 2.0.0-pr8
*
* License: MIT
*
* Maintenance Mode page
*/
$pages = new Pages();
define('PAGE', 'maintenance');
$page_title = $language->get('errors', 'maintenance_title');
require_once(ROOT_PATH . '/core/templates/frontend_init.php');
if (!$user->isLoggedIn()) {
$smarty->assign(
array(
'LOGIN' => $language->get('general', 'sign_in'),
'LOGIN_LINK' => URL::build('/login')
)
);
}
// Assign Smarty variables
$smarty->assign(
array(
'MAINTENANCE_TITLE' => $language->get('errors', 'maintenance_title'),
'RETRY' => $language->get('errors', 'maintenance_retry')
)
);
// Retrieve maintenance message
$maintenance_message = $maintenance['message'];
if (!empty($maintenance_message)) {
$smarty->assign('MAINTENANCE_MESSAGE', Output::getPurified(htmlspecialchars_decode($maintenance_message)));
} else {
$smarty->assign('MAINTENANCE_MESSAGE', 'Maintenance mode is enabled.');
}
// Load modules + template
Module::loadPage($user, $pages, $cache, $smarty, array($navigation, $cc_nav, $mod_nav), $widgets);
$page_load = microtime(true) - $start;
define('PAGE_LOAD_TIME', str_replace('{x}', round($page_load, 3), $language->get('general', 'page_loaded_in')));
$template->onPageLoad();
// Display template
$template->displayTemplate('maintenance.tpl', $smarty);