Changeset 11514 for extensions


Ignore:
Timestamp:
Jun 27, 2011, 2:39:17 AM (13 years ago)
Author:
mistic100
Message:

button issue fixed

Location:
extensions/TweetThis
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/TweetThis/admin.tpl

    r11476 r11514  
    66
    77<form method="post" action="" class="properties" ENCTYPE="multipart/form-data">
    8         <fieldset>
    9                 <legend>{'Configuration'|@translate}</legend>     
    10    
    11     <ul>
    12       <li>
     8
     9    <table class="twitter_buttons">
     10      <tr>
     11        <td><label>
     12          <img src="{$TWEET_PATH}images/tweeth.png"/>
     13          <input type="radio" name="button_style" value="horizontal" {if $button_style == 'horizontal'}checked="checked"{/if}/>
     14        </label></td>
     15        <td><label>
     16          <img src="{$TWEET_PATH}images/tweetv.png"/>
     17          <input type="radio" name="button_style" value="vertical" {if $button_style == 'vertical'}checked="checked"{/if}/>
     18        </label></td>
     19        <td><label>
     20          <img src="{$TWEET_PATH}images/tweetn.png"/>
     21          <input type="radio" name="button_style" value="none" {if $button_style == 'none'}checked="checked"{/if}/>
     22        </label></td>
     23        <td>&nbsp;</td>
     24      </tr>
     25      <tr>
     26        <td><label>
     27          <img src="http://twitter-badges.s3.amazonaws.com/twitter-a.png"/>
     28          <input type="radio" name="button_style" value="twitter-a" {if $button_style == 'twitter-a'}checked="checked"{/if}/>
     29        </label></td>
     30        <td><label>
     31          <img src="http://twitter-badges.s3.amazonaws.com/t_logo-a.png"/>
     32          <input type="radio" name="button_style" value="t_logo-a" {if $button_style == 't_logo-a'}checked="checked"{/if}/>
     33        </label></td>
     34        <td><label>
     35          <img src="http://twitter-badges.s3.amazonaws.com/t_small-a.png"/>
     36          <input type="radio" name="button_style" value="t_small-a" {if $button_style == 't_small-a'}checked="checked"{/if}/>
     37        </label></td>
     38        <td><label>
     39          <img src="http://twitter-badges.s3.amazonaws.com/t_mini-a.png"/>
     40          <input type="radio" name="button_style" value="t_mini-a" {if $button_style == 't_mini-a'}checked="checked"{/if}/>
     41        </label></td>
     42      </tr>
     43      <tr>
     44        <td><label>
     45          <img src="http://twitter-badges.s3.amazonaws.com/twitter-b.png"/>
     46          <input type="radio" name="button_style" value="twitter-b" {if $button_style == 'twitter-b'}checked="checked"{/if}/>
     47        </label></td>
     48        <td><label>
     49          <img src="http://twitter-badges.s3.amazonaws.com/t_logo-b.png"/>
     50          <input type="radio" name="button_style" value="t_logo-b" {if $button_style == 't_logo-b'}checked="checked"{/if}/>
     51        </label></td>
     52        <td><label>
     53          <img src="http://twitter-badges.s3.amazonaws.com/t_small-b.png"/>
     54          <input type="radio" name="button_style" value="t_small-b" {if $button_style == 't_small-b'}checked="checked"{/if}/>
     55        </label></td>
     56        <td><label>
     57          <img src="http://twitter-badges.s3.amazonaws.com/t_mini-b.png"/>
     58          <input type="radio" name="button_style" value="t_mini-b" {if $button_style == 't_mini-b'}checked="checked"{/if}/>
     59        </label></td>
     60      </tr>
     61      <tr>
     62        <td><label>
     63          <img src="http://twitter-badges.s3.amazonaws.com/twitter-c.png"/>
     64          <input type="radio" name="button_style" value="twitter-c" {if $button_style == 'twitter-c'}checked="checked"{/if}/>
     65        </label></td>
     66        <td><label>
     67          <img src="http://twitter-badges.s3.amazonaws.com/t_logo-c.png"/>
     68          <input type="radio" name="button_style" value="t_logo-c" {if $button_style == 't_logo-c'}checked="checked"{/if}/>
     69        </label></td>
     70        <td><label>
     71          <img src="http://twitter-badges.s3.amazonaws.com/t_small-c.png"/>
     72          <input type="radio" name="button_style" value="t_small-c" {if $button_style == 't_small-c'}checked="checked"{/if}/>
     73        </label></td>
     74        <td><label>
     75          <img src="http://twitter-badges.s3.amazonaws.com/t_mini-c.png"/>
     76          <input type="radio" name="button_style" value="t_mini-c" {if $button_style == 't_mini-c'}checked="checked"{/if}/>
     77        </label></td>
     78      </tr>
    1379     
    14       <table class="twitter_buttons">
    15         <tr>
    16           <td><label>
    17             <img src="http://twitter-badges.s3.amazonaws.com/twitter-a.png"/>
    18             <input type="radio" name="button_style" value="twitter-a" {if $button_style == 'twitter-a'}checked="checked"{/if}/>
    19           </label></td>
    20           <td><label>
    21             <img src="http://twitter-badges.s3.amazonaws.com/t_logo-a.png"/>
    22             <input type="radio" name="button_style" value="t_logo-a" {if $button_style == 't_logo-a'}checked="checked"{/if}/>
    23           </label></td>
    24           <td><label>
    25             <img src="http://twitter-badges.s3.amazonaws.com/t_small-a.png"/>
    26             <input type="radio" name="button_style" value="t_small-a" {if $button_style == 't_small-a'}checked="checked"{/if}/>
    27           </label></td>
    28           <td><label>
    29             <img src="http://twitter-badges.s3.amazonaws.com/t_mini-a.png"/>
    30             <input type="radio" name="button_style" value="t_mini-a" {if $button_style == 't_mini-a'}checked="checked"{/if}/>
    31           </label></td>
    32         </tr>
    33         <tr>
    34           <td><label>
    35             <img src="http://twitter-badges.s3.amazonaws.com/twitter-b.png"/>
    36             <input type="radio" name="button_style" value="twitter-b" {if $button_style == 'twitter-b'}checked="checked"{/if}/>
    37           </label></td>
    38           <td><label>
    39             <img src="http://twitter-badges.s3.amazonaws.com/t_logo-b.png"/>
    40             <input type="radio" name="button_style" value="t_logo-b" {if $button_style == 't_logo-b'}checked="checked"{/if}/>
    41           </label></td>
    42           <td><label>
    43             <img src="http://twitter-badges.s3.amazonaws.com/t_small-b.png"/>
    44             <input type="radio" name="button_style" value="t_small-b" {if $button_style == 't_small-b'}checked="checked"{/if}/>
    45           </label></td>
    46           <td><label>
    47             <img src="http://twitter-badges.s3.amazonaws.com/t_mini-b.png"/>
    48             <input type="radio" name="button_style" value="t_mini-b" {if $button_style == 't_mini-b'}checked="checked"{/if}/>
    49           </label></td>
    50         </tr>
    51         <tr>
    52           <td><label>
    53             <img src="http://twitter-badges.s3.amazonaws.com/twitter-c.png"/>
    54             <input type="radio" name="button_style" value="twitter-c" {if $button_style == 'twitter-c'}checked="checked"{/if}/>
    55           </label></td>
    56           <td><label>
    57             <img src="http://twitter-badges.s3.amazonaws.com/t_logo-c.png"/>
    58             <input type="radio" name="button_style" value="t_logo-c" {if $button_style == 't_logo-c'}checked="checked"{/if}/>
    59           </label></td>
    60           <td><label>
    61             <img src="http://twitter-badges.s3.amazonaws.com/t_small-c.png"/>
    62             <input type="radio" name="button_style" value="t_small-c" {if $button_style == 't_small-c'}checked="checked"{/if}/>
    63           </label></td>
    64           <td><label>
    65             <img src="http://twitter-badges.s3.amazonaws.com/t_mini-c.png"/>
    66             <input type="radio" name="button_style" value="t_mini-c" {if $button_style == 't_mini-c'}checked="checked"{/if}/>
    67           </label></td>
    68         </tr>
    69       </table>
    70      
    71     </li>
    72    
    73     <li>
    74       <span class="property">{'Button position on picture page'|@translate}</span>
    75       <label><input type="radio" name="position" value="top" {if $position == 'top'}checked="checked"{/if}/> {'Top'|@translate}</label>
    76       <label><input type="radio" name="position" value="bottom" {if $position == 'bottom'}checked="checked"{/if}/> {'Bottom'|@translate}</label>
    77       <label><input type="radio" name="position" value="toolbar" {if $position == 'toolbar'}checked="checked"{/if}/> {'Toolbar'|@translate}</label>
    78     </li>
    79   </ul>
    80  
    81         </fieldset>
    82                
    83         <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" /></p>
     80      <tr class="property">
     81        <td colspan="2">
     82          {'Button position on picture page'|@translate}
     83        </td>
     84        <td colspan="2">
     85          <label><input type="radio" name="position" value="top" {if $position == 'top'}checked="checked"{/if}/> {'Top'|@translate}</label>
     86          <label><input type="radio" name="position" value="bottom" {if $position == 'bottom'}checked="checked"{/if}/> {'Bottom'|@translate}</label>
     87          <label><input type="radio" name="position" value="toolbar" {if $position == 'toolbar'}checked="checked"{/if}/> {'Toolbar'|@translate}</label>
     88        </td>
     89      </tr>
     90      <tr class="submit">
     91        <td colspan="4">
     92          <input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" />
     93        </td>
     94      </tr>
     95    </table>
     96
    8497</form>
  • extensions/TweetThis/main.inc.php

    r11463 r11514  
    4141    $template->set_prefilter('index', 'tweet_add_button_prefilter');
    4242  }
     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  }
    4371}
    4472
     
    5280      $search = '<div id="theImage">';
    5381      $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>
    5786';
    5887      break;
     
    6190      $search = '{$ELEMENT_CONTENT}';
    6291      $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}
    6595</a>
    6696';
     
    6898     
    6999    case 'toolbar':
    70       $search = '{/if}{/strip}{*caddie management END*}';
     100      $search = '{*caddie management END*}';
    71101      $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}
    74105</a>
    75106';
    76107      break;
    77108     
    78     case 'index':
     109    case 'index': 
    79110      $search = '<ul class="categoryActions">';
    80111      $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}
    83115</a></li>
    84116';
     
    86118  }
    87119 
    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}';
    89121
    90122  return str_replace($search, $replace, $content);
  • extensions/TweetThis/style.css

    r11419 r11514  
    33  border:10px solid #f9f9f9;
    44  border-radius:10px;
     5  margin-bottom:20px;
    56}
    67
     
    1112  border-right-color:#CDE8F4;
    1213  border-bottom-color:#CDE8F4;
     14  text-align:center;
     15  vertical-align:center;
    1316}
    1417.twitter_buttons td:hover {
    1518  background-color:#D0E7F2;
    1619}
    17 tr td:last-child {
     20.twitter_buttons tr td:last-child {
    1821  border-right:none;
    1922}
     
    2124  border-bottom:none;
    2225}
     26tr.property td, tr.submit td {
     27  padding:10px 5px;
     28}
     29tr.property td:hover, tr.submit td:hover {
     30  background-color:#ECF6FA;
     31}
     32tr.property td:first-child {
     33  text-align:right;
     34  font-weight:bold;
     35}
     36tr.property td:last-child {
     37  text-align:left;
     38}
     39tr.submit input {
     40    background: url("http://a0.twimg.com/a/1308875119/phoenix/img/buttons/bg-btn-blue.gif") repeat-x 0 -202px #DDDDDD;
     41    border-color: #3399DD #3399DD #2288CC;
     42    color: #FFFFFF !important;
     43    text-shadow: -1px -1px 0 #3399DD;
     44    border-radius: 4px 4px 4px 4px;
     45    border-style: solid;
     46    border-width: 1px;
     47    padding: 5px 9px !important;
     48}
     49tr.submit input:hover {
     50  box-shadow: 0 0 5px #2288CC;
     51  border-color: #3399DD #3399DD #2288CC;
     52}
Note: See TracChangeset for help on using the changeset viewer.