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:
parent
6db8c7ddeb
commit
4bef86fb87
@ -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;
|
||||
|
11
page.php
11
page.php
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user