Index: /trunk/comments.php
===================================================================
--- /trunk/comments.php	(revision 3599)
+++ /trunk/comments.php	(revision 3600)
@@ -88,5 +88,5 @@
   $page['items_number'] = $_GET['items_number'];
 }
-if ( !is_numeric($page['items_number']) and $page['items_number']!='all' ) 
+if ( !is_numeric($page['items_number']) and $page['items_number']!='all' )
 {
   $page['items_number'] = 10;
@@ -272,6 +272,4 @@
     INNER JOIN '.COMMENTS_TABLE.' AS com
     ON ic.image_id = com.image_id
-    LEFT JOIN '.USERS_TABLE.' As u
-    ON u.'.$conf['user_fields']['id'].' = com.author_id
   WHERE '.implode('
     AND ', $page['where_clauses']).'
@@ -305,5 +303,4 @@
      , com.author
      , com.author_id
-     , '.$conf['user_fields']['username'].' AS username
      , com.date
      , com.content
@@ -312,6 +309,4 @@
     INNER JOIN '.COMMENTS_TABLE.' AS com
     ON ic.image_id = com.image_id
-    LEFT JOIN '.USERS_TABLE.' AS u
-    ON u.'.$conf['user_fields']['id'].' = com.author_id
   WHERE '.implode('
     AND ', $page['where_clauses']).'
@@ -379,17 +374,4 @@
           );
 
-    if (!empty($comment['author']))
-    {
-      $author = $comment['author'];
-      if ($author == 'guest')
-      {
-	$author = l10n('guest');
-      }
-    }
-    else
-    {
-      $author = $comment['username'];
-    }
-
     $tpl_comment =
       array(
@@ -397,5 +379,5 @@
         'TN_SRC' => $thumbnail_src,
         'ALT' => $name,
-        'AUTHOR' => trigger_event('render_comment_author', $author),
+        'AUTHOR' => trigger_event('render_comment_author', $comment['author']),
         'DATE'=>format_date($comment['date'], true),
         'CONTENT'=>trigger_event('render_comment_content',$comment['content']),
Index: /trunk/include/functions_comment.inc.php
===================================================================
--- /trunk/include/functions_comment.inc.php	(revision 3599)
+++ /trunk/include/functions_comment.inc.php	(revision 3600)
@@ -111,5 +111,5 @@
   else
   {
-    $comm['author'] = '';
+    $comm['author'] = addslashes($user['username']);
     $comm['author_id'] = $user['id'];
   }
@@ -172,6 +172,5 @@
 
     if (($comment_action=='validate' and $conf['email_admin_on_comment']) or
-	($comment_action!='validate'
-	 and $conf['email_admin_on_comment_validation']))
+        ($comment_action!='validate' and $conf['email_admin_on_comment_validation']))
     {
       include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
@@ -179,15 +178,7 @@
       $del_url = get_absolute_root_url().'comments.php?delete='.$comm['id'];
 
-      if (empty($comm['author']))
-      {
-        $author_name = $user['username'];
-      }
-      else
-      {
-        $author_name = stripslashes($comm['author']);
-      }
       $keyargs_content = array
       (
-        get_l10n_args('Author: %s', $author_name),
+        get_l10n_args('Author: %s', stripslashes($comm['author']) ),
         get_l10n_args('Comment: %s', stripslashes($comm['content']) ),
         get_l10n_args('', ''),
@@ -206,5 +197,5 @@
       pwg_mail_notification_admins
       (
-        get_l10n_args('Comment by %s', $author_name),
+        get_l10n_args('Comment by %s', stripslashes($comm['author']) ),
         $keyargs_content
       );
Index: /trunk/template/yoga/comment_list.tpl
===================================================================
--- /trunk/template/yoga/comment_list.tpl	(revision 3599)
+++ /trunk/template/yoga/comment_list.tpl	(revision 3600)
@@ -11,5 +11,5 @@
     </div>
     {/if}
-    <div class="description" style="height:{if ($comment.IN_EDIT==1)}200{/if}px">
+    <div class="description" style="height:{if isset($comment.IN_EDIT)}200{/if}px">
       {if isset($comment.U_DELETE) or isset($comment.U_VALIDATE) or isset($comment.U_EDIT) }
       <ul class="actions" style="float:right">
@@ -21,5 +21,5 @@
         </li>
         {/if}
-        {if isset($comment.U_EDIT) and ($comment.IN_EDIT!=1)}
+        {if isset($comment.U_EDIT) and !isset($comment.IN_EDIT)}
         <li>
           <a class="editComment" href="{$comment.U_EDIT}#edit_comment" title="{'edit this comment'|@translate}">
@@ -38,5 +38,5 @@
       {/if}
       <span class="author">{$comment.AUTHOR}</span> - <span class="date">{$comment.DATE}</span>
-      {if ($comment.IN_EDIT==1)}
+      {if isset($comment.IN_EDIT)}
       <a name="edit_comment"></a>
       <form  method="post" action="{$comment.U_EDIT}" class="filter" id="editComment">
