mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
FAQ tags are now included in the twitter share url.
This commit is contained in:
@@ -91,7 +91,7 @@ class faqs_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
if($this->share == true)
|
if($this->share == true)
|
||||||
{
|
{
|
||||||
$text .= "<div class='faq-share'>".$tp->parseTemplate("{SOCIALSHARE: size=xs&type=basic&url=".$url."&title=".$question."}",true)."</div>";
|
$text .= "<div class='faq-share'>".$tp->parseTemplate("{SOCIALSHARE: size=xs&type=basic&url=".$url."&title=".$question."&tags=".$this->var['faq_tags']."}",true)."</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= "</div></div>
|
$text .= "</div></div>
|
||||||
|
@@ -118,6 +118,30 @@ class social_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function getHashtags($extraTags='')
|
||||||
|
{
|
||||||
|
$hashtags = e107::pref('social','sharing_hashtags','');
|
||||||
|
|
||||||
|
$hashtags = str_replace(array(" ",'#'),"", $hashtags);
|
||||||
|
|
||||||
|
$ret = explode(',',$hashtags);
|
||||||
|
|
||||||
|
if(!empty($extraTags))
|
||||||
|
{
|
||||||
|
$extraTags = str_replace(array(" ",'#'),"", $extraTags);
|
||||||
|
$tmp = explode(',',$extraTags);
|
||||||
|
foreach($tmp as $v)
|
||||||
|
{
|
||||||
|
$ret[] = $v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!empty($ret))
|
||||||
|
{
|
||||||
|
return implode(',',$ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -138,7 +162,7 @@ class social_shortcodes extends e_shortcode
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$hashtags = vartrue($pref['sharing_hashtags']);
|
// $hashtags = vartrue($pref['sharing_hashtags']);
|
||||||
|
|
||||||
$defaultUrl = vartrue($this->var['url'], e_REQUEST_URL);
|
$defaultUrl = vartrue($this->var['url'], e_REQUEST_URL);
|
||||||
$defaultTitle = vartrue($this->var['title'], deftrue('e_PAGETITLE'). " | ". SITENAME);
|
$defaultTitle = vartrue($this->var['title'], deftrue('e_PAGETITLE'). " | ". SITENAME);
|
||||||
@@ -170,6 +194,7 @@ class social_shortcodes extends e_shortcode
|
|||||||
$label = varset($parm['label'], $tp->toGlyph('e-social-spread'));
|
$label = varset($parm['label'], $tp->toGlyph('e-social-spread'));
|
||||||
|
|
||||||
$size = varset($parm['size'], 'md');
|
$size = varset($parm['size'], 'md');
|
||||||
|
$tags = varset($parm['tags'], '');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -190,9 +215,14 @@ class social_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
$opt = array();
|
$opt = array();
|
||||||
|
|
||||||
|
// $hashtags = '';
|
||||||
|
|
||||||
|
// $hashtags .= str_replace(array(" ",'#'),"", $hashtags); // "#mytweet";
|
||||||
|
|
||||||
|
$hashtags = $this->getHashtags($tags);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$hashtags = str_replace(array(" ",'#'),"", $hashtags); // "#mytweet";
|
|
||||||
$twitterAccount = basename(XURL_TWITTER);
|
$twitterAccount = basename(XURL_TWITTER);
|
||||||
|
|
||||||
// return print_a($hashtags,true);
|
// return print_a($hashtags,true);
|
||||||
|
Reference in New Issue
Block a user