mirror of
https://github.com/e107inc/e107.git
synced 2025-04-22 13:41:52 +02:00
News tags/keyword are now included in the twitter share link.
This commit is contained in:
parent
0c9350a3cc
commit
8b49ee7ba6
@ -360,6 +360,18 @@ class news {
|
||||
setScVar('news_shortcodes', 'news_item', $news);
|
||||
setScVar('news_shortcodes', 'param', $param);
|
||||
*/
|
||||
|
||||
// Set the Values for the social shortcode usage.
|
||||
$tp = e107::getParser();
|
||||
$socialArray = array('url'=>e107::getUrl()->create('news/view/item', $news, 'full=1'), 'title'=>$tp->toText($news['news_title']), 'tags'=>$news['news_meta_keywords']);
|
||||
$socialObj = e107::getScBatch('social');
|
||||
|
||||
if(is_object($socialObj))
|
||||
{
|
||||
$socialObj->setVars($socialArray);
|
||||
}
|
||||
|
||||
|
||||
// Retrieve batch sc object, set required vars
|
||||
$sc = e107::getScBatch('news')
|
||||
->setScVar('news_item', $news)
|
||||
|
@ -167,6 +167,7 @@ class social_shortcodes extends e_shortcode
|
||||
$defaultUrl = vartrue($this->var['url'], e_REQUEST_URL);
|
||||
$defaultTitle = vartrue($this->var['title'], deftrue('e_PAGETITLE'). " | ". SITENAME);
|
||||
$defaultDiz = vartrue($this->var['description'], e107::getUrl()->response()->getMetaDescription());
|
||||
$defaultTags = vartrue($this->var['tags'],'');
|
||||
|
||||
$tp = e107::getParser();
|
||||
|
||||
@ -190,11 +191,12 @@ class social_shortcodes extends e_shortcode
|
||||
$url = varset($parm['url'], $defaultUrl);
|
||||
$title = varset($parm['title'], $defaultTitle) ;
|
||||
$description = varset($parm['title'], $defaultDiz);
|
||||
$tags = varset($parm['tags'], $defaultTags);
|
||||
$media = "";
|
||||
$label = varset($parm['label'], $tp->toGlyph('e-social-spread'));
|
||||
|
||||
$size = varset($parm['size'], 'md');
|
||||
$tags = varset($parm['tags'], '');
|
||||
|
||||
|
||||
|
||||
|
||||
|
5
news.php
5
news.php
@ -831,15 +831,14 @@ else
|
||||
$news = $newsAr[$i];
|
||||
|
||||
// Set the Values for the social shortcode usage.
|
||||
$socialArray = array('url'=>e107::getUrl()->create('news/view/item', $news, 'full=1'), 'title'=>$tp->toText($news['news_title']));
|
||||
$socialArray = array('url'=>e107::getUrl()->create('news/view/item', $news, 'full=1'), 'title'=>$tp->toText($news['news_title']), 'tags'=>$news['news_meta_keywords']);
|
||||
$socialObj = e107::getScBatch('social');
|
||||
|
||||
if(is_object($socialObj))
|
||||
{
|
||||
$socialObj->setVars($socialArray);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(function_exists("news_style")) // BC
|
||||
{
|
||||
$template = news_style($news, $action, $param);
|
||||
|
Loading…
x
Reference in New Issue
Block a user