]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
More HTML improvements
[mailer.git] / inc / functions.php
index 9bf6d0f47d418cc270b6d41fd4f82332c3ffc7c2..62aa009248af7c6c1c1b9d9140043c9aeb2ff6be 100644 (file)
@@ -150,6 +150,9 @@ function compileFinalOutput () {
        // Init counter
        $cnt = '0';
 
+       // Add page header and footer
+       addPageHeaderFooter();
+
        // Compile all out
        while (((strpos($GLOBALS['output'], '{--') > 0) || (strpos($GLOBALS['output'], '{!') > 0) || (strpos($GLOBALS['output'], '{?') > 0)) && ($cnt < 3)) {
                // Init common variables
@@ -2311,7 +2314,7 @@ function displayParsingTime() {
        );
 
        // Load the template
-       loadTemplate('show_timings', false, $content);
+       $GLOBALS['page_footer'] .= loadTemplate('show_timings', true, $content);
 }
 
 // Check wether a boolean constant is set
@@ -3928,6 +3931,42 @@ function isSpider () {
        return ((strpos($userAgent, 'spider') !== false) || (strpos($userAgent, 'slurp') !== false) || (strpos($userAgent, 'bot') !== false));
 }
 
+// Prepares the header for HTML output
+function loadHtmlHeader () {
+       // Determine the page title
+       $content['header_title'] = determinePageTitle();
+
+       // Output page header code
+       $GLOBALS['page_header'] = loadTemplate('page_header', true, $content);
+
+       // Include meta data in 'guest' module
+       if (getModule() == 'index') {
+               // Load meta data template
+               $GLOBALS['page_header'] .= loadTemplate('metadata', true);
+
+               // Add meta description to header
+               if ((isInstalled()) && (isAdminRegistered()) && (SQL_IS_LINK_UP())) {
+                       // Add meta description not in admin and login module and when the script is installed
+                       generateMetaDescriptionCode(getModule(), getWhat());
+               } // END - if
+       } // END - if
+
+       // Include more header data here
+       $GLOBALS['page_header'] .= loadTemplate('header', true);
+
+       // Include stylesheet
+       loadIncludeOnce('inc/stylesheet.php');
+
+       // Closing HEAD tag
+       $GLOBALS['page_header'] .= '</head>';
+}
+
+// Adds page header and footer to output array element
+function addPageHeaderFooter () {
+       // Add them all together. This is maybe to simple
+       $GLOBALS['output'] = $GLOBALS['page_header'] . $GLOBALS['output'] . $GLOBALS['page_footer'];
+}
+
 //////////////////////////////////////////////////
 // AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
 //////////////////////////////////////////////////