diff --git a/system/functions.php b/system/functions.php index 1dd3edf5..f6c1ea1f 100644 --- a/system/functions.php +++ b/system/functions.php @@ -517,7 +517,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()) { @@ -528,6 +533,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 4e082ccc..e667474e 100644 --- a/system/settings.php +++ b/system/settings.php @@ -258,6 +258,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',