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.';
}
?></font></li>
?></font>
</li>
<!-- Achievement start -->
<?php 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.
echo '<tr><td>Achievement Points</td><td>' .$achievement. ' </td></tr>';
}
<?php
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.
echo '<tr><td>Achievement Points</td><td>' .$achievement. ' </td></tr>';
}
}
?>
<!-- Achievement end -->
<?php $houses = array();
$houses = mysql_select_multi("SELECT `id`, `owner`, `name`, `town_id` FROM `houses` WHERE `owner` = $user_id ;");
if ($houses !== false) {
$playerlist = array();
foreach ($houses as $h)
if ($h['owner'] > 0)
$playerlist[] = $h['owner'];
if ($profile_data['id'] = $h['owner']) { ?>
<li>House: <?php echo $h['name']; ?>, <?php
foreach ($config['towns'] as $key=>$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']) {
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>';
<!-- Display house start -->
<?php
if ($config['TFSVersion'] !== 'TFS_02') {
$townid = ($config['TFSVersion'] === 'TFS_03') ? 'town' : 'town_id';
$houses = mysql_select_multi("SELECT `id`, `owner`, `name`, `$townid` AS `town_id` FROM `houses` WHERE `owner` = $user_id;");
if ($houses !== false) {
$playerlist = array();
foreach ($houses as $h) {
if ($h['owner'] > 0)
$playerlist[] = $h['owner'];
if ($profile_data['id'] = $h['owner']) {
?>
<li>House: <?php echo $h['name']; ?>, <?php
foreach ($config['towns'] as $key=>$value) {
if ($key == $h['town_id']) {
echo $value;
}
}
?>
</li>
<?php
}
}
?></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_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 -->