Fix #170 Bug in characterprofile.php for TFS 0.2/3.

This commit is contained in:
Stefan Brannfjell 2014-09-22 00:06:20 +02:00
parent 92ef4691f9
commit 3265ba6c99

View File

@ -51,47 +51,62 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
echo 'Never.'; echo 'Never.';
} }
?></font></li> ?></font>
</li>
<!-- Achievement start --> <!-- Achievement start -->
<?php if ($config['Ach'] == true) { <?php
foreach ($achievementPoints as $achievement) if ($config['Ach'] == true) {
{ foreach ($achievementPoints as $achievement) {
if ($achievement > 0) //if player doesn't have any achievement points it won't echo the line below. if ($achievement > 0) //if player doesn't have any achievement points it won't echo the line below.
echo '<tr><td>Achievement Points</td><td>' .$achievement. ' </td></tr>'; echo '<tr><td>Achievement Points</td><td>' .$achievement. ' </td></tr>';
} }
} }
?> ?>
<!-- Achievement end --> <!-- Achievement end -->
<?php $houses = array(); <!-- Display house start -->
$houses = mysql_select_multi("SELECT `id`, `owner`, `name`, `town_id` FROM `houses` WHERE `owner` = $user_id ;"); <?php
if ($houses !== false) { if ($config['TFSVersion'] !== 'TFS_02') {
$playerlist = array(); $townid = ($config['TFSVersion'] === 'TFS_03') ? 'town' : 'town_id';
foreach ($houses as $h) $houses = mysql_select_multi("SELECT `id`, `owner`, `name`, `$townid` AS `town_id` FROM `houses` WHERE `owner` = $user_id;");
if ($h['owner'] > 0) if ($houses !== false) {
$playerlist[] = $h['owner']; $playerlist = array();
foreach ($houses as $h) {
if ($h['owner'] > 0)
$playerlist[] = $h['owner'];
if ($profile_data['id'] = $h['owner']) { ?> if ($profile_data['id'] = $h['owner']) {
<li>House: <?php echo $h['name']; ?>, <?php ?>
foreach ($config['towns'] as $key=>$value) { <li>House: <?php echo $h['name']; ?>, <?php
if ($key == $h['town_id']) { foreach ($config['towns'] as $key=>$value) {
echo $value; if ($key == $h['town_id']) {
} echo $value;
} ?></li> }
<li><font class="profile_font" name="profile_font_status">Status:</font> <?php }} }
if ($config['TFSVersion'] == 'TFS_10') { ?>
if ($profile_data['online']) { </li>
echo '<font class="profile_font" name="profile_font_online" color="green"><b>ONLINE</b></font>'; <?php
} else {
echo '<font class="profile_font" name="profile_font_online" color="red"><b>OFFLINE</b></font>';
}
} else {
if ($profile_data['online'] == 1) {
echo '<font class="profile_font" name="profile_font_online" color="green"><b>ONLINE</b></font>';
} else {
echo '<font class="profile_font" name="profile_font_online" color="red"><b>OFFLINE</b></font>';
} }
} }
?></li> }
}
?>
<!-- Display house end -->
<li><font class="profile_font" name="profile_font_status">Status:</font> <?php
if ($config['TFSVersion'] == 'TFS_10') {
if ($profile_data['online']) {
echo '<font class="profile_font" name="profile_font_online" color="green"><b>ONLINE</b></font>';
} else {
echo '<font class="profile_font" name="profile_font_online" color="red"><b>OFFLINE</b></font>';
}
} else {
if ($profile_data['online'] == 1) {
echo '<font class="profile_font" name="profile_font_online" color="green"><b>ONLINE</b></font>';
} else {
echo '<font class="profile_font" name="profile_font_online" color="red"><b>OFFLINE</b></font>';
}
}
?>
</li>
<li><font class="profile_font" name="profile_font_created">Created: <?php echo getClock($profile_znote_data['created'], true); ?></font></li> <li><font class="profile_font" name="profile_font_created">Created: <?php echo getClock($profile_znote_data['created'], true); ?></font></li>
<li><font class="profile_font" name="profile_font_comment">Comment:</font> <br><textarea name="profile_comment_textarea" cols="70" rows="10" readonly="readonly" class="span12"><?php echo $profile_znote_data['comment']; ?></textarea></li> <li><font class="profile_font" name="profile_font_comment">Comment:</font> <br><textarea name="profile_comment_textarea" cols="70" rows="10" readonly="readonly" class="span12"><?php echo $profile_znote_data['comment']; ?></textarea></li>
<!-- Achievements start --> <!-- Achievements start -->