Changeset 24757
- Timestamp:
- Oct 4, 2013, 10:09:05 PM (11 years ago)
- Location:
- extensions/SocialButtons
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/SocialButtons/admin.php
r21232 r24757 12 12 'position' => $_POST['position'], 13 13 'on_index' => get_boolean($_POST['on_index']), 14 'light' => isset($_POST['light']), 14 15 'twitter' => array( 15 16 'enabled' => isset($_POST['twitter']['enabled']), -
extensions/SocialButtons/include/install.inc.php
r23201 r24757 11 11 'position' => 'toolbar', 12 12 'on_index' => true, 13 'light' => false, 13 14 'twitter' => array( 14 15 'enabled' => true, … … 42 43 { 43 44 $temp = is_string($conf['TumblrShare']) ? unserialize($conf['TumblrShare']) : $conf['TumblrShare']; 44 $default_config['tumblr']['type'] =$temp['type'];45 $default_config['tumblr']['img_size'] = $temp['img_size'];45 if (!empty($temp['type'])) $default_config['tumblr']['type'] = $temp['type']; 46 if (!empty($temp['img_size'])) $default_config['tumblr']['img_size'] = $temp['img_size']; 46 47 } 47 48 if (isset($conf['TweetThis'])) 48 49 { 49 50 $temp = is_string($conf['TweetThis']) ? unserialize($conf['TweetThis']) : $conf['TweetThis']; 50 $default_config['twitter']['size'] =$temp['size'];51 $default_config['twitter']['count'] = $temp['count'] ? 'bubble' : 'none';52 $default_config['twitter']['via'] =$temp['via'];51 if (!empty($temp['type'])) $default_config['twitter']['size'] = $temp['size']; 52 if (!empty($temp['count'])) $default_config['twitter']['count'] = $temp['count'] ? 'bubble' : 'none'; 53 if (!empty($temp['via'])) $default_config['twitter']['via'] = $temp['via']; 53 54 } 54 55 if (isset($conf['GooglePlusOne'])) 55 56 { 56 57 $temp = is_string($conf['GooglePlusOne']) ? unserialize($conf['GooglePlusOne']) : $conf['GooglePlusOne']; 57 $default_config['google']['size'] =$temp['size'];58 $default_config['google']['annotation'] = $temp['annotation'];58 if (!empty($temp['size'])) $default_config['google']['size'] = $temp['size']; 59 if (!empty($temp['annotation'])) $default_config['google']['annotation'] = $temp['annotation']; 59 60 } 60 61 … … 64 65 else 65 66 { 66 $new_conf = unserialize($conf['SocialButtons']);67 $new_conf = is_string($conf['SocialButtons']) ? unserialize($conf['SocialButtons']) : $conf['SocialButtons']; 67 68 68 69 if (empty($new_conf['pinterest'])) … … 74 75 ); 75 76 } 77 76 78 if (!isset($new_conf['on_index'])) 77 79 { … … 84 86 } 85 87 88 if (!isset($new_conf['light'])) 89 { 90 $new_conf['light'] = false; 91 } 92 86 93 $conf['SocialButtons'] = serialize($new_conf); 87 94 conf_update_param('SocialButtons', $conf['SocialButtons']); -
extensions/SocialButtons/include/pinterest.inc.php
r23202 r24757 4 4 function socialbutt_pinterest($basename, $root_url, &$tpl_vars, &$buttons) 5 5 { 6 // only on pi ture page6 // only on picture page 7 7 if ($basename != 'picture') 8 8 { -
extensions/SocialButtons/include/twitter.inc.php
r20374 r24757 6 6 global $conf, $template, $user; 7 7 8 $twitter_langs = array(8 $twitter_langs = array( 9 9 'fr','en','ar','ja','es','de','it','id','pt','ko','tr','ru','nl','fil','msa','zh-tw', 10 10 'zh-cn','hi','no','sv','fi','da','pl','hu','fa','he','ur','th','uk','ca','el','eu','cs' -
extensions/SocialButtons/language/en_UK/plugin.lang.php
r21233 r24757 13 13 $lang['on photo and album'] = 'on photo and album'; 14 14 $lang['only on photo'] = 'only on photo'; 15 $lang['Light mode'] = 'Light mode'; 16 $lang['When light mode is activated no external script is loaded, it <b>speeds up the load of the page and disables user tracking</b> but also disables annotations and in-page popups.'] = 'When light mode is activated no external script is loaded, it <b>speeds up the load of the page and disables user tracking</b> but also disables annotations and in-page popups.'; 15 17 ?> -
extensions/SocialButtons/language/fr_FR/plugin.lang.php
r21232 r24757 15 15 $lang['on photo and album'] = 'sur les photos et les albums'; 16 16 $lang['only on photo'] = 'uniquement sur les photos'; 17 $lang['Light mode'] = 'Mode léger'; 18 $lang['When light mode is activated no external script is loaded, it <b>speeds up the load of the page and disables user tracking</b> but also disables annotations and in-page popups.'] = 'Quand le mode léger est activé aucun script externe n\'est chargé, celà <b>accélère le chargement de la page est désactive le tracking des utilisateurs</b> mais désactive aussi les annotations et les popups détaillés.'; 17 19 ?> -
extensions/SocialButtons/main.inc.php
r23201 r24757 119 119 120 120 121 define('SOCIALBUTT_POSITION', $conf['SocialButtons']['position']);122 121 $tpl_vars = array( 123 122 'share_url' => $share_url, 124 123 'position' => $conf['SocialButtons']['position'], 124 'light' => $conf['SocialButtons']['light'], 125 125 'copyright' => '(from <a href="'.$share_url.'">'.$conf['gallery_title'].'</a>)', 126 126 ); … … 177 177 { 178 178 case 'index': 179 foreach ($buttons as $button) { 180 $template->add_index_button('<li>'.$button.'</li>', 100); 179 foreach ($buttons as $button) 180 { 181 $template->add_index_button($button, 100); 181 182 } 182 183 break; 183 184 case 'toolbar': 184 foreach ($buttons as $button) { 185 foreach ($buttons as $button) 186 { 185 187 $template->add_picture_button($button, 100); 186 188 } 187 189 break; 188 190 default; 191 define('SOCIALBUTT_POSITION', $conf['SocialButtons']['position']); 189 192 $template->assign('SOCIALBUTT_BUTTONS', $buttons); 190 193 $template->set_prefilter('picture', 'socialbutt_add_button_prefilter'); … … 198 201 case 'top': 199 202 $search = '<div id="theImage">'; 200 $add = '<div >{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON} {/foreach}</div>';203 $add = '<div id="socialButtons">{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON} {/foreach}</div>'; 201 204 break; 202 205 203 206 case 'bottom': 204 207 $search = '{$ELEMENT_CONTENT}'; 205 $add = '<div >{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON} {/foreach}</div>';208 $add = '<div id="socialButtons">{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON} {/foreach}</div>'; 206 209 break; 207 210 } -
extensions/SocialButtons/maintain.inc.php
r20358 r24757 24 24 function plugin_uninstall() 25 25 { 26 pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "SocialButtons" LIMIT 1;'); 26 global $conf; 27 28 pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "SocialButtons";'); 29 unset($conf['SocialButtons']); 27 30 } 28 31 -
extensions/SocialButtons/template/admin.tpl
r23201 r24757 3 3 {html_style}{literal} 4 4 .socialbutt.disabled thead img { 5 -webkit-filter: grayscale(100%); /* Chrome 19+ & Safari 6+ */ 5 6 filter: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='grayscale'><feColorMatrix type='saturate' values='0'/></filter></svg>#grayscale"); /* Firefox 10+ */ 6 7 filter: gray; /* IE6-9 */ 7 -webkit-filter: grayscale(100%); /* Chrome 19+ & Safari 6+ */8 8 } 9 {/literal}{/html_style} 9 {/literal} 10 {if $light} 11 .not-light {ldelim} display:none; } 12 {/if} 13 {/html_style} 10 14 11 15 {footer_script}{literal} … … 23 27 } 24 28 }); 29 30 jQuery("input#light_mode").on('change', function() { 31 if ($(this).is(":checked")) { 32 $('.not-light').hide(); 33 } 34 else { 35 $('.not-light').show(); 36 } 37 }); 38 39 jQuery(".showInfo").tipTip({ 40 delay: 0, 41 fadeIn: 200, 42 fadeOut: 200, 43 maxWidth: '300px', 44 defaultPosition: 'bottom' 45 }); 25 46 {/literal}{/footer_script} 26 47 … … 54 75 </td> 55 76 </tr> 77 <tr class="property"> 78 <td> 79 <label for="light_mode">{'Light mode'|@translate}</label> 80 </td> 81 <td> 82 <input type="checkbox" id="light_mode" name="light" {if $light}checked="checked"{/if}/> 83 <a class="showInfo" title="{'When light mode is activated no external script is loaded, it <b>speeds up the load of the page and disables user tracking</b> but also disables annotations and in-page popups.'|@translate}">i</a> 84 </td> 85 </tr> 56 86 </table> 57 87 </div> … … 87 117 </label></td> 88 118 </tr> 89 <tr class="property ">119 <tr class="property not-light"> 90 120 <td> 91 121 {'Annotation'|@translate} … … 145 175 </label></td> 146 176 </tr> 147 <tr class="property ">177 <tr class="property not-light"> 148 178 <td> 149 179 {'Annotation'|@translate} … … 180 210 </td> 181 211 </tr> 182 <tr class="property ">212 <tr class="property not-light"> 183 213 <td> 184 214 {'Annotation'|@translate} … … 221 251 </label></td> 222 252 </tr> 223 <tr class="property ">253 <tr class="property not-light"> 224 254 <td> 225 255 {'Annotation'|@translate} -
extensions/SocialButtons/template/facebook.tpl
r23201 r24757 1 1 {strip} 2 {if $SOCIALBUTT.light} 3 <a href="https://www.facebook.com/sharer.php?u={$SOCIALBUTT.share_url|urlencode}&t={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}" rel="nofollow" 4 onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=500');return false;" target="_blank"> 5 <img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/facebook_{$SOCIALBUTT.FACEBOOK.color}.png" alt="Share on Facebook"></a> 6 {else} 2 7 {footer_script}jQuery('body').prepend('<div id="fb-root"></div>');{/footer_script} 3 8 {combine_script id='facebook_jssdk' load='footer' path='https://connect.facebook.net/'|cat:$SOCIALBUTT.FACEBOOK.lang|cat:'/all.js#xfbml=1'} 4 5 9 <div style="display:inline-block;" class="fb-like" data-send="false" data-show-faces="false" 6 10 data-href="{$SOCIALBUTT.share_url}" data-layout="{$SOCIALBUTT.FACEBOOK.layout}" data-colorscheme="{$SOCIALBUTT.FACEBOOK.color}"></div> 11 {/if} 7 12 {/strip} -
extensions/SocialButtons/template/google.tpl
r23201 r24757 1 1 {strip} 2 {if $SOCIALBUTT.light} 3 <a title="Google +" href="https://plus.google.com/share?url={$SOCIALBUTT.share_url|urlencode}&hl={$SOCIALBUTT.GOOGLE.lang}" rel="nofollow" 4 onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=390,width=480');return false;" target="_blank"> 5 <img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/google_{$SOCIALBUTT.GOOGLE.size}.png" alt="Share on Google+"></a> 6 {else} 2 7 {combine_script id='google_plusone' load='footer' path='https://apis.google.com/js/plusone.js'} 3 4 8 <script type="text/javascript">window.___gcfg = {ldelim}lang: '{$SOCIALBUTT.GOOGLE.lang}'};</script> 5 9 <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> 10 {/if} 6 11 {/strip} -
extensions/SocialButtons/template/pinterest.tpl
r23201 r24757 1 1 {strip} 2 {combine_script id='pinterest_pinit' load='footer' path='https://assets.pinterest.com/js/pinit.js'} 3 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}" 5 class="pin-it-button" count-layout="{$SOCIALBUTT.PINTEREST.layout}"><img border="0" src="http://assets.pinterest.com/images/PinExt.png" title="Pin It"/></a> 2 <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}" rel="nofollow" 3 {if $SOCIALBUTT.light} 4 onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=470,width=600');return false;" target="_blank" 5 {else} 6 class="pin-it-button" count-layout="{$SOCIALBUTT.PINTEREST.layout}" 7 {combine_script id='pinterest_pinit' load='footer' path='https://assets.pinterest.com/js/pinit.js'} 8 {/if} 9 ><img border="0" src="http://assets.pinterest.com/images/PinExt.png" title="Pin It"/></a> 6 10 {/strip} -
extensions/SocialButtons/template/style.css
r20403 r24757 117 117 content:"\2611"; 118 118 } 119 120 121 .showInfo { 122 position:static; 123 display:inline-block; 124 padding:1px 6px; 125 width:4px; 126 height:14px; 127 line-height:14px; 128 font-size:0.8em; 129 } -
extensions/SocialButtons/template/tumblr.tpl
r23201 r24757 1 1 {strip} 2 {combine_script id='tumblr_share' load='footer' path='http://platform.tumblr.com/v1/share.js'}3 4 2 {if $SOCIALBUTT.TUMBLR.mode=='photo'} 5 3 {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:' '|cat:$SOCIALBUTT.copyright|urlencode}&clickthru={$SOCIALBUTT.share_url|urlencode}&tags={$inline_tags|urlencode}" 4 <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}" rel="nofollow" 7 5 {else} 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}" 6 <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}" rel="nofollow" 7 {/if} 8 {if $SOCIALBUTT.light} 9 onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=430,width=500');return false;" target="_blank" 10 {else} 11 {combine_script id='tumblr_share' load='footer' path='http://platform.tumblr.com/v1/share.js'} 9 12 {/if} 10 13 ><img src="http://platform.tumblr.com/v1/{$SOCIALBUTT.TUMBLR.type}.png" alt="Share on Tumblr"></a> -
extensions/SocialButtons/template/twitter.tpl
r23201 r24757 1 1 {strip} 2 {combine_script id='twitter_widgets' load='footer' path='https://platform.twitter.com/widgets.js'} 3 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}" 2 <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}" rel="nofollow" 3 {if $SOCIALBUTT.light} 4 onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=470,width=600');return false;" target="_blank" 5 {else} 5 6 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}" class="twitter-share-button"> 7 <img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/twitter_{$SOCIALBUTT.TWITTER.size}.png" alt="Share on Twitter"></a> 7 data-size="{$SOCIALBUTT.TWITTER.size}" data-count="{$SOCIALBUTT.TWITTER.count}" class="twitter-share-button" 8 {combine_script id='twitter_widgets' load='footer' path='https://platform.twitter.com/widgets.js'} 9 {/if} 10 ><img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/twitter_{$SOCIALBUTT.TWITTER.size}.png" alt="Share on Twitter"></a> 8 11 {/strip}
Note: See TracChangeset
for help on using the changeset viewer.