diff --git a/index.php b/index.php index bf7069d4..ee8f7a87 100644 --- a/index.php +++ b/index.php @@ -162,15 +162,6 @@ if(setting('core.anonymous_usage_statistics')) { } } -/** - * @var OTS_Account $account_logged - */ -if ($logged && admin()) { - $content .= $twig->render('admin-bar.html.twig', [ - 'username' => USE_ACCOUNT_NAME ? $account_logged->getName() : $account_logged->getId() - ]); -} - $title_full = (isset($title) ? $title . ' - ' : '') . $config['lua']['serverName']; require $template_path . '/' . $template_index; diff --git a/system/functions.php b/system/functions.php index 540c9af3..7f54e69f 100644 --- a/system/functions.php +++ b/system/functions.php @@ -512,6 +512,16 @@ function template_place_holder($type): string } elseif ($type === 'body_start') { $ret .= $twig->render('browsehappy.html.twig'); + + /** + * @var OTS_Account $account_logged + */ + if (admin()) { + global $account_logged; + $ret .= $twig->render('admin-bar.html.twig', [ + 'username' => USE_ACCOUNT_NAME ? $account_logged->getName() : $account_logged->getId() + ]); + } } elseif($type === 'body_end') { $ret .= template_ga_code();