1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-20 04:32:01 +02:00

More Meta-work

This commit is contained in:
CaMer0n 2012-05-11 10:17:20 +00:00
parent c8a7e242e9
commit b7d3bf7660
2 changed files with 19 additions and 18 deletions

View File

@ -103,11 +103,12 @@ echo "<head>
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
<meta http-equiv='content-style-type' content='text/css' />
";
echo (defined("CORE_LC")) ? "<meta http-equiv='content-language' content='".CORE_LC."' />\n" : "";
echo e107::getUrl()->response()->renderMeta();
echo "<title>".(defined('e_PAGETITLE') ? e_PAGETITLE.' - ' : (defined('PAGE_NAME') ? PAGE_NAME.' - ' : "")).SITENAME."</title>\n\n";
@ -127,6 +128,7 @@ else
$e_js = e107::getJs();
$e_pref = e107::getConfig('core');
// Other Meta tags.
// Register Core CSS first, TODO - convert $no_core_css to constant, awaiting for path changes
@ -156,7 +158,6 @@ unset($e_headers);
$e_js = e107::getJs();
$e_pref = e107::getConfig('core');
e107::getJS()->renderJs('core_meta',false);
// --- Load plugin Meta files - now possible to add to all zones! --------
$e_meta_content = '';

View File

@ -892,32 +892,32 @@ function setNewsFrontMeta($news, $type='news')
{
$tp = e107::getParser();
if($type == 'news')
{
if($news['news_title'] && !defined('e_PAGETITLE'))
{
define('e_PAGETITLE', $news['news_title']);
e107::getJS()->coreMeta('og:title',$news['news_title']);
e107::getJS()->coreMeta('og:type','article');
e107::meta('og:title',$news['news_title']);
e107::meta('og:type','article');
}
if($news['news_meta_description'] && !defined('META_DESCRIPTION'))
{
e107::getJS()->coreMeta('description',$news['news_meta_description']);
e107::getJS()->coreMeta('og:description',$news['news_meta_description']);
e107::meta('description',$news['news_meta_description']);
e107::meta('og:description',$news['news_meta_description']);
//define('META_DESCRIPTION', $news['news_meta_description']); // deprecated
}
elseif($news['news_summary']) // BC compatibility
{
e107::getJS()->coreMeta('og:description',$news['news_summary']);
e107::meta('og:description',$news['news_summary']);
}
// grab all images in news-body and add to meta.
$images = e107::getBB()->getContent('img',$news['news_body'],SITEURL.e_IMAGE."newspost_images/");
foreach($images as $im)
{
e107::getJS()->coreMeta('og:image',$im);
e107::meta('og:image',$im);
}
// grab all youtube videos in news-body and add thumbnails to meta.
@ -925,28 +925,28 @@ function setNewsFrontMeta($news, $type='news')
foreach($youtube as $yt)
{
list($img,$tmp) = explode("?",$yt);
e107::getJS()->coreMeta('og:image',"http://img.youtube.com/vi/".$img."/0.jpg");
e107::meta('og:image',"http://img.youtube.com/vi/".$img."/0.jpg");
}
// 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'];
e107::getJS()->coreMeta('og:image',$iurl);
e107::meta('og:image',$iurl);
}
$url = e107::getUrl()->create('news/view/item', $news,'full=1');
e107::getJS()->coreMeta('og:url',$url);
e107::meta('og:url',$url);
e107::getJS()->coreMeta('article:section',$news['category_name']);
e107::meta('article:section',$news['category_name']);
if($news['news_meta_keywords'] && !defined('META_KEYWORDS'))
{
e107::getJS()->coreMeta('keywords',$news['news_meta_keywords']);
e107::meta('keywords',$news['news_meta_keywords']);
$tmp = explode(",",$news['news_meta_keywords']);
foreach($tmp as $t)
{
e107::getJS()->coreMeta('article:tag',$t);
e107::meta('article:tag',$t);
}
// define('META_KEYWORDS', $news['news_meta_keywords']); // deprecated