Index: /extensions/SmiliesSupport/admin.php
===================================================================
--- /extensions/SmiliesSupport/admin.php	(revision 15109)
+++ /extensions/SmiliesSupport/admin.php	(revision 15110)
@@ -17,17 +17,20 @@
 {
   // the smilies.txt file is not saved if the directory is changed
-  if (isset($_POST['text1']) AND $_POST['text1'] != $conf_smiliessupport['folder']) 
+  if (isset($_POST['folder']) AND $_POST['folder'] != $conf_smiliessupport['folder']) 
   {
     $not_save_file = true;
     
-    $handle = opendir(SMILIES_PATH.'smilies/'.$_POST['text1']);
-    $i = 0;
-    while (false !== ($file = readdir($handle)))
+    if (!file_exists(SMILIES_PATH.'smilies/'.$_POST['folder'].'/'.$_POST['representant']))
     {
-      if ( $file != '.' AND $file != '..' AND in_array(get_extension($file), array('gif', 'jpg', 'png')) )
+      $handle = opendir(SMILIES_PATH.'smilies/'.$_POST['folder']);
+      $i = 0;
+      while (false !== ($file = readdir($handle)))
       {
-        $_POST['text3'] = $file;
-        closedir($handle);
-        break;
+        if ( $file != '.' AND $file != '..' AND in_array(get_extension($file), array('gif', 'jpg', 'png')) )
+        {
+          $_POST['representant'] = $file;
+          closedir($handle);
+          break;
+        }
       }
     }
@@ -36,9 +39,9 @@
   // new configuration
   $conf_smiliessupport = array(
-    'folder' => isset($_POST['text1']) ? $_POST['text1'] : 'crystal',
-    'cols' => isset($_POST['text2']) ? $_POST['text2'] : '6',
-    'representant' => isset($_POST['text3']) ? $_POST['text3'] : 'smile.png',
+    'folder' => isset($_POST['folder']) ? $_POST['folder'] : 'crystal',
+    'cols' => isset($_POST['cols']) ? $_POST['cols'] : '6',
+    'representant' => isset($_POST['representant']) ? $_POST['representant'] : 'smile.png',
   );
-  if (empty($_POST['text'])) $_POST['text'] = ':)    smile.png';
+  if (empty($_POST['text'])) $_POST['text'] = '';
     
   conf_update_param('smiliessupport', serialize($conf_smiliessupport));
@@ -97,7 +100,7 @@
 
 $template->assign(array(
-  'TEXT1_VALUE' => $conf_smiliessupport['folder'],
-  'TEXT2_VALUE' => $conf_smiliessupport['cols'],
-  'TEXT3_VALUE' => $conf_smiliessupport['representant'],
+  'FOLDER' => $conf_smiliessupport['folder'],
+  'COLS' => $conf_smiliessupport['cols'],
+  'REPRESENTANT' => $conf_smiliessupport['representant'],
   'sets' => $sets,
   'smiliesfiles' => $smilies_table,
@@ -107,5 +110,6 @@
 // get the content of definitions file
 $smilies_file = SMILIES_PATH.'smilies/'.$conf_smiliessupport['folder'].'/smilies.txt';
-if (file_exists($smilies_file)) {
+if (file_exists($smilies_file))
+{
   $content_file = file_get_contents($smilies_file);
   $template->assign(array('CONTENT_FILE' => $content_file));
Index: /extensions/SmiliesSupport/template/markitup/style.markitup.css
===================================================================
--- /extensions/SmiliesSupport/template/markitup/style.markitup.css	(revision 15109)
+++ /extensions/SmiliesSupport/template/markitup/style.markitup.css	(revision 15110)
@@ -1,6 +1,3 @@
 /* common */
-.markItUp {
-  display:inline-block;
-}
 .markItUp * {
   margin:0px; padding:0px;
@@ -13,4 +10,5 @@
 }
 .markItUp textarea {
+  margin-top:0 !important;
   display:block;
 }
@@ -26,4 +24,7 @@
 .markItUpFooter {
   display:none;
+}
+.markItUpHeader {
+  display:inline-block;
 }
 
Index: /extensions/SmiliesSupport/template/smiliessupport_admin.tpl
===================================================================
--- /extensions/SmiliesSupport/template/smiliessupport_admin.tpl	(revision 15109)
+++ /extensions/SmiliesSupport/template/smiliessupport_admin.tpl	(revision 15110)
@@ -38,16 +38,16 @@
     <li>
       <span class="property">{'Smileys\' folder'|@translate}</span>
-      <select name="text1">
-        {html_options options=$sets selected=$TEXT1_VALUE}
+      <select name="folder">
+        {html_options options=$sets selected=$FOLDER}
       </select>
     </li>
     <li>
       <span class="property">{'Nb. columns'|@translate}</span>
-      <input type="text" size="3" name="text2" value="{$TEXT2_VALUE}" />
+      <input type="text" size="3" name="cols" value="{$COLS}" />
     </li>    
     <li>
       <span class="property">{'Representative'|@translate}</span>
-      <select name="text3">
-        {html_options options=$smilies selected=$TEXT3_VALUE}
+      <select name="representant">
+        {html_options options=$smilies selected=$REPRESENTANT}
       </select>
     </li>
Index: /extensions/SmiliesSupport/template/smiliessupport_page.tpl
===================================================================
--- /extensions/SmiliesSupport/template/smiliessupport_page.tpl	(revision 15109)
+++ /extensions/SmiliesSupport/template/smiliessupport_page.tpl	(revision 15110)
@@ -1,4 +1,6 @@
+{if not isset($BBCODE_PATH)}
 {combine_script id="markitup" require='jquery' path=$SMILIES_PATH|@cat:"template/markitup/jquery.markitup.js"}
 {combine_css path=$SMILIES_PATH|@cat:"template/markitup/style.markitup.css"}
+{/if}
 
 {footer_script require='jquery'}
@@ -28,10 +30,10 @@
 
   <ul id="smiliesdiv">
-    <li><table><tr>
+    <li><table><tr>{strip}
     {foreach from=$smiliesfiles item=smileyfile} 
       <td><a href="{$smileyfile.TITLE}"><img src="{$smileyfile.PATH}"/></a></td>
       {$smileyfile.TR}
     {/foreach}
-    </tr></table></li>
+    {/strip}</tr></table></li>
   </ul>
 </li>
