Index: /extensions/TweetThis/admin.php
===================================================================
--- /extensions/TweetThis/admin.php	(revision 15121)
+++ /extensions/TweetThis/admin.php	(revision 15122)
@@ -5,14 +5,16 @@
 
 load_language('plugin.lang', TWEET_PATH);
-$conf['TweetThis'] = explode(',', $conf['TweetThis']);
+$conf['TweetThis'] = unserialize($conf['TweetThis']);
 
 if (isset($_POST['submit']))
 {
   $conf['TweetThis'] = array(
-    $_POST['button_style'],
-    $_POST['position'],
+    'size' => $_POST['button_size'],
+    'position' => $_POST['position'],
+    'count' => isset($_POST['count']),
+    'via' => trim($_POST['via']),
     );
   
-  conf_update_param('TweetThis', implode(',', $conf['TweetThis']));
+  conf_update_param('TweetThis', serialize($conf['TweetThis']));
   array_push($page['infos'], l10n('Information data registered in database'));
   
@@ -22,6 +24,8 @@
 
 $template->assign(array(
-  'button_style' => $conf['TweetThis'][0],
-  'position' => $conf['TweetThis'][1],
+  'button_size' => $conf['TweetThis']['size'],
+  'position' => $conf['TweetThis']['position'],
+  'count_check' => $conf['TweetThis']['count'] ? 'checked="checked"' : null,
+  'via' => $conf['TweetThis']['via'],
   'TWEET_PATH' => TWEET_PATH,
 ));
Index: /extensions/TweetThis/admin.tpl
===================================================================
--- /extensions/TweetThis/admin.tpl	(revision 15121)
+++ /extensions/TweetThis/admin.tpl	(revision 15122)
@@ -8,79 +8,33 @@
 
     <table class="twitter_buttons">
-      <tr>
-        <td><label>
-          <img src="{$TWEET_PATH}images/tweeth.png"/>
-          <input type="radio" name="button_style" value="horizontal" {if $button_style == 'horizontal'}checked="checked"{/if}/>
-        </label></td>
-        <td><label>
-          <img src="{$TWEET_PATH}images/tweetv.png"/>
-          <input type="radio" name="button_style" value="vertical" {if $button_style == 'vertical'}checked="checked"{/if}/>
-        </label></td>
-        <td><label>
-          <img src="{$TWEET_PATH}images/tweetn.png"/>
-          <input type="radio" name="button_style" value="none" {if $button_style == 'none'}checked="checked"{/if}/>
-        </label></td>
-        <td>&nbsp;</td>
+      <tr class="property">
+        <td>
+          {'Button size'|@translate}
+        </td>
+        <td></td>
       </tr>
       <tr>
         <td><label>
-          <img src="http://twitter-badges.s3.amazonaws.com/twitter-a.png"/>
-          <input type="radio" name="button_style" value="twitter-a" {if $button_style == 'twitter-a'}checked="checked"{/if}/>
+          <img src="{$TWEET_PATH}images/small.png"/>
+          <input type="radio" name="button_size" value="small" {if $button_size == 'small'}checked="checked"{/if}/>
         </label></td>
         <td><label>
-          <img src="http://twitter-badges.s3.amazonaws.com/t_logo-a.png"/>
-          <input type="radio" name="button_style" value="t_logo-a" {if $button_style == 't_logo-a'}checked="checked"{/if}/>
-        </label></td>
-        <td><label>
-          <img src="http://twitter-badges.s3.amazonaws.com/t_small-a.png"/>
-          <input type="radio" name="button_style" value="t_small-a" {if $button_style == 't_small-a'}checked="checked"{/if}/>
-        </label></td>
-        <td><label>
-          <img src="http://twitter-badges.s3.amazonaws.com/t_mini-a.png"/>
-          <input type="radio" name="button_style" value="t_mini-a" {if $button_style == 't_mini-a'}checked="checked"{/if}/>
+          <img src="{$TWEET_PATH}images/large.png"/>
+          <input type="radio" name="button_size" value="large" {if $button_size == 'large'}checked="checked"{/if}/>
         </label></td>
       </tr>
-      <tr>
-        <td><label>
-          <img src="http://twitter-badges.s3.amazonaws.com/twitter-b.png"/>
-          <input type="radio" name="button_style" value="twitter-b" {if $button_style == 'twitter-b'}checked="checked"{/if}/>
-        </label></td>
-        <td><label>
-          <img src="http://twitter-badges.s3.amazonaws.com/t_logo-b.png"/>
-          <input type="radio" name="button_style" value="t_logo-b" {if $button_style == 't_logo-b'}checked="checked"{/if}/>
-        </label></td>
-        <td><label>
-          <img src="http://twitter-badges.s3.amazonaws.com/t_small-b.png"/>
-          <input type="radio" name="button_style" value="t_small-b" {if $button_style == 't_small-b'}checked="checked"{/if}/>
-        </label></td>
-        <td><label>
-          <img src="http://twitter-badges.s3.amazonaws.com/t_mini-b.png"/>
-          <input type="radio" name="button_style" value="t_mini-b" {if $button_style == 't_mini-b'}checked="checked"{/if}/>
-        </label></td>
+      <tr class="property">
+        <td>
+          <label for="count">{'Display counter'|@translate}</label>
+        </td>
+        <td>
+          <input type="checkbox" id="count" name="count" value="1" {$count_check}/>
+        </td>
       </tr>
-      <tr>
-        <td><label>
-          <img src="http://twitter-badges.s3.amazonaws.com/twitter-c.png"/>
-          <input type="radio" name="button_style" value="twitter-c" {if $button_style == 'twitter-c'}checked="checked"{/if}/>
-        </label></td>
-        <td><label>
-          <img src="http://twitter-badges.s3.amazonaws.com/t_logo-c.png"/>
-          <input type="radio" name="button_style" value="t_logo-c" {if $button_style == 't_logo-c'}checked="checked"{/if}/>
-        </label></td>
-        <td><label>
-          <img src="http://twitter-badges.s3.amazonaws.com/t_small-c.png"/>
-          <input type="radio" name="button_style" value="t_small-c" {if $button_style == 't_small-c'}checked="checked"{/if}/>
-        </label></td>
-        <td><label>
-          <img src="http://twitter-badges.s3.amazonaws.com/t_mini-c.png"/>
-          <input type="radio" name="button_style" value="t_mini-c" {if $button_style == 't_mini-c'}checked="checked"{/if}/>
-        </label></td>
-      </tr>
-      
       <tr class="property">
-        <td colspan="2">
+        <td>
           {'Button position on picture page'|@translate}
         </td>
-        <td colspan="2">
+        <td>
           <label><input type="radio" name="position" value="top" {if $position == 'top'}checked="checked"{/if}/> {'Top'|@translate}</label>
           <label><input type="radio" name="position" value="bottom" {if $position == 'bottom'}checked="checked"{/if}/> {'Bottom'|@translate}</label>
@@ -88,6 +42,14 @@
         </td>
       </tr>
+      <tr class="property">
+        <td>
+          {'Via'|@translate}
+        </td>
+        <td>
+          @ <input type="text" name="via" value="{$via}"/>
+        </td>
+      </tr>
       <tr class="submit">
-        <td colspan="4">
+        <td colspan="2">
           <input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" />
         </td>
Index: /extensions/TweetThis/language/ca_ES/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/ca_ES/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/ca_ES/plugin.lang.php	(revision 15122)
@@ -23,5 +23,4 @@
 $lang['Bottom'] = 'Inferior';
 $lang['Button position on picture page'] = 'Posició del botó a la pàgina de la imatge';
-$lang['Share on Twitter'] = 'Compartir a Twitter';
 $lang['Toolbar'] = 'Barra d\'eines';
 $lang['Top'] = 'Superior';
Index: /extensions/TweetThis/language/cs_CZ/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/cs_CZ/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/cs_CZ/plugin.lang.php	(revision 15122)
@@ -5,5 +5,4 @@
 $lang['Bottom'] = 'Dole';
 $lang['Toolbar'] = 'Panel nástrojů';
-$lang['Share on Twitter'] = 'Sdílet na Twitteru';
 
 ?>
Index: /extensions/TweetThis/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/de_DE/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/de_DE/plugin.lang.php	(revision 15122)
@@ -23,5 +23,4 @@
 $lang['Bottom'] = 'Unten';
 $lang['Button position on picture page'] = 'Tastenposition auf der Bilderseite';
-$lang['Share on Twitter'] = 'Auf Twitter teilen';
 $lang['Toolbar'] = 'Symbolleiste';
 $lang['Top'] = 'Oben';
Index: /extensions/TweetThis/language/el_GR/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/el_GR/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/el_GR/plugin.lang.php	(revision 15122)
@@ -23,5 +23,4 @@
 $lang['Bottom'] = 'Κάτω μέρος';
 $lang['Button position on picture page'] = 'θέση Κουμπιού στη σελίδα της εικόνας';
-$lang['Share on Twitter'] = 'Μοιραστείτε το στο Twitter';
 $lang['Toolbar'] = 'Γραμμή Εργαλείων';
 $lang['Top'] = 'Κορυφή';
Index: /extensions/TweetThis/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/en_UK/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/en_UK/plugin.lang.php	(revision 15122)
@@ -5,5 +5,7 @@
 $lang['Bottom'] = 'Bottom';
 $lang['Toolbar'] = 'Toolbar';
-$lang['Share on Twitter'] = 'Share on Twitter';
+$lang['Button size'] = 'Button size';
+$lang['Display counter'] = 'Display counts';
+$lang['Via'] = 'Via';
 
 ?>
Index: /extensions/TweetThis/language/es_ES/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/es_ES/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/es_ES/plugin.lang.php	(revision 15122)
@@ -5,5 +5,4 @@
 $lang['Bottom'] = 'Abajo';
 $lang['Toolbar'] = 'Barra de herramientas';
-$lang['Share on Twitter'] = 'Compartir en Twitter';
 
 ?>
Index: /extensions/TweetThis/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/fr_FR/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/fr_FR/plugin.lang.php	(revision 15122)
@@ -5,5 +5,7 @@
 $lang['Bottom'] = 'Bas';
 $lang['Toolbar'] = 'Barre d\'outils';
-$lang['Share on Twitter'] = 'Partager sur Twitter';
+$lang['Button size'] = 'Taille du bouton';
+$lang['Display counter'] = 'Afficcher le compteur';
+$lang['Via'] = 'Via';
 
 ?>
Index: /extensions/TweetThis/language/hu_HU/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/hu_HU/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/hu_HU/plugin.lang.php	(revision 15122)
@@ -5,5 +5,4 @@
 $lang['Bottom'] = 'Lent';
 $lang['Toolbar'] = 'Eszköztár';
-$lang['Share on Twitter'] = 'Megosztás a Twitteren';
 
 ?>
Index: /extensions/TweetThis/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/it_IT/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/it_IT/plugin.lang.php	(revision 15122)
@@ -5,5 +5,4 @@
 $lang['Bottom'] = 'Basso';
 $lang['Toolbar'] = 'Barra degli strumenti';
-$lang['Share on Twitter'] = 'Condividere su Twitter';
 
 ?>
Index: /extensions/TweetThis/language/lv_LV/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/lv_LV/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/lv_LV/plugin.lang.php	(revision 15122)
@@ -5,5 +5,4 @@
 $lang['Bottom'] = 'Apakšā';
 $lang['Toolbar'] = 'Rīkjoslā';
-$lang['Share on Twitter'] = 'Dalīties Tviterī';
 
 ?>
Index: /extensions/TweetThis/language/nl_NL/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/nl_NL/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/nl_NL/plugin.lang.php	(revision 15122)
@@ -4,5 +4,4 @@
 $lang['Bottom'] = 'Onder';
 $lang['Toolbar'] = 'Werkbalk';
-$lang['Share on Twitter'] = 'Deel op Twitter';
 $lang['Button position on picture page'] = 'Knop positie op afbeelding pagina';
 
Index: /extensions/TweetThis/language/pl_PL/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/pl_PL/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/pl_PL/plugin.lang.php	(revision 15122)
@@ -21,5 +21,4 @@
 // | USA.                                                                  |
 // +-----------------------------------------------------------------------+
-$lang['Share on Twitter'] = 'Udostępnij na Twitterze';
 $lang['Bottom'] = 'Dół';
 $lang['Button position on picture page'] = 'Miejsce umieszczenia przycisku';
Index: /extensions/TweetThis/language/pt_PT/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/pt_PT/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/pt_PT/plugin.lang.php	(revision 15122)
@@ -23,5 +23,4 @@
 $lang['Bottom'] = 'Base';
 $lang['Button position on picture page'] = 'Posição do botão na página da foto';
-$lang['Share on Twitter'] = 'Partilhar no Twiter';
 $lang['Toolbar'] = 'Barra de tarefas';
 $lang['Top'] = 'Topo';
Index: /extensions/TweetThis/language/ru_RU/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/ru_RU/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/ru_RU/plugin.lang.php	(revision 15122)
@@ -5,5 +5,4 @@
 $lang['Bottom'] = 'Внизу';
 $lang['Toolbar'] = 'На панели инструментов';
-$lang['Share on Twitter'] = 'Опубликовать в Twitter';
 
 ?>
Index: /extensions/TweetThis/language/sk_SK/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/sk_SK/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/sk_SK/plugin.lang.php	(revision 15122)
@@ -4,5 +4,4 @@
 $lang['Bottom'] = 'Dole';
 $lang['Toolbar'] = 'Lišta nástrojov';
-$lang['Share on Twitter'] = 'Zdieľať na Twitteri';
 $lang['Button position on picture page'] = 'Tlačidlo pozície na stránke fotiek';
 
Index: /extensions/TweetThis/language/sv_SE/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/sv_SE/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/sv_SE/plugin.lang.php	(revision 15122)
@@ -4,5 +4,4 @@
 $lang['Bottom'] = 'Botten';
 $lang['Toolbar'] = 'Verktygsfältet';
-$lang['Share on Twitter'] = 'Dela på Twitter';
 $lang['Button position on picture page'] = 'Knappens position på sidan'; 
 
Index: /extensions/TweetThis/language/tr_TR/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/tr_TR/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/tr_TR/plugin.lang.php	(revision 15122)
@@ -5,5 +5,4 @@
 $lang['Bottom'] = 'Alt';
 $lang['Toolbar'] = 'menübar';
-$lang['Share on Twitter'] = 'Twitter\'da paylaş';
 
 ?>
Index: /extensions/TweetThis/language/uk_UA/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/uk_UA/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/uk_UA/plugin.lang.php	(revision 15122)
@@ -21,5 +21,4 @@
 // | USA.                                                                  |
 // +-----------------------------------------------------------------------+
-$lang['Share on Twitter'] = 'Поділитись на Twitter';
 $lang['Bottom'] = 'Низ';
 $lang['Button position on picture page'] = 'Положення кнопки на сторінці зображення';
Index: /extensions/TweetThis/language/vi_VN/plugin.lang.php
===================================================================
--- /extensions/TweetThis/language/vi_VN/plugin.lang.php	(revision 15121)
+++ /extensions/TweetThis/language/vi_VN/plugin.lang.php	(revision 15122)
@@ -5,5 +5,4 @@
 $lang['Bottom'] = 'Dưới cùng';
 $lang['Toolbar'] = 'Thanh công cụ';
-$lang['Share on Twitter'] = 'Chia sẻ qua Twitter';
 
 ?>
Index: /extensions/TweetThis/main.inc.php
===================================================================
--- /extensions/TweetThis/main.inc.php	(revision 15121)
+++ /extensions/TweetThis/main.inc.php	(revision 15122)
@@ -20,56 +20,41 @@
 function tweet_add_button() 
 {
-  global $conf, $template;
-  $conf['TweetThis'] = explode(',', $conf['TweetThis']);
+  global $conf, $template, $user;
+  
+  $conf['TweetThis'] = unserialize($conf['TweetThis']);
+  $conf['TweetThis']['lang'] = array(
+    'no','de','zh-cn','en','pl','sv','zh-tw','tr','es','th','fa','hu','pt','it','ar','he',
+    'ko','id','ru','ja','da','fi','hi','ur','fr','nl',
+    );
+  
+  $template->assign(array(
+    'TWEET_SIZE' => $conf['TweetThis']['size'],
+    'TWEET_COUNT' => $conf['TweetThis']['count'],
+    'TWEET_VIA' => $conf['TweetThis']['via'],
+  ));
   
   if (script_basename() == 'picture')
   {
-    $template->assign(array(
-      'TWEET_IMAGE' => $conf['TweetThis'][0],
-      'TWEET_POSITON' => $conf['TweetThis'][1],
-    ));
-        
+    $template->assign('TWEET_POSITON', $conf['TweetThis']['position']);
     $template->set_prefilter('picture', 'tweet_add_button_prefilter');
   }
   else if (script_basename() == 'index')
   {
-    $template->assign(array(
-      'TWEET_IMAGE' => $conf['TweetThis'][0],
-      'TWEET_POSITON' => 'index',
-    ));
-        
+    $template->assign('TWEET_POSITON', 'index');
     $template->set_prefilter('index', 'tweet_add_button_prefilter');
   }
   
-  // html change a bit if we use custom button, or official with counter
-  if ( in_array( $conf['TweetThis'][0], array('none','horizontal','vertical') ) )
+  // button language
+  if ( in_array(str_replace('_','-',strtolower($user['language'])), $conf['TweetThis']['lang']) )
   {
-    $template->assign(array(
-      'TWEET_IFRAME' => true,
-      'TWEET_COUNTER' => $conf['TweetThis'][0],
-    ));
+    $template->assign('TWEET_LANG', str_replace('_','-',strtolower($user['language'])));
+  }
+  if ( in_array(substr($user['language'],0,2), $conf['TweetThis']['lang']) )
+  {
+    $template->assign('TWEET_LANG', substr($user['language'],0,2));
   }
   else
   {
-    $template->assign(array(
-      'TWEET_IFRAME' => false,
-      'TWEET_COUNTER' => 'none',
-    ));
-  }
-  
-  // if the link is in the toolbar, we must use smallier buttons
-  if ( script_basename() == 'index' OR  $conf['TweetThis'][1] == 'toolbar')
-  {
-    switch ($conf['TweetThis'][0])
-    {
-      case 'vertical':
-        $template->assign('TWEET_COUNTER', 'horizontal'); break;
-      case 't_logo-a':
-        $template->assign('TWEET_IMAGE', 't_small-a'); break; 
-      case 't_logo-b':
-        $template->assign('TWEET_IMAGE', 't_small-b'); break; 
-      case 't_logo-c':
-        $template->assign('TWEET_IMAGE', 't_small-c'); break;
-    }
+    $template->assign('TWEET_LANG', 'en');
   }
 }
@@ -79,51 +64,29 @@
   global $template;
   
+  $replace = '{combine_script id=\'twitter_widgets\' path=\'http://platform.twitter.com/widgets.js}
+  <a href="https://twitter.com/share" class="twitter-share-button" data-lang="{$TWEET_LANG}" {if not empty($TWEET_VIA)}data-via="{$TWEET_VIA}"{/if} {if $TWEET_SIZE=="large"}data-size="large"{/if} {if not $TWEET_COUNT}data-count="none"{/if}>Tweet</a>';
+  
   switch ($template->get_template_vars('TWEET_POSITON'))
   {
     case 'top':
       $search = '<div id="theImage">';
-      $replace = '
-<div><a href="javascript:phpWGOpenWindow(\'http://twitter.com/share?count={$TWEET_COUNTER}\', \'{\'Share on Twitter\'|@translate}\', \'scrollbars=yes,width=550,height=370\')" 
-        class="{if $TWEET_IFRAME}twitter-share-button{/if}" title="{\'Share on Twitter\'|@translate}">
-  {if $TWEET_IFRAME}Tweet{else}<img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/>{/if}
-</a></div>
-';
+      $replace = '<div>'.$replace.'</div>';
       break;
       
     case 'bottom':
       $search = '{$ELEMENT_CONTENT}';
-      $replace = '
-<a href="javascript:phpWGOpenWindow(\'http://twitter.com/share?count={$TWEET_COUNTER}\', \'{\'Share on Twitter\'|@translate}\', \'scrollbars=yes,width=550,height=370\')" 
-    class="{if $TWEET_IFRAME}twitter-share-button{/if}" title="{\'Share on Twitter\'|@translate}">
-  {if $TWEET_IFRAME}Tweet{else}<img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/>{/if}
-</a>
-';
       break;
       
     case 'toolbar':
-      $search = '{*caddie management END*}';
-      $replace = '
-<a href="javascript:phpWGOpenWindow(\'http://twitter.com/share?count={$TWEET_COUNTER}\', \'{\'Share on Twitter\'|@translate}\', \'scrollbars=yes,width=550,height=370\')" 
-    class="{if $TWEET_IFRAME}twitter-share-button{/if} pwg-button" title="{\'Share on Twitter\'|@translate}">
-  {if $TWEET_IFRAME}Tweet{else}<img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/>{/if}
-</a>
-';
+      $search = '<div class="actionButtons">';
       break;
       
     case 'index':  
       $search = '<ul class="categoryActions">';
-      $replace = '
-{combine_script id=\'scripts\' path=\'themes/default/js/scripts.js\'}
-<li><a href="javascript:phpWGOpenWindow(\'http://twitter.com/share?count={$TWEET_COUNTER}\', \'{\'Share on Twitter\'|@translate}\', \'scrollbars=yes,width=550,height=370\')" 
-        class="{if $TWEET_IFRAME}twitter-share-button{/if} pwg-button" title="{\'Share on Twitter\'|@translate}">
-  {if $TWEET_IFRAME}Tweet{else}<img src="http://twitter-badges.s3.amazonaws.com/{$TWEET_IMAGE}.png"/>{/if}
-</a></li>
-';
+      $replace = '<li>'.$replace.'</li>';
       break;
   }
   
-  $replace = $search . $replace . '{if $TWEET_IFRAME}{combine_script id=\'twitter_widgets\' path=\'http://platform.twitter.com/widgets.js}{/if}';
-
-  return str_replace($search, $replace, $content);
+  return str_replace($search, $search.$replace, $content);
 }
 
@@ -135,12 +98,8 @@
   function tweet_plugin_admin_menu($menu)
   {
-    array_push(
-      $menu,
-      array(
-        'NAME' => 'TweetThis',
-        'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__))
-        )
-      );
-    
+    array_push($menu, array(
+      'NAME' => 'TweetThis',
+      'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__))
+      ));
     return $menu;
   }
Index: /extensions/TweetThis/maintain.inc.php
===================================================================
--- /extensions/TweetThis/maintain.inc.php	(revision 15121)
+++ /extensions/TweetThis/maintain.inc.php	(revision 15122)
@@ -1,6 +1,31 @@
 <?php
 function plugin_install()
-{ 
-  pwg_query('INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("TweetThis","horizontal,toolbar","TweetThis config");');
+{
+  $conf = array(
+    'size' => 'small',
+    'position' => 'toolbar',
+    'count' => true,
+    'via' => null,
+    );
+      
+  conf_update_param('TweetThis', serialize($conf));
+}
+
+function plugin_activate()
+{
+  global $conf;
+  
+  if (@unserialize($conf['TweetThis']) === false)
+  {
+    $conf = explode(',', $conf['TweetThis']);
+    $conf = array(
+      'size' => 'small',
+      'position' => $conf[1],
+      'count' => $conf[1]=='horizontal' || $conf[1]=='vertical',
+      'via' => null,
+      );
+      
+    conf_update_param('TweetThis', serialize($conf));
+  }
 }
 
Index: /extensions/TweetThis/style.css
===================================================================
--- /extensions/TweetThis/style.css	(revision 15121)
+++ /extensions/TweetThis/style.css	(revision 15122)
@@ -23,4 +23,15 @@
 .twitter_buttons tr:last-child td {
   border-bottom:none;
+}
+.twitter_buttons input {
+  background:#eee;
+  border:1px solid #aaa;
+  border-radius:4px;
+  box-shadow:inset 0 1px 0 rgba(0,0,0,0.05);
+  padding:5px;
+}
+.twitter_buttons input:focus {
+  background:#fff;
+  border-color:#3399ff;
 }
 tr.property td, tr.submit td {
