From ef985b19b939dad4349aca278f31722ed65b6bbb Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 25 Jan 2016 18:13:54 -0800 Subject: [PATCH] Meta News Images: use thumbnails. --- news.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/news.php b/news.php index fe8ea867c..a9bc7dc79 100644 --- a/news.php +++ b/news.php @@ -278,7 +278,7 @@ if ($action == 'cat' || $action == 'all' || vartrue($_GET['tag'])) { if(!empty($row['news_thumbnail'])) { - $iurl = (substr($row['news_thumbnail'],0,3)=="{e_") ? $tp->replaceConstants($row['news_thumbnail'],'full') : SITEURL.e_IMAGE."newspost_images/".$news['news_thumbnail']; + $iurl = (substr($row['news_thumbnail'],0,3)=="{e_") ? $row['news_thumbnail'] : SITEURL.e_IMAGE."newspost_images/".$news['news_thumbnail']; $tmp = explode(",", $iurl); if($tp->isImage($tmp[0])) @@ -288,7 +288,7 @@ if ($action == 'cat' || $action == 'all' || vartrue($_GET['tag'])) break; } - e107::meta('og:image',$tmp[0]); + e107::meta('og:image',$tp->thumbUrl($tmp[0],'w=500',false,true) ); $ogImageCount++; } @@ -1141,7 +1141,7 @@ function setNewsFrontMeta($news, $type='news') // include news-thumbnail/image in meta. if($news['news_thumbnail']) { - $iurl = (substr($news['news_thumbnail'],0,3)=="{e_") ? $tp->replaceConstants($news['news_thumbnail'],'full') : SITEURL.e_IMAGE."newspost_images/".$news['news_thumbnail']; + $iurl = (substr($news['news_thumbnail'],0,3)=="{e_") ? $news['news_thumbnail'] : SITEURL.e_IMAGE."newspost_images/".$news['news_thumbnail']; $tmp = explode(",", $iurl); foreach($tmp as $mimg) { @@ -1149,8 +1149,8 @@ function setNewsFrontMeta($news, $type='news') { continue; } - - e107::meta('og:image',$mimg); + e107::meta('og:image',$tp->thumbUrl($tmp[0],'w=500',false,true) ); + // e107::meta('og:image',$mimg); } }