From 80fbb2a334056fa98bcf84a18699d81d58d852d9 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 31 Mar 2017 15:49:33 -0700 Subject: [PATCH] Meta-Tags: Issue #2544 - avoid duplication. --- e107_core/templates/header_default.php | 18 ++++++++++-------- .../download/handlers/download_class.php | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/e107_core/templates/header_default.php b/e107_core/templates/header_default.php index 8e18a4002..fce88dd3c 100644 --- a/e107_core/templates/header_default.php +++ b/e107_core/templates/header_default.php @@ -168,10 +168,6 @@ echo e107::getUrl()->response()->renderMeta()."\n"; // render all the e107::meta echo "".(defined('e_PAGETITLE') ? e_PAGETITLE.' - ' : (defined('PAGE_NAME') ? PAGE_NAME.' - ' : "")).SITENAME."\n\n"; - - - - // // D: Register CSS // @@ -465,7 +461,7 @@ if(function_exists('theme_head')) echo theme_head(); } -// FIXME description and keywords meta tags shouldn't be sent on all pages +/* @deprecated */ $diz_merge = (defined("META_MERGE") && META_MERGE != FALSE && $pref['meta_description'][e_LANGUAGE]) ? $pref['meta_description'][e_LANGUAGE]." " : ""; $key_merge = (defined("META_MERGE") && META_MERGE != FALSE && $pref['meta_keywords'][e_LANGUAGE]) ? $pref['meta_keywords'][e_LANGUAGE]."," : ""; @@ -493,9 +489,15 @@ function render_meta($type) } } -echo (defined("META_DESCRIPTION")) ? "\n\n" : render_meta('description'); -echo (defined("META_KEYWORDS")) ? "\n\n" : render_meta('keywords'); - +// legay meta-tag checks. +if(empty(e107::getUrl()->response()->getMetaKeywords())) +{ + echo (defined("META_KEYWORDS")) ? "\n\n" : render_meta('keywords'); +} +if(empty(e107::getUrl()->response()->getMetaDescription())) +{ + echo (defined("META_DESCRIPTION")) ? "\n\n" : render_meta('description'); +} //echo render_meta('copyright'); //echo render_meta('author'); diff --git a/e107_plugins/download/handlers/download_class.php b/e107_plugins/download/handlers/download_class.php index 0eae0bf11..465791ad1 100644 --- a/e107_plugins/download/handlers/download_class.php +++ b/e107_plugins/download/handlers/download_class.php @@ -415,6 +415,7 @@ class download $sc->setVars($dlrow); $this->setMeta($dlrow); + if(!isset($DL_VIEW_PAGETITLE)) { $DL_VIEW_PAGETITLE = "{DOWNLOAD_VIEW_NAME} / {DOWNLOAD_CATEGORY} / ".LAN_PLUGIN_DOWNLOAD_NAME;