From 79e8f834d92015ca05d71d2e2056d2eeb141a6c0 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 30 Aug 2019 19:07:32 -0700 Subject: [PATCH] SEO --- e107_handlers/application.php | 2 +- print.php | 50 ++++------------------------------- 2 files changed, 6 insertions(+), 46 deletions(-) diff --git a/e107_handlers/application.php b/e107_handlers/application.php index fa0bef2a5..452cbf719 100644 --- a/e107_handlers/application.php +++ b/e107_handlers/application.php @@ -3958,7 +3958,7 @@ class eResponse protected $_META_KEYWORDS = array(); protected $_render_mod = array('default' => 'default'); protected $_meta_title_separator = ' - '; - protected $_meta_name_only = array('keywords', 'viewport'); // Keep FB happy. + protected $_meta_name_only = array('keywords', 'viewport', 'robots'); // Keep FB happy. protected $_meta_property_only = array('article:section', 'article:tag'); // Keep FB happy. protected $_meta = array(); protected $_title_separator = ' » '; diff --git a/print.php b/print.php index 4ed72b0c5..39ec96e0b 100644 --- a/print.php +++ b/print.php @@ -75,54 +75,9 @@ else /** @var e_news_item $nws */ $nws = e107::getObject('e_news_item'); $row = $nws->load($parms)->toArray(); -/* - $query = "SELECT n.*, c.*, u.user_id, u.user_name FROM `#news` AS n LEFT JOIN `#news_category` AS c ON n.news_category = c.category_id LEFT JOIN `#user` AS u ON n.news_author = u.user_id WHERE n.news_id = " . intval($parms); - //$sql->db_Select("news", "*", "news_id='{$parms}'"); - $sql = e107::getDb(); - $sql->gen($query); - $row = $sql->fetch(); - */ $newsUrl = e107::getUrl()->create('news/view/item', $row, 'full=1'); - - -// extract($row); -// define("e_PAGETITLE", $news_title); - //$news_body = $tp->toHTML($news_body, TRUE, 'BODY'); - - /* - $news_extended = $tp->toHTML($news_extended, TRUE, 'BODY'); - if ($news_author == 0) - { - $a_name = "e107"; - $category_name = "e107 welcome message"; - } - else - { - $sql->db_Select("news_category", "category_id, category_name", "category_id='{$news_category}'"); - list($category_id, $category_name) = $sql->db_Fetch('num'); - $sql->db_Select("user", "user_id, user_name", "user_id='{$news_author}'"); - list($a_id, $a_name) = $sql->db_Fetch('num'); - } - $news_datestamp = $con->convert_date($news_datestamp, "long"); - $print_text = " -

".LAN_PRINT_135.$news_title."

-
- (".LAN_CATEGORY." ".$tp->toHTML($category_name,FALSE,"defs").") -
- ".LAN_POSTED_BY." ".$a_name."
- ".$news_datestamp." -

". - $news_body; - - if (!empty($news_extended)){ $print_text .= "

".$news_extended; } - - if (!empty($news_extended)){ $print_text .= "

".$news_extended; } - if (!empty($news_source)){ $print_text .= "

".$news_source; } - if (!empty($news_url)){ $print_text .= "
".$news_url; } -*/ - $tmp = e107::getTemplate('news', 'news', 'view'); if(empty($tmp)) @@ -131,6 +86,10 @@ else $tmp = e107::getTemplate('news', 'news_view', $newsViewTemplate); } + $title = $tp->toText($row['news_title']); + define('e_PAGETITLE', '[print] '. $title); + e107::meta('robots', 'noindex'); + $template = $tmp['item']; unset($tmp); // ob_start(); @@ -163,6 +122,7 @@ require_once(HEADERF); //temporary solution - object of future cahges if(is_readable(THEME.'print_template.php')) { + $PRINT_TEMPLATE = ''; include_once(THEME.'print_template.php'); echo $tp->parseTemplate($PRINT_TEMPLATE); }