remove "no caption" option for facebook (buggy)

fix urls
fix pinterest javascript

git-svn-id: http://piwigo.org/svn/extensions/SocialButtons@23201 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
mistic100
2013-06-14 10:43:50 +00:00
parent b3114f7440
commit 72e50e3132
12 changed files with 30 additions and 28 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ function socialbutt_facebook($basename, $root_url, &$tpl_vars, &$buttons)
// if the link is in the toolbar, we must use smaller buttons
if ( $conf['SocialButtons']['position'] == 'index' or $conf['SocialButtons']['position'] == 'toolbar')
if ($conf['SocialButtons']['position'] == 'index' or $conf['SocialButtons']['position'] == 'toolbar')
{
if ($conf['SocialButtons']['facebook']['layout'] == 'box_count')
{
+1 -1
View File
@@ -14,7 +14,7 @@ function socialbutt_google($basename, $root_url, &$tpl_vars, &$buttons)
// if the link is in the toolbar, we must use smaller buttons
if ( $conf['SocialButtons']['position'] == 'index' or $conf['SocialButtons']['position'] == 'toolbar')
if ($conf['SocialButtons']['position'] == 'index' or $conf['SocialButtons']['position'] == 'toolbar')
{
if ($conf['SocialButtons']['google']['size'] == 'tall' and $conf['SocialButtons']['google']['annotation'] == 'bubble')
{
+5
View File
@@ -78,6 +78,11 @@ function socialbutt_install()
$new_conf['on_index'] = true;
}
if ($new_conf['facebook']['layout'] == 'none')
{
$new_conf['facebook']['layout'] = 'button_count';
}
$conf['SocialButtons'] = serialize($new_conf);
conf_update_param('SocialButtons', $conf['SocialButtons']);
}
+2 -2
View File
@@ -17,11 +17,11 @@ function socialbutt_pinterest($basename, $root_url, &$tpl_vars, &$buttons)
if ($conf['SocialButtons']['pinterest']['img_size'] == 'Original')
{
$tpl_vars['PINTEREST']['source'] = $root_url.ltrim($picture['current']['src_image']->get_url(), './');
$tpl_vars['PINTEREST']['source'] = $picture['current']['src_image']->get_url();
}
else
{
$tpl_vars['PINTEREST']['source'] = $root_url.ltrim(DerivativeImage::url($conf['SocialButtons']['pinterest']['img_size'], $picture['current']['src_image']), './');
$tpl_vars['PINTEREST']['source'] = DerivativeImage::url($conf['SocialButtons']['pinterest']['img_size'], $picture['current']['src_image']);
}
+2 -2
View File
@@ -18,11 +18,11 @@ function socialbutt_tumblr($basename, $root_url, &$tpl_vars, &$buttons)
if ($conf['SocialButtons']['tumblr']['img_size'] == 'Original')
{
$tpl_vars['TUMBLR']['source'] = $root_url.ltrim($picture['current']['src_image']->get_url(), './');
$tpl_vars['TUMBLR']['source'] = $picture['current']['src_image']->get_url();
}
else
{
$tpl_vars['TUMBLR']['source'] = $root_url.ltrim(DerivativeImage::url($conf['SocialButtons']['tumblr']['img_size'], $picture['current']['src_image']), './');
$tpl_vars['TUMBLR']['source'] = DerivativeImage::url($conf['SocialButtons']['tumblr']['img_size'], $picture['current']['src_image']);
}
}
// button on other pages
+10 -3
View File
@@ -96,16 +96,21 @@ function socialbutt_add_button()
global $conf, $template;
$basename = script_basename();
set_make_full_url();
$root_url = get_absolute_root_url();
if ($basename == 'picture')
{
$share_url = $root_url.ltrim(duplicate_picture_url(), './');
// global $picture;
// if ($picture['current']['level'] > 0) return;
$share_url = duplicate_picture_url();
}
else if ($basename == 'index' and $conf['SocialButtons']['on_index'])
{
$conf['SocialButtons']['position'] = 'index';
$share_url = $root_url.ltrim(duplicate_index_url(array(), array('start')), './');
$share_url = duplicate_index_url(array(), array('start'));
}
else
{
@@ -117,7 +122,7 @@ function socialbutt_add_button()
$tpl_vars = array(
'share_url' => $share_url,
'position' => $conf['SocialButtons']['position'],
'copyright' => ' (from <a href="'.$share_url.'">'.$conf['gallery_title'].'</a>)',
'copyright' => '(from <a href="'.$share_url.'">'.$conf['gallery_title'].'</a>)',
);
$buttons = array();
@@ -148,6 +153,8 @@ function socialbutt_add_button()
socialbutt_pinterest($basename, $root_url, $tpl_vars, $buttons);
}
unset_make_full_url();
if (empty($buttons))
{
return;
+1 -1
View File
@@ -225,7 +225,7 @@ jQuery("input.enable").change(function() {
{'Annotation'|@translate}
</td>
<td>
<label><input type="radio" name="facebook[layout]" value="none" {if $facebook.layout=='none'}checked="checked"{/if}/> {'None'|@translate}</label><br>
<!-- <label><input type="radio" name="facebook[layout]" value="none" {if $facebook.layout=='none'}checked="checked"{/if}/> {'None'|@translate}</label><br> -->
<label><input type="radio" name="facebook[layout]" value="button_count" {if $facebook.layout=='button_count'}checked="checked"{/if}/> {'Right bubble'|@translate}</label><br>
<label><input type="radio" name="facebook[layout]" value="box_count" {if $facebook.layout=='box_count'}checked="checked"{/if}/> {'Top bubble'|@translate}</label><br>
<label><input type="radio" name="facebook[layout]" value="standard" {if $facebook.layout=='standard'}checked="checked"{/if}/> {'Inline text'|@translate}</label>
+1 -11
View File
@@ -2,16 +2,6 @@
{footer_script}jQuery('body').prepend('<div id="fb-root"></div>');{/footer_script}
{combine_script id='facebook_jssdk' load='footer' path='https://connect.facebook.net/'|cat:$SOCIALBUTT.FACEBOOK.lang|cat:'/all.js#xfbml=1'}
{if $SOCIALBUTT.FACEBOOK.layout=='none'}
{html_style}{literal}
.fb-like span { height: 22px !important; overflow: hidden !important; }
.fb-like iframe { top: -41px; }
{/literal}{/html_style}
{assign var=facebook_layout value='box_count'}
{else}
{assign var=facebook_layout value=$SOCIALBUTT.FACEBOOK.layout}
{/if}
<div style="display:inline-block;" class="fb-like" data-send="false" data-show-faces="false"
data-href="{$SOCIALBUTT.share_url}" data-layout="{$facebook_layout}" data-colorscheme="{$SOCIALBUTT.FACEBOOK.color}"></div>
data-href="{$SOCIALBUTT.share_url}" data-layout="{$SOCIALBUTT.FACEBOOK.layout}" data-colorscheme="{$SOCIALBUTT.FACEBOOK.color}"></div>
{/strip}
+1 -1
View File
@@ -2,5 +2,5 @@
{combine_script id='google_plusone' load='footer' path='https://apis.google.com/js/plusone.js'}
<script type="text/javascript">window.___gcfg = {ldelim}lang: '{$SOCIALBUTT.GOOGLE.lang}'};</script>
<div style="display:inline-block;" class="g-plusone" data-size="{$SOCIALBUTT.GOOGLE.size}" data-annotation="{$SOCIALBUTT.GOOGLE.annotation}" data-href="{$SOCIALBUTT.share_url}"></div>
<div style="display:inline-block;" class="g-plusone" data-size="{$SOCIALBUTT.GOOGLE.size}" data-annotation="{$SOCIALBUTT.GOOGLE.annotation}" data-href="{$SOCIALBUTT.share_url}" data-recommendations="false"></div>
{/strip}
+2 -2
View File
@@ -1,6 +1,6 @@
{strip}
{combine_script id='pinterest_pinit' path='http://assets.pinterest.com/js/pinit.js'}
{combine_script id='pinterest_pinit' load='footer' path='https://assets.pinterest.com/js/pinit.js'}
<a href="http://pinterest.com/pin/create/button/?url={$SOCIALBUTT.share_url|urlencode}&media={$SOCIALBUTT.PINTEREST.source|urlencode}&description={$SOCIALBUTT.PINTEREST.title|cat:$SOCIALBUTT.copyright|urlencode}"
<a href="http://pinterest.com/pin/create/button/?url={$SOCIALBUTT.share_url|urlencode}&media={$SOCIALBUTT.PINTEREST.source|urlencode}&description={$SOCIALBUTT.PINTEREST.title|cat:' '|cat:$SOCIALBUTT.copyright|urlencode}"
class="pin-it-button" count-layout="{$SOCIALBUTT.PINTEREST.layout}"><img border="0" src="http://assets.pinterest.com/images/PinExt.png" title="Pin It"/></a>
{/strip}
+2 -2
View File
@@ -3,9 +3,9 @@
{if $SOCIALBUTT.TUMBLR.mode=='photo'}
{capture assign="inline_tags"}{foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first},{/if}{$tag.name}{/foreach}{/capture}
<a href="http://www.tumblr.com/share/photo?source={$SOCIALBUTT.TUMBLR.source|urlencode}&caption={$SOCIALBUTT.TUMBLR.title|cat:$SOCIALBUTT.copyright|urlencode}&clickthru={$SOCIALBUTT.share_url|urlencode}&tags={$inline_tags|urlencode}"
<a href="http://www.tumblr.com/share/photo?source={$SOCIALBUTT.TUMBLR.source|urlencode}&caption={$SOCIALBUTT.TUMBLR.title|cat:' '|cat:$SOCIALBUTT.copyright|urlencode}&clickthru={$SOCIALBUTT.share_url|urlencode}&tags={$inline_tags|urlencode}"
{else}
<a href="http://www.tumblr.com/share/link?url={$SOCIALBUTT.share_url|urlencode}&name={$SOCIALBUTT.TUMBLR.title|urlencode}&description={$CONTENT_DESCRIPTION|cat:$SOCIALBUTT.copyright|urlencode}"
<a href="http://www.tumblr.com/share/link?url={$SOCIALBUTT.share_url|urlencode}&name={$SOCIALBUTT.TUMBLR.title|cat:' | '|cat:$GALLERY_TITLE|urlencode}&description={$CONTENT_DESCRIPTION|cat:$SOCIALBUTT.copyright|urlencode}"
{/if}
><img src="http://platform.tumblr.com/v1/{$SOCIALBUTT.TUMBLR.type}.png" alt="Share on Tumblr"></a>
{/strip}
+2 -2
View File
@@ -1,7 +1,7 @@
{strip}
{combine_script id='twitter_widgets' load='footer' path='http://platform.twitter.com/widgets.js'}
{combine_script id='twitter_widgets' load='footer' path='https://platform.twitter.com/widgets.js'}
<a href="https://twitter.com/share?url={$SOCIALBUTT.share_url}&text={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE}{if $SOCIALBUTT.TWITTER.via}&via={$SOCIALBUTT.TWITTER.via}{/if}"
<a href="https://twitter.com/share?url={$SOCIALBUTT.share_url|urlencode}&text={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}{if $SOCIALBUTT.TWITTER.via}&via={$SOCIALBUTT.TWITTER.via}{/if}"
data-url="{$SOCIALBUTT.share_url}" data-lang="{$SOCIALBUTT.TWITTER.lang}" data-via="{$SOCIALBUTT.TWITTER.via}"
data-size="{$SOCIALBUTT.TWITTER.size}" data-count="{$SOCIALBUTT.TWITTER.count}" class="twitter-share-button">
<img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/twitter_{$SOCIALBUTT.TWITTER.size}.png" alt="Share on Twitter"></a>