generateMetaDescriptionCode() has now no longer parameters
[mailer.git] / inc / functions.php
index 62aa009248af7c6c1c1b9d9140043c9aeb2ff6be..b61e863c5c92b49555f5040b6d994438084ab582 100644 (file)
@@ -3947,7 +3947,7 @@ function loadHtmlHeader () {
                // 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());
+                       generateMetaDescriptionCode();
                } // END - if
        } // END - if
 
@@ -3967,6 +3967,21 @@ function addPageHeaderFooter () {
        $GLOBALS['output'] = $GLOBALS['page_header'] . $GLOBALS['output'] . $GLOBALS['page_footer'];
 }
 
+// Generates meta description for current module and 'what' value
+function generateMetaDescriptionCode () {
+       // Only include from guest area
+       if (getModule() == 'index') {
+               // Construct dynamic description
+               $DESCR = '{?MAIN_TITLE?} '.trim(getConfig('title_middle')) . ' ' . getTitleFromMenu('guest', getWhat());
+
+               // Output it directly
+               $GLOBALS['page_header'] .= '<meta name="description" content="' . $DESCR . '" />';
+       } // END - if
+
+       // Remove depth
+       unset($GLOBALS['ref_level']);
+}
+
 //////////////////////////////////////////////////
 // AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
 //////////////////////////////////////////////////