diff --git a/system/functions.php b/system/functions.php index 6f1d8abe..5643eab4 100644 --- a/system/functions.php +++ b/system/functions.php @@ -515,7 +515,12 @@ function template_place_holder($type): string $ret .= $debugBarRenderer->renderHead(); } } + elseif ($type === 'head_end') { + $ret .= setting('core.html_head'); + } elseif ($type === 'body_start') { + $ret .= setting('core.html_body'); + $ret .= $twig->render('browsehappy.html.twig'); if (admin()) { @@ -526,6 +531,8 @@ function template_place_holder($type): string } } elseif($type === 'body_end') { + $ret .= setting('core.html_footer'); + $ret .= template_ga_code(); if (isset($debugBar)) { $ret .= $debugBarRenderer->render(); diff --git a/system/settings.php b/system/settings.php index 46bd0f81..86a07f79 100644 --- a/system/settings.php +++ b/system/settings.php @@ -251,6 +251,28 @@ return [ 'desc' => 'Allow MyAAC to report anonymous usage statistics to developers? The data is sent only once per 30 days and is fully confidential. It won\'t affect the performance of your website', 'default' => true, ], + [ + 'type' => 'section', + 'title' => 'Custom HTML', + ], + 'html_head' => [ + 'name' => 'HTML Head', + 'type' => 'textarea', + 'desc' => escapeHtml('These scripts will be printed in the section. Can be, for example, Google Analytics code.'), + 'default' => '', + ], + 'html_body' => [ + 'name' => 'HTML Body', + 'type' => 'textarea', + 'desc' => escapeHtml('These scripts will be printed just below the opening tag.'), + 'default' => '', + ], + 'html_footer' => [ + 'name' => 'HTML Footer', + 'type' => 'textarea', + 'desc' => escapeHtml('These scripts will be printed above the closing tag.'), + 'default' => '', + ], [ 'type' => 'category', 'title' => 'Game',