Skip to content

Commit

Permalink
Fixes #5160 Social plugin XURL updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed Dec 19, 2023
1 parent 63d3c07 commit cab361e
Show file tree
Hide file tree
Showing 75 changed files with 900 additions and 244 deletions.
19 changes: 4 additions & 15 deletions e107_plugins/social/admin_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,21 +394,10 @@ public function pagesPage()
<tbody>
";

//XXX XURL Definitions.
$xurls = array(
'facebook' => array('label'=>"Facebook", "placeholder"=>"eg. https://www.facebook.com/e107CMS"),
'twitter' => array('label'=>"Twitter", "placeholder"=>"eg. https://twitter.com/e107"),
'youtube' => array('label'=>"Youtube", "placeholder"=>"eg.https://youtube.com/e107Inc"),
'linkedin' => array('label'=>"LinkedIn", "placeholder"=>"eg. https://www.linkedin.com/groups?home=&gid=1782682"),
'github' => array('label'=>"GitHub", "placeholder"=>"eg. https://github.com/e107inc"),
'flickr' => array('label'=>"Flickr", "placeholder"=>""),
'instagram' => array('label'=>"Instagram", "placeholder"=>""),
'pinterest' => array('label'=>"Pinterest", "placeholder"=>""),
'steam' => array('label'=>"Steam", "placeholder"=>"eg. https://steamcommunity.com"),
'vimeo' => array('label'=>"Vimeo", "placeholder"=>""),
'twitch' => array('label'=>"Twitch", "placeholder"=>""),
'vk' => array('label'=>"VK (Vkontakte)", "placeholder"=>""),
);


$json = file_get_contents(__DIR__."/xurls.json");
$xurls = e107::unserialize($json);

foreach($xurls as $k=>$var)
{
Expand Down
104 changes: 0 additions & 104 deletions e107_plugins/social/css/fontello.css

This file was deleted.

2 changes: 1 addition & 1 deletion e107_plugins/social/e_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if(e_ADMIN_AREA !==true)
{

e107::css('social', 'css/fontello.css');
e107::css('social', 'style.css');
// e107::link(array('rel'=>'preload', 'href'=> "{e_PLUGIN}social/font/fontello.woff2?21917124", 'as' => "font", 'type'=>"font/woff2", 'crossorigin' => 'anonymous'));
e107::css('social' ,'css/social.css');

Expand Down
40 changes: 25 additions & 15 deletions e107_plugins/social/e_shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ class social_shortcodes extends e_shortcode



private $xurl;




public function getProviders()
{

Expand Down Expand Up @@ -61,6 +66,11 @@ public function getProviders()
*/
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';

Expand All @@ -74,20 +84,19 @@ function sc_xurl_icons($parm=null)

$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);

Expand Down Expand Up @@ -163,8 +172,9 @@ function sc_xurl_icons_class($parm=null)
/** @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))
{
Expand Down
Binary file removed e107_plugins/social/font/fontello.eot
Binary file not shown.

0 comments on commit cab361e

Please sign in to comment.