fix maintain class + facebook url

git-svn-id: http://piwigo.org/svn/extensions/SocialButtons@29781 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
mistic100
2014-09-25 16:52:23 +00:00
parent dc10fc84c0
commit ed7aaf8b8f
10 changed files with 13 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
<?php
if (!defined('SOCIALBUTT_PATH')) die('Hacking attempt!');
defined('SOCIALBUTT_PATH') or die('Hacking attempt!');
global $conf, $template, $page;

View File

@@ -43,5 +43,3 @@ function socialbutt_facebook($basename, $root_url, &$tpl_vars, &$buttons)
$template->set_filename('facebook_button', realpath(SOCIALBUTT_PATH .'template/facebook.tpl'));
$buttons[] = 'facebook_button';
}
?>

View File

@@ -44,5 +44,3 @@ function socialbutt_google($basename, $root_url, &$tpl_vars, &$buttons)
$template->set_filename('google_button', realpath(SOCIALBUTT_PATH .'template/google.tpl'));
$buttons[] = 'google_button';
}
?>

View File

@@ -38,5 +38,3 @@ function socialbutt_linkedin($basename, $root_url, &$tpl_vars, &$buttons)
$template->set_filename('linkedin_button', realpath(SOCIALBUTT_PATH .'template/linkedin.tpl'));
$buttons[] = 'linkedin_button';
}
?>

View File

@@ -17,5 +17,3 @@ function socialbutt_pinterest($basename, $root_url, &$tpl_vars, &$buttons)
$template->set_filename('pinterest_button', realpath(SOCIALBUTT_PATH .'template/pinterest.tpl'));
$buttons[] = 'pinterest_button';
}
?>

View File

@@ -41,5 +41,3 @@ function socialbutt_reddit($basename, $root_url, &$tpl_vars, &$buttons)
$template->set_filename('reddit_button', realpath(SOCIALBUTT_PATH .'template/reddit.tpl'));
$buttons[] = 'reddit_button';
}
?>

View File

@@ -11,5 +11,3 @@ function socialbutt_tumblr($basename, $root_url, &$tpl_vars, &$buttons)
$template->set_filename('tumblr_button', realpath(SOCIALBUTT_PATH .'template/tumblr.tpl'));
$buttons[] = 'tumblr_button';
}
?>

View File

@@ -32,5 +32,3 @@ function socialbutt_twitter($basename, $root_url, &$tpl_vars, &$buttons)
$template->set_filename('twitter_button', realpath(SOCIALBUTT_PATH .'template/twitter.tpl'));
$buttons[] = 'twitter_button';
}
?>

View File

@@ -45,6 +45,8 @@ class SocialButtons_maintain extends PluginMaintain
function install($plugin_version, &$errors=array())
{
global $conf;
if (empty($conf['SocialButtons']))
{
if (isset($conf['TumblrShare']))
@@ -66,13 +68,13 @@ class SocialButtons_maintain extends PluginMaintain
if (!empty($temp['size'])) $this->default_config['google']['size'] = $temp['size'];
if (!empty($temp['annotation'])) $this->default_config['google']['annotation'] = $temp['annotation'];
}
conf_update_param('SocialButtons', $this->default_config, true);
}
else
{
$new_conf = safe_unserialize($conf['SocialButtons']);
if (empty($new_conf['pinterest']))
{
$new_conf['pinterest'] = array(
@@ -80,7 +82,7 @@ class SocialButtons_maintain extends PluginMaintain
'layout' => 'horizontal',
);
}
if (empty($new_conf['reddit']))
{
$new_conf['reddit'] = array(
@@ -89,7 +91,7 @@ class SocialButtons_maintain extends PluginMaintain
'community' => null,
);
}
if (empty($new_conf['linkedin']))
{
$new_conf['linkedin'] = array(
@@ -97,28 +99,28 @@ class SocialButtons_maintain extends PluginMaintain
'counter' => 'right',
);
}
if (!isset($new_conf['on_index']))
{
$new_conf['on_index'] = true;
}
if ($new_conf['facebook']['layout'] == 'none')
{
$new_conf['facebook']['layout'] = 'button_count';
}
if (!isset($new_conf['light']))
{
$new_conf['light'] = false;
}
if (!isset($new_conf['img_size']))
{
$new_conf['img_size'] = isset($new_conf['tumblr']['img_size']) ? $new_conf['tumblr']['img_size'] : 'Original';
unset($new_conf['tumblr']['img_size'], $new_conf['pinterest']['img_size']);
}
conf_update_param('SocialButtons', $new_conf, true);
}
}

View File

@@ -1,11 +1,6 @@
{strip}
{if $SOCIALBUTT.light}
<a title="Share on Facebook" href="http://www.facebook.com/sharer.php?s=100&p[url]={$SOCIALBUTT.share_url|urlencode}&p[title]={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}
{if $SOCIALBUTT.basename=='picture'}
&p[summary]={$COMMENT_IMG|cat:$SOCIALBUTT.copyright|urlencode}&p[images][0]={$SOCIALBUTT.source|urlencode}"
{else}
&p[summary]={$CONTENT_DESCRIPTION|cat:$SOCIALBUTT.copyright|urlencode}"
{/if}
<a title="Share on Facebook" href="http://www.facebook.com/sharer.php?s=100&p[url]={$SOCIALBUTT.share_url|urlencode}&p[title]={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}{if $SOCIALBUTT.basename=='picture'}&p[summary]={$COMMENT_IMG|cat:$SOCIALBUTT.copyright|urlencode}&p[images][0]={$SOCIALBUTT.source|urlencode}"{else}&p[summary]={$CONTENT_DESCRIPTION|cat:$SOCIALBUTT.copyright|urlencode}"{/if}
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=500');return false;" target="_blank" rel="nofollow">
<img src="{$ROOT_URL}{$SOCIALBUTT_PATH}template/images/facebook.png" alt="Facebook"></a>
{else}