From 3c65faf6e3b2dbb7b1d75e70c16e61c8f5cb633d Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 31 Mar 2017 14:58:22 -0700 Subject: [PATCH] Downloads: #2544 download meta tags. Apple-icon fix. --- e107_core/templates/header_default.php | 2 +- .../download/handlers/download_class.php | 24 +++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/e107_core/templates/header_default.php b/e107_core/templates/header_default.php index 43bc840f1..8e18a4002 100644 --- a/e107_core/templates/header_default.php +++ b/e107_core/templates/header_default.php @@ -227,7 +227,7 @@ if (is_array($pref['e_meta_list'])) if(isset($pref['sitebutton'])) { - $appleIcon = $tp->thumbUrl($pref['sitebutton'],'w=144&h=144&crop=1',true); + $appleIcon = $tp->thumbUrl($pref['sitebutton'],'w=144&h=144&crop=1',null, true); echo "\n"; unset($appleIcon); } diff --git a/e107_plugins/download/handlers/download_class.php b/e107_plugins/download/handlers/download_class.php index bda77d3fe..da0eb8f99 100644 --- a/e107_plugins/download/handlers/download_class.php +++ b/e107_plugins/download/handlers/download_class.php @@ -315,8 +315,26 @@ class download } + /** + * Meta for 'view' mode..to be expanded to handle list and maincats etc. + * @param array $row + * @todo modes for different actions based on $this->qry['action'] + */ + private function setMeta($row) + { + $tp = e107::getParser(); + $metaImage = $tp->thumbUrl($row['download_image'], array('w'=>500), null, true); + $metaDescription = $tp->toHtml($row['download_description'],true); + define('e_PAGETITLE', $tp->toText($row['download_name'])); + e107::meta('description', $tp->toText($metaDescription)); + e107::meta('keywords', $row['download_keywords']); + e107::meta('og:description', $tp->toText($metaDescription)); + e107::meta('og:image', $metaImage); + e107::meta('twitter:image:src', $metaImage); + + } @@ -392,8 +410,10 @@ class download $dlrow = $sql->fetch(); $sc->setVars($dlrow); - - // $comment_edit_query = 'comment.download.'.$id; + + $this->setMeta($dlrow); + + if(!defined("DL_IMAGESTYLE")) {