Ignore:
Timestamp:
01/26/13 12:48:44 (7 years ago)
Author:
mistic100
Message:

simplyfy code, add noscript fallback for twitter

Location:
extensions/SocialButtons
Files:
10 edited

Legend:

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

    r20374 r20406  
    1414  // config 
    1515  $tpl_vars['PINTEREST'] = $conf['SocialButtons']['pinterest']; 
    16   $tpl_vars['PINTEREST']['copyright'] = ' (from <a href="'.$root_url.'">'.$conf['gallery_title'].'</a>)'; 
    1716  $tpl_vars['PINTEREST']['title'] = $picture['current']['TITLE']; 
    1817   
  • extensions/SocialButtons/include/tumblr.inc.php

    r20374 r20406  
    66  global $conf, $template; 
    77   
    8   $tumblr_css = array( 
    9     'share_1' => 'width:81px; height:20px;', 
    10     'share_2' => 'width:61px; height:20px;', 
    11     'share_3' => 'width:129px; height:20px;', 
    12     'share_4' => 'width:20px; height:20px;', 
    13     'share_1T' => 'width:81px; height:20px;', 
    14     'share_2T' => 'width:61px; height:20px;', 
    15     'share_3T' => 'width:129px; height:20px;', 
    16     'share_4T' => 'width:20px; height:20px;', 
    17     ); 
    18    
    19    
    208  // config 
    219  $tpl_vars['TUMBLR'] = $conf['SocialButtons']['tumblr']; 
    22   $tpl_vars['TUMBLR']['css'] = $tumblr_css[ $conf['SocialButtons']['tumblr']['type'] ]; 
    23   $tpl_vars['TUMBLR']['copyright'] = ' (from <a href="'.$root_url.'">'.$conf['gallery_title'].'</a>)'; 
    2410   
    2511  // button on piture page 
  • extensions/SocialButtons/main.inc.php

    r20374 r20406  
    118118    'share_url' => $share_url, 
    119119    'position' => $conf['SocialButtons']['position'], 
     120    'copyright' => ' (from <a href="'.$root_url.'">'.$conf['gallery_title'].'</a>)', 
    120121    ); 
    121122  $buttons = array(); 
     
    154155   
    155156   
    156   $template->assign('SOCIALBUTT', $tpl_vars); 
     157  $template->assign(array( 
     158    'SOCIALBUTT' => $tpl_vars, 
     159    'SOCIALBUTT_PATH' => SOCIALBUTT_PATH, 
     160    )); 
    157161   
    158162  // parse buttons 
  • extensions/SocialButtons/template/facebook.tpl

    r20374 r20406  
    11{strip} 
    22{footer_script}jQuery('body').prepend('<div id="fb-root"></div>');{/footer_script} 
    3 {combine_script id='facebook_jssdk' load='async' path='https://connect.facebook.net/'|cat:$SOCIALBUTT.FACEBOOK.lang|cat:'/all.js#xfbml=1'} 
     3{combine_script id='facebook_jssdk' load='footer' path='https://connect.facebook.net/'|cat:$SOCIALBUTT.FACEBOOK.lang|cat:'/all.js#xfbml=1'} 
    44 
    55{if $SOCIALBUTT.FACEBOOK.layout=='none'} 
    66{html_style}{literal} 
    7 .fb-like span { height: 22px !important; overflow: hidden; margin-right:10px; } 
     7.fb-like span { height: 22px !important; overflow: hidden !important; margin-right:10px; } 
    88.fb-like iframe { top: -41px; } 
    99{/literal}{/html_style} 
  • extensions/SocialButtons/template/google.tpl

    r20358 r20406  
    33 
    44<script type="text/javascript">window.___gcfg = {ldelim}lang: '{$SOCIALBUTT.GOOGLE.lang}'};</script> 
    5 <div 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}"></div> 
    66{/strip} 
  • extensions/SocialButtons/template/pinterest.tpl

    r20374 r20406  
    22{combine_script id='pinterest_pinit' path='http://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|urlencode}{$SOCIALBUTT.PINTEREST.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:$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

    r20358 r20406  
    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|urlencode}{$SOCIALBUTT.TUMBLR.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:$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|urlencode}{$SOCIALBUTT.TUMBLR.copyright|urlencode}" 
     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}" 
    99{/if} 
    10 style="display:inline-block;text-indent:-9999px;overflow:hidden;{$SOCIALBUTT.TUMBLR.css}background:url('http://platform.tumblr.com/v1/{$SOCIALBUTT.TUMBLR.type}.png') top left no-repeat transparent;">Tumblr</a> 
     10><img src="http://platform.tumblr.com/v1/{$SOCIALBUTT.TUMBLR.type}.png" alt="Share on Tumblr"></a> 
    1111{/strip} 
  • extensions/SocialButtons/template/twitter.tpl

    r20358 r20406  
    22{combine_script id='twitter_widgets' load='footer' path='http://platform.twitter.com/widgets.js'} 
    33 
    4 <a href="https://twitter.com/share" class="twitter-share-button"  
     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}"  
    55  data-url="{$SOCIALBUTT.share_url}" data-lang="{$SOCIALBUTT.TWITTER.lang}" data-via="{$SOCIALBUTT.TWITTER.via}" 
    6   data-size="{$SOCIALBUTT.TWITTER.size}" data-count="{$SOCIALBUTT.TWITTER.count}">Tweet</a> 
     6  data-size="{$SOCIALBUTT.TWITTER.size}" data-count="{$SOCIALBUTT.TWITTER.count}" class="twitter-share-button"> 
     7  <img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/twitter_{$SOCIALBUTT.TWITTER.size}.png" alt="Share on Twitter"></a> 
    78{/strip} 
Note: See TracChangeset for help on using the changeset viewer.