Changeset 11514 for extensions/TweetThis/main.inc.php
- Timestamp:
- Jun 27, 2011, 2:39:17 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/TweetThis/main.inc.php
r11463 r11514 41 41 $template->set_prefilter('index', 'tweet_add_button_prefilter'); 42 42 } 43 44 // html change a bit if we use custom button, or official with counter 45 if ( in_array( $conf['TweetThis'][0], array('none','horizontal','vertical') ) ) 46 { 47 $template->assign('TWEET_IFRAME', true); 48 $template->assign('TWEET_COUNTER', $conf['TweetThis'][0]); 49 } 50 else 51 { 52 $template->assign('TWEET_IFRAME', false); 53 $template->assign('TWEET_COUNTER', 'none'); 54 } 55 56 // if the link is in the toolbar, we must use smallest buttons 57 if ( script_basename() == 'index' OR $conf['TweetThis'][1] == 'toolbar') 58 { 59 switch ($conf['TweetThis'][0]) 60 { 61 case 'vertical': 62 $template->assign('TWEET_COUNTER', 'horizontal'); break; 63 case 't_logo-a': 64 $template->assign('TWEET_IMAGE', 't_small-a'); break; 65 case 't_logo-b': 66 $template->assign('TWEET_IMAGE', 't_small-b'); break; 67 case 't_logo-c': 68 $template->assign('TWEET_IMAGE', 't_small-c'); break; 69 } 70 } 43 71 } 44 72 … … 52 80 $search = '<div id="theImage">'; 53 81 $replace = ' 54 <a href="http://twitter.com/share" class="twitter-share-button" title="{\'Share on Twitter\'|@translate}" style="display:block;"> 55 <img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/> 56 </a> 82 <div><a href="javascript:phpWGOpenWindow(\'http://twitter.com/share?count={$TWEET_COUNTER}\', \'{\'Share on Twitter\'|@translate}\', \'scrollbars=yes,width=550,height=370\')" 83 class="{if $TWEET_IFRAME}twitter-share-button{/if}" title="{\'Share on Twitter\'|@translate}"> 84 {if $TWEET_IFRAME}Tweet{else}<img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/>{/if} 85 </a></div> 57 86 '; 58 87 break; … … 61 90 $search = '{$ELEMENT_CONTENT}'; 62 91 $replace = ' 63 <a href="http://twitter.com/share" class="twitter-share-button" title="{\'Share on Twitter\'|@translate}" style="display:block;"> 64 <img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/> 92 <a href="javascript:phpWGOpenWindow(\'http://twitter.com/share?count={$TWEET_COUNTER}\', \'{\'Share on Twitter\'|@translate}\', \'scrollbars=yes,width=550,height=370\')" 93 class="{if $TWEET_IFRAME}twitter-share-button{/if}" title="{\'Share on Twitter\'|@translate}"> 94 {if $TWEET_IFRAME}Tweet{else}<img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/>{/if} 65 95 </a> 66 96 '; … … 68 98 69 99 case 'toolbar': 70 $search = '{ /if}{/strip}{*caddie management END*}';100 $search = '{*caddie management END*}'; 71 101 $replace = ' 72 <a href="http://twitter.com/share" class="twitter-share-button pwg-button" title="{\'Share on Twitter\'|@translate}"> 73 <img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/> 102 <a href="javascript:phpWGOpenWindow(\'http://twitter.com/share?count={$TWEET_COUNTER}\', \'{\'Share on Twitter\'|@translate}\', \'scrollbars=yes,width=550,height=370\')" 103 class="{if $TWEET_IFRAME}twitter-share-button{/if} pwg-button" title="{\'Share on Twitter\'|@translate}"> 104 {if $TWEET_IFRAME}Tweet{else}<img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/>{/if} 74 105 </a> 75 106 '; 76 107 break; 77 108 78 case 'index': 109 case 'index': 79 110 $search = '<ul class="categoryActions">'; 80 111 $replace = ' 81 <li><a href="http://twitter.com/share" class="twitter-share-button pwg-button" title="{\'Share on Twitter\'|@translate}"> 82 <img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/> 112 <li><a href="javascript:phpWGOpenWindow(\'http://twitter.com/share?count={$TWEET_COUNTER}\', \'{\'Share on Twitter\'|@translate}\', \'scrollbars=yes,width=550,height=370\')" 113 class="{if $TWEET_IFRAME}twitter-share-button{/if} pwg-button" title="{\'Share on Twitter\'|@translate}"> 114 {if $TWEET_IFRAME}Tweet{else}<img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/>{/if} 83 115 </a></li> 84 116 '; … … 86 118 } 87 119 88 $replace = $search . $replace . '{ combine_script id=\'twitter_widgets\' path=\'http://platform.twitter.com/widgets.js\'}';120 $replace = $search . $replace . '{if $TWEET_IFRAME}{combine_script id=\'twitter_widgets\' path=\'http://platform.twitter.com/widgets.js}{/if}'; 89 121 90 122 return str_replace($search, $replace, $content);
Note: See TracChangeset
for help on using the changeset viewer.