# HG changeset patch
# User Dan
# Date 1238897790 14400
# Node ID 35db370104ab78ff3334842fe72cdd0a7cfc1f0c
# Parent cb96d038baff0f968194c8438a1320e1fa771865
AJAX comments: ranks are now displayed properly in a submitted post.
diff -r cb96d038baff -r 35db370104ab includes/clientside/static/comments.js
--- a/includes/clientside/static/comments.js Sat Apr 04 22:15:51 2009 -0400
+++ b/includes/clientside/static/comments.js Sat Apr 04 22:16:30 2009 -0400
@@ -484,20 +484,28 @@
if ( data.approved != '1' )
tplvars.SUBJECT += ' ' + $lang.get('comment_msg_note_unapp') + '';
- // User level
- tplvars.USER_LEVEL = $lang.get('user_type_guest');
- if ( data.user_level >= data.user_level_list.member ) tplvars.USER_LEVEL = $lang.get('user_type_member');
- if ( data.user_level >= data.user_level_list.mod ) tplvars.USER_LEVEL = $lang.get('user_type_mod');
- if ( data.user_level >= data.user_level_list.admin ) tplvars.USER_LEVEL = $lang.get('user_type_admin');
+ // Name
+ tplvars.NAME = data.name;
+ if ( data.user_id > 1 )
+ tplvars.NAME = '' + data.name + '';
// Avatar
if ( data.user_has_avatar == '1' )
{
- tplvars.AVATAR_URL = scriptPath + '/' + data.avatar_directory + '/' + data.user_id + '.' + data.avatar_type;
+ tplvars.AVATAR_URL = data.avatar_path;
tplvars.USERPAGE_LINK = makeUrlNS('User', data.name);
tplvars.AVATAR_ALT = $lang.get('usercp_avatar_image_alt', { username: data.name });
}
+ // User level
+ tplvars.USER_LEVEL = '';
+ if ( data.rank_data.user_title )
+ tplvars.USER_LEVEL += data.rank_data.user_title;
+ if ( data.rank_data.rank_title && data.rank_data.user_title )
+ tplvars.USER_LEVEL += '
';
+ if ( data.rank_data.rank_title )
+ tplvars.USER_LEVEL += $lang.get(data.rank_data.rank_title);
+
// Send PM link
tplvars.SEND_PM_LINK=(data.user_id>1)?'' + $lang.get('comment_btn_send_privmsg') + '
':'';