Merge pull request #235 from gpedro/fix/issue-71

resolves #71
This commit is contained in:
Stefan A. Brannfjell 2016-05-04 23:59:04 +02:00
commit fb32e03ead
2 changed files with 13 additions and 2 deletions

View File

@ -14,7 +14,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false)
{ {
if ($config['TFSVersion'] == 'TFS_10') if ($config['TFSVersion'] == 'TFS_10')
{ {
$profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'sex', 'lastlogin'); $profile_data = user_character_data($user_id, 'account_id', 'name', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'sex', 'lastlogin');
$profile_data['online'] = user_is_online_10($user_id); $profile_data['online'] = user_is_online_10($user_id);
if ($config['Ach']) if ($config['Ach'])
@ -25,7 +25,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false)
} }
else else
{ {
$profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex'); $profile_data = user_character_data($user_id, 'name', 'account_id', 'level', 'group_id', 'vocation', 'health', 'healthmax', 'experience', 'mana', 'manamax', 'lastlogin', 'online', 'sex');
} }
$profile_znote_data = user_znote_character_data($user_id, 'created', 'hide_char', 'comment'); $profile_znote_data = user_znote_character_data($user_id, 'created', 'hide_char', 'comment');
@ -54,6 +54,11 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false)
<li><font class="profile_font" name="profile_font_country">Country: <?php echo '<img src="flags/' . $account_data['flag'] . '.png">'; ?></font></li><?php <li><font class="profile_font" name="profile_font_country">Country: <?php echo '<img src="flags/' . $account_data['flag'] . '.png">'; ?></font></li><?php
} ?> } ?>
<!-- Player Position -->
<?php if ($profile_data['group_id'] > 1) { ?>
<li><font class="profile_font" name="profile_font_position">Position: <?php echo group_id_to_name($profile_data['group_id']); ?></font></li>
<?php } ?>
<!-- Player male / female --> <!-- Player male / female -->
<li> <li>
<font class="profile_font" name="profile_font_level">Sex: <font class="profile_font" name="profile_font_level">Sex:

View File

@ -328,6 +328,12 @@ function vocation_id_to_name($id) {
return ($vocations[$id] >= 0) ? $vocations[$id] : false; return ($vocations[$id] >= 0) ? $vocations[$id] : false;
} }
// Parameter: players.group_id. Returns: Configured group name.
function group_id_to_name($id) {
$positions = config('ingame_positions');
return ($positions[$id] >= 0) ? $positions[$id] : false;
}
function gender_exist($gender) { function gender_exist($gender) {
// Range of allowed gender ids, fromid toid // Range of allowed gender ids, fromid toid
if ($gender >= 0 && $gender <= 1) { if ($gender >= 0 && $gender <= 1) {