Index: /extensions/bbcode_bar/admin.php
===================================================================
--- /extensions/bbcode_bar/admin.php	(revision 9764)
+++ /extensions/bbcode_bar/admin.php	(revision 9765)
@@ -11,6 +11,5 @@
 	// nouveau tableau de config
 	unset($conf_bbcode_bar);
-	for ($i=0; $i<=15; $i++)
-	{
+	for ($i=0; $i<=15; $i++) {
 		$conf_bbcode_bar[] = (isset($_POST['chkb'.sprintf("%02d", $i)])) ? $_POST['chkb'.sprintf("%02d", $i)] : 0;
 	}
@@ -24,10 +23,8 @@
     pwg_query($query);
     array_push($page['infos'], l10n('Information data registered in database'));
-	
 }
 
 // Parametrage du template
-for ($i=0; $i<=15; $i++)
-{
+for ($i=0; $i<=15; $i++) {
 	$template->assign('CHKB'.sprintf("%02d", $i).'_STATUS', ($conf_bbcode_bar[$i] == 1) ? 'checked="checked"' : null);
 }
Index: /extensions/bbcode_bar/bbcode.js
===================================================================
--- /extensions/bbcode_bar/bbcode.js	(revision 9764)
+++ /extensions/bbcode_bar/bbcode.js	(revision 9765)
@@ -49,5 +49,5 @@
 		bbcode[form+field+code] = 1;
 	} else {
-		ToAdd = "\n[/"+code+"]\n";
+		ToAdd = "[/li]\n[/"+code+"]\n";
 		re = new RegExp(code+"1.(\\w+)$");
 		img.src = img.src.replace(re, code+".$1");
Index: /extensions/bbcode_bar/bbcode_bar.inc.php
===================================================================
--- /extensions/bbcode_bar/bbcode_bar.inc.php	(revision 9764)
+++ /extensions/bbcode_bar/bbcode_bar.inc.php	(revision 9765)
@@ -4,5 +4,5 @@
 function set_bbcode_bar()
 {
-	global $template, $conf, $lang, $user, $pwg_loaded_plugins;
+	global $template, $conf, $lang, $user, $pwg_loaded_plugins, $page;
 	load_language('plugin.lang', dirname(__FILE__) . '/');
 	$conf_bbcode_bar = explode("," , $conf['bbcode_bar']);
@@ -10,23 +10,21 @@
 
 	// buttons
-	for ($i=0; $i<=15; $i++)
-	{
+	for ($i=0; $i<=15; $i++) {
 		if ($conf_bbcode_bar[$i] == 1) $template->assign('BBCode_bar_button_'.sprintf("%02d", $i), true);
 	}
 	$template->assign('repicon', $conf_bbcode_bar[16]);
 	
-	// edit field has a different id
-	if (isset($_GET['action']) AND $_GET['action'] == 'edit_comment')
-	{
+	// edit field has different id
+	if (
+		(isset($_GET['action']) AND $_GET['action'] == 'edit_comment') 
+		OR (isset($page['body_id']) AND $page['body_id'] == 'theCommentsPage')
+	) {
 		$template->assign('form_name', 'editComment');
-	}
-	else
-	{
+	} else {
 		$template->assign('form_name', 'addComment');
 	}
 
 	// smilies support
-	if (isset($pwg_loaded_plugins['SmiliesSupport']))
-	{
+	if (isset($pwg_loaded_plugins['SmiliesSupport'])) {
 		$template->assign('BBCode_bar_SmiliesSupport', array('SMILIESSUPPORT_PAGE' => SmiliesTable()));
 	}
@@ -66,10 +64,7 @@
 					while (($temp = array_pop($tags)))
 					{
-						if ($temp != $tag)
-						{
+						if ($temp != $tag) {
 							$before_tag.='[/'.$temp.']';
-						}
-						else 
-						{
+						} else {
 							$before_tag.='[/'.$tag.']';
 							break;
@@ -78,7 +73,5 @@
 					$end_pos += strlen($before_tag)+strlen($after_tag)-strlen($str);
 					$str = $before_tag.$after_tag;
-				} 
-				else 
-				{ // push stack
+				} else { // push stack
 					array_push($tags,$tag);
 				}
@@ -233,3 +226,4 @@
 	return preg_replace($patterns, $replacements, $str);
 }
+
 ?>
Index: /extensions/bbcode_bar/bbcode_bar_admin.tpl
===================================================================
--- /extensions/bbcode_bar/bbcode_bar_admin.tpl	(revision 9764)
+++ /extensions/bbcode_bar/bbcode_bar_admin.tpl	(revision 9765)
@@ -7,4 +7,5 @@
 <form method="post" action="" class="properties" ENCTYPE="multipart/form-data"> 
 	<fieldset>
+		<legend>{'Parameters'|@translate}</legend>
 		<ul>
 			<li>
@@ -61,7 +62,4 @@
 			</li>
 			<li>
-				&nbsp;
-			</li>
-			<li>
 				<span class="property">{'size_help'|@translate}</span>
 				<input type="checkbox" name="chkb13" {$CHKB13_STATUS} value="1" />
Index: /extensions/bbcode_bar/main.inc.php
===================================================================
--- /extensions/bbcode_bar/main.inc.php	(revision 9764)
+++ /extensions/bbcode_bar/main.inc.php	(revision 9765)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: BBCode Bar
-Version: 2.2.0
+Version: 2.2.a
 Description: Allow use BBCode for comments and descriptions.
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=140
@@ -20,5 +20,12 @@
 	remove_event_handler('render_comment_content', 'render_comment_content');
 	add_event_handler('render_comment_content', 'BBCodeParse');
-	add_event_handler('loc_begin_picture', 'set_bbcode_bar');
+	add_event_handler('loc_after_page_header', 'add_bbcode_bar');
+}
+
+function add_bbcode_bar() {
+	global $page;
+	if ($page['body_id'] == 'theCommentsPage' OR $page['body_id'] == 'thePicturePage') {
+		set_bbcode_bar();
+	}
 }
 
@@ -35,3 +42,4 @@
 	}
 }
+
 ?>
