1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-16 11:36:08 +02:00

Fixes #5160 Social plugin XURL updates.

This commit is contained in:
camer0n
2023-12-19 15:18:23 -08:00
parent 63d3c075c3
commit cab361e76c
75 changed files with 900 additions and 244 deletions

View File

@@ -18,6 +18,11 @@ class social_shortcodes extends e_shortcode
private $xurl;
public function getProviders()
{
@@ -61,6 +66,11 @@ class social_shortcodes extends e_shortcode
*/
function sc_xurl_icons($parm=null)
{
if(empty($this->xurl))
{
$this->xurl = e107::pref('core','xurl');
}
$tp = e107::getParser();
$tmpl = !empty($parm['template']) ? $parm['template'] : 'default';
@@ -74,20 +84,19 @@ class social_shortcodes extends e_shortcode
$social = array(
'rss' => array('href'=> (e107::isInstalled('rss_menu') ? e107::url('rss_menu', 'index', array('rss_url'=>'news')) : ''), 'title'=>'RSS/Atom Feed'),
'facebook' => array('href'=> deftrue('XURL_FACEBOOK'), 'title'=>'Facebook'),
'twitter' => array('href'=> deftrue('XURL_TWITTER'), 'title'=>'Twitter'),
// 'google-plus' => array('href'=> deftrue('XURL_GOOGLE'), 'title'=>'Google Plus'),
'linkedin' => array('href'=> deftrue('XURL_LINKEDIN'), 'title'=>'LinkedIn'),
'github' => array('href'=> deftrue('XURL_GITHUB'), 'title'=>'Github'),
'pinterest' => array('href'=> deftrue('XURL_PINTEREST'), 'title'=>'Pinterest'),
'flickr' => array('href'=> deftrue('XURL_FLICKR'), 'title'=>'Flickr'),
'instagram' => array('href'=> deftrue('XURL_INSTAGRAM'), 'title'=>'Instagram'),
'youtube' => array('href'=> deftrue('XURL_YOUTUBE'), 'title'=>'YouTube'),
'steam' => array('href'=> deftrue('XURL_STEAM'), 'title'=>'Steam'),
'vimeo' => array('href'=> deftrue('XURL_VIMEO'), 'title'=>'Vimeo'),
'twitch' => array('href'=> deftrue('XURL_TWITCH'), 'title'=>'Twitch'),
'vk' => array('href'=> deftrue('XURL_VK'), 'title'=>'VK (Vkontakte)')
);
$json = file_get_contents(__DIR__."/xurls.json");
$xurls = e107::unserialize($json);
foreach($xurls as $k=>$val)
{
if(!empty($this->xurl[$k]))
{
$social[$k] = ['href'=> $this->xurl[$k], 'title'=>$val['label'] ];
}
}
// print_a($social);
@@ -163,8 +172,9 @@ class social_shortcodes extends e_shortcode
/** @experimental inline svg - subject to removal at any time */
public function sc_xurl_icons_svg($parm=null)
{
$path = e_WEB.'lib/font-awesome/5/svgs/brands/';
$path .= $this->var['id'].".svg";
// $path = e_WEB.'lib/font-awesome/'.$this->fontawesome.'/svgs/brands/';
$path = e_PLUGIN."social/svg/".$this->var['id'].".svg";
if(!file_exists($path))
{