1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Include associated menu image in page meta.

This commit is contained in:
Cameron 2015-11-22 13:04:21 -08:00
parent 6db8c7ddeb
commit 4bef86fb87
2 changed files with 16 additions and 1 deletions

View File

@ -3258,6 +3258,12 @@ class e_parser
*/
function isImage($file)
{
if(substr($file,0,3)=="{e_")
{
$file = e107::getParser()->replaceConstants($file);
}
$ext = pathinfo($file,PATHINFO_EXTENSION);
return ($ext == 'jpg' || $ext == 'png' || $ext == 'gif' || $ext == 'jpeg') ? true : false;

View File

@ -645,7 +645,16 @@ class pageClass
define('e_PAGETITLE', eHelper::formatMetaTitle($this->page['page_title']));
if($this->page['page_metadscr']) define('META_DESCRIPTION', eHelper::formatMetaDescription($this->page['page_metadscr']));
if($this->page['page_metakeys']) define('META_KEYWORDS', eHelper::formatMetaKeys($this->page['page_metakeys']));
//return $ret;
$tp = e107::getParser();
if($tp->isImage($this->page['menu_image']))
{
$mimg = $tp->thumbUrl($this->page['menu_image'],'w=800', false, true);
e107::meta('og:image',$mimg);
}
//return $ret;
}
public function checkCache()