Changeset 23201


Ignore:
Timestamp:
Jun 14, 2013, 12:43:50 PM (7 years ago)
Author:
mistic100
Message:

remove "no caption" option for facebook (buggy)
fix urls
fix pinterest javascript

Location:
extensions/SocialButtons
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • extensions/SocialButtons/include/facebook.inc.php

    r20374 r23201  
    1818 
    1919  // if the link is in the toolbar, we must use smaller buttons
    20   if ( $conf['SocialButtons']['position'] == 'index' or $conf['SocialButtons']['position'] == 'toolbar')
     20  if ($conf['SocialButtons']['position'] == 'index' or $conf['SocialButtons']['position'] == 'toolbar')
    2121  {
    2222    if ($conf['SocialButtons']['facebook']['layout'] == 'box_count')
  • extensions/SocialButtons/include/google.inc.php

    r20374 r23201  
    1515 
    1616  // if the link is in the toolbar, we must use smaller buttons
    17   if ( $conf['SocialButtons']['position'] == 'index' or $conf['SocialButtons']['position'] == 'toolbar')
     17  if ($conf['SocialButtons']['position'] == 'index' or $conf['SocialButtons']['position'] == 'toolbar')
    1818  {
    1919    if ($conf['SocialButtons']['google']['size'] == 'tall' and $conf['SocialButtons']['google']['annotation'] == 'bubble')
  • extensions/SocialButtons/include/install.inc.php

    r21232 r23201  
    7979    }
    8080   
     81    if ($new_conf['facebook']['layout'] == 'none')
     82    {
     83      $new_conf['facebook']['layout'] = 'button_count';
     84    }
     85   
    8186    $conf['SocialButtons'] = serialize($new_conf);
    8287    conf_update_param('SocialButtons', $conf['SocialButtons']);
  • extensions/SocialButtons/include/pinterest.inc.php

    r20406 r23201  
    1818  if ($conf['SocialButtons']['pinterest']['img_size'] == 'Original')
    1919  {
    20     $tpl_vars['PINTEREST']['source'] = $root_url.ltrim($picture['current']['src_image']->get_url(), './');
     20    $tpl_vars['PINTEREST']['source'] = $picture['current']['src_image']->get_url();
    2121  }
    2222  else
    2323  {
    24     $tpl_vars['PINTEREST']['source'] = $root_url.ltrim(DerivativeImage::url($conf['SocialButtons']['pinterest']['img_size'], $picture['current']['src_image']), './');
     24    $tpl_vars['PINTEREST']['source'] = DerivativeImage::url($conf['SocialButtons']['pinterest']['img_size'], $picture['current']['src_image']);
    2525  }
    2626 
  • extensions/SocialButtons/include/tumblr.inc.php

    r20406 r23201  
    1919    if ($conf['SocialButtons']['tumblr']['img_size'] == 'Original')
    2020    {
    21       $tpl_vars['TUMBLR']['source'] = $root_url.ltrim($picture['current']['src_image']->get_url(), './');
     21      $tpl_vars['TUMBLR']['source'] = $picture['current']['src_image']->get_url();
    2222    }
    2323    else
    2424    {
    25       $tpl_vars['TUMBLR']['source'] = $root_url.ltrim(DerivativeImage::url($conf['SocialButtons']['tumblr']['img_size'], $picture['current']['src_image']), './');
     25      $tpl_vars['TUMBLR']['source'] = DerivativeImage::url($conf['SocialButtons']['tumblr']['img_size'], $picture['current']['src_image']);
    2626    }
    2727  }
  • extensions/SocialButtons/main.inc.php

    r21232 r23201  
    9797 
    9898  $basename = script_basename();
     99  set_make_full_url();
    99100  $root_url = get_absolute_root_url();
    100101 
    101102  if ($basename == 'picture')
    102103  {
    103     $share_url = $root_url.ltrim(duplicate_picture_url(), './');
     104    // global $picture;
     105   
     106    // if ($picture['current']['level'] > 0) return;
     107   
     108    $share_url = duplicate_picture_url();
    104109  }
    105110  else if ($basename == 'index' and $conf['SocialButtons']['on_index'])
    106111  {
    107112    $conf['SocialButtons']['position'] = 'index';
    108     $share_url = $root_url.ltrim(duplicate_index_url(array(), array('start')), './');
     113    $share_url = duplicate_index_url(array(), array('start'));
    109114  }
    110115  else
     
    118123    'share_url' => $share_url,
    119124    'position' => $conf['SocialButtons']['position'],
    120     'copyright' => ' (from <a href="'.$share_url.'">'.$conf['gallery_title'].'</a>)',
     125    'copyright' => '(from <a href="'.$share_url.'">'.$conf['gallery_title'].'</a>)',
    121126    );
    122127  $buttons = array();
     
    148153    socialbutt_pinterest($basename, $root_url, $tpl_vars, $buttons);
    149154  }
     155 
     156  unset_make_full_url();
    150157 
    151158  if (empty($buttons))
  • extensions/SocialButtons/template/admin.tpl

    r21232 r23201  
    226226      </td>
    227227      <td>
    228         <label><input type="radio" name="facebook[layout]" value="none" {if $facebook.layout=='none'}checked="checked"{/if}/> {'None'|@translate}</label><br>
     228        <!-- <label><input type="radio" name="facebook[layout]" value="none" {if $facebook.layout=='none'}checked="checked"{/if}/> {'None'|@translate}</label><br> -->
    229229        <label><input type="radio" name="facebook[layout]" value="button_count" {if $facebook.layout=='button_count'}checked="checked"{/if}/> {'Right bubble'|@translate}</label><br>
    230230        <label><input type="radio" name="facebook[layout]" value="box_count" {if $facebook.layout=='box_count'}checked="checked"{/if}/> {'Top bubble'|@translate}</label><br>
  • extensions/SocialButtons/template/facebook.tpl

    r21232 r23201  
    33{combine_script id='facebook_jssdk' load='footer' path='https://connect.facebook.net/'|cat:$SOCIALBUTT.FACEBOOK.lang|cat:'/all.js#xfbml=1'}
    44
    5 {if $SOCIALBUTT.FACEBOOK.layout=='none'}
    6 {html_style}{literal}
    7 .fb-like span { height: 22px !important; overflow: hidden !important; }
    8 .fb-like iframe { top: -41px; }
    9 {/literal}{/html_style}
    10 {assign var=facebook_layout value='box_count'}
    11 {else}
    12 {assign var=facebook_layout value=$SOCIALBUTT.FACEBOOK.layout}
    13 {/if}
    14 
    155<div style="display:inline-block;" class="fb-like" data-send="false" data-show-faces="false"
    16   data-href="{$SOCIALBUTT.share_url}" data-layout="{$facebook_layout}" data-colorscheme="{$SOCIALBUTT.FACEBOOK.color}"></div>
     6  data-href="{$SOCIALBUTT.share_url}" data-layout="{$SOCIALBUTT.FACEBOOK.layout}" data-colorscheme="{$SOCIALBUTT.FACEBOOK.color}"></div>
    177{/strip}
  • extensions/SocialButtons/template/google.tpl

    r20406 r23201  
    33
    44<script type="text/javascript">window.___gcfg = {ldelim}lang: '{$SOCIALBUTT.GOOGLE.lang}'};</script>
    5 <div style="display:inline-block;" class="g-plusone" data-size="{$SOCIALBUTT.GOOGLE.size}" data-annotation="{$SOCIALBUTT.GOOGLE.annotation}" data-href="{$SOCIALBUTT.share_url}"></div>
     5<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>
    66{/strip}
  • extensions/SocialButtons/template/pinterest.tpl

    r20406 r23201  
    11{strip}
    2 {combine_script id='pinterest_pinit' path='http://assets.pinterest.com/js/pinit.js'}
     2{combine_script id='pinterest_pinit' load='footer' path='https://assets.pinterest.com/js/pinit.js'}
    33
    4 <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}"
     4<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}"
    55  class="pin-it-button" count-layout="{$SOCIALBUTT.PINTEREST.layout}"><img border="0" src="http://assets.pinterest.com/images/PinExt.png" title="Pin It"/></a>
    66{/strip}
  • extensions/SocialButtons/template/tumblr.tpl

    r20406 r23201  
    44{if $SOCIALBUTT.TUMBLR.mode=='photo'}
    55{capture assign="inline_tags"}{foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first},{/if}{$tag.name}{/foreach}{/capture}
    6 <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}"
     6<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}"
    77{else}
    8 <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}"
     8<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}"
    99{/if}
    1010><img src="http://platform.tumblr.com/v1/{$SOCIALBUTT.TUMBLR.type}.png" alt="Share on Tumblr"></a>
  • extensions/SocialButtons/template/twitter.tpl

    r20406 r23201  
    11{strip}
    2 {combine_script id='twitter_widgets' load='footer' path='http://platform.twitter.com/widgets.js'}
     2{combine_script id='twitter_widgets' load='footer' path='https://platform.twitter.com/widgets.js'}
    33
    4 <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}"
     4<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}"
    55  data-url="{$SOCIALBUTT.share_url}" data-lang="{$SOCIALBUTT.TWITTER.lang}" data-via="{$SOCIALBUTT.TWITTER.via}"
    66  data-size="{$SOCIALBUTT.TWITTER.size}" data-count="{$SOCIALBUTT.TWITTER.count}" class="twitter-share-button">
Note: See TracChangeset for help on using the changeset viewer.