includes/comment.php
changeset 328 dc838fd61a06
parent 322 5f1cd51bf1be
child 334 c72b545f1304
--- a/includes/comment.php	Wed Dec 19 23:04:17 2007 -0500
+++ b/includes/comment.php	Thu Dec 20 22:23:07 2007 -0500
@@ -97,6 +97,7 @@
     }
     $ret = Array();
     $ret['mode'] = $data['mode'];
+    $ret['avatar_directory'] = getConfig('avatar_directory');
     switch ( $data['mode'] )
     {
       case 'fetch':
@@ -106,14 +107,14 @@
         {
           $ret['template'] = file_get_contents(ENANO_ROOT . '/themes/' . $template->theme . '/comment.tpl');
         }
-        $q = $db->sql_query('SELECT c.comment_id,c.name,c.subject,c.comment_data,c.time,c.approved,u.user_level,u.user_id,u.signature, b.buddy_id IS NOT NULL AS is_buddy, ( b.is_friend IS NOT NULL AND b.is_friend=1 ) AS is_friend FROM '.table_prefix.'comments AS c
+        $q = $db->sql_query('SELECT c.comment_id,c.name,c.subject,c.comment_data,c.time,c.approved,u.user_level,u.user_id,u.signature,u.user_has_avatar,u.avatar_type, b.buddy_id IS NOT NULL AS is_buddy, ( b.is_friend IS NOT NULL AND b.is_friend=1 ) AS is_friend FROM '.table_prefix.'comments AS c
                                LEFT JOIN '.table_prefix.'users AS u
                                  ON (u.user_id=c.user_id)
                                LEFT JOIN '.table_prefix.'buddies AS b
                                  ON ( ( b.user_id=' . $session->user_id.' AND b.buddy_user_id=c.user_id ) OR b.user_id IS NULL)
                                WHERE page_id=\'' . $this->page_id . '\'
                                  AND namespace=\'' . $this->namespace . '\'
-                               GROUP BY c.comment_id,c.name,c.subject,c.comment_data,c.time,c.approved,u.user_level,u.user_id,u.signature,b.buddy_id,b.is_friend
+                               GROUP BY c.comment_id,c.name,c.subject,c.comment_data,c.time,c.approved,u.user_level,u.user_id,u.signature,u.user_has_avatar,u.avatar_type,b.buddy_id,b.is_friend
                                ORDER BY c.time ASC;');
         $count_appr = 0;
         $count_total = 0;
@@ -302,7 +303,7 @@
             $db->die_json();
           
           // Re-fetch
-          $q = $db->sql_query('SELECT c.comment_id,c.name,c.subject,c.comment_data,c.time,c.approved,u.user_level,u.user_id,u.signature FROM '.table_prefix.'comments AS c
+          $q = $db->sql_query('SELECT c.comment_id,c.name,c.subject,c.comment_data,c.time,c.approved,u.user_level,u.user_id,u.signature,u.user_has_avatar,u.avatar_type FROM '.table_prefix.'comments AS c
                                LEFT JOIN '.table_prefix.'users AS u
                                  ON (u.user_id=c.user_id)
                                WHERE page_id=\'' . $this->page_id . '\'
@@ -334,7 +335,7 @@
           $ret['user_level_list']['member'] = USER_LEVEL_MEMBER;
           $ret['user_level_list']['mod'] = USER_LEVEL_MOD;
           $ret['user_level_list']['admin'] = USER_LEVEL_ADMIN;
-          
+          $ret['avatar_directory'] = getConfig('avatar_directory');
         }
         
         break;