mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-29 18:59:21 +02:00
Fix #287 characterprofile table design
This commit is contained in:
parent
e8a57cbac3
commit
58e6300cf7
@ -21,7 +21,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
|
|
||||||
if ($config['Ach']) {
|
if ($config['Ach']) {
|
||||||
$user_id = (int) $user_id;
|
$user_id = (int) $user_id;
|
||||||
$achievementPoints = mysql_select_single("SELECT SUM(`value`) AS `sum` FROM `player_storage` WHERE `key` LIKE '30___' AND `player_id`=$user_id");
|
$achievementPoints = mysql_select_single("SELECT SUM(`value`) AS `sum` FROM `player_storage` WHERE `key` LIKE '30___' AND `player_id`={$user_id} LIMIT 1");
|
||||||
}
|
}
|
||||||
} else { // TFS 0.2, 0.3
|
} else { // TFS 0.2, 0.3
|
||||||
if (!$loadOutfits) {
|
if (!$loadOutfits) {
|
||||||
@ -35,541 +35,447 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$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');
|
||||||
|
|
||||||
$guild_exist = false;
|
$guild_exist = false;
|
||||||
|
if (get_character_guild_rank($user_id) > 0) {
|
||||||
if (get_character_guild_rank($user_id) > 0)
|
|
||||||
{
|
|
||||||
$guild_exist = true;
|
$guild_exist = true;
|
||||||
$guild = get_player_guild_data($user_id);
|
$guild = get_player_guild_data($user_id);
|
||||||
$guild_name = get_guild_name($guild['guild_id']);
|
$guild_name = get_guild_name($guild['guild_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- PROFILE MARKUP HERE-->
|
<!-- PROFILE MARKUP HERE-->
|
||||||
|
<table id="characterProfileTable">
|
||||||
<!-- Profile name -->
|
<thead>
|
||||||
<h1><?php if ($loadOutfits): ?><img src="<?php echo $config['show_outfits']['imageServer']; ?>?id=<?php echo $profile_data['looktype']; ?>&addons=<?php echo $profile_data['lookaddons']; ?>&head=<?php echo $profile_data['lookhead']; ?>&body=<?php echo $profile_data['lookbody']; ?>&legs=<?php echo $profile_data['looklegs']; ?>&feet=<?php echo $profile_data['lookfeet']; ?>" alt="img"><?php endif; ?><font class="profile_font" name="profile_font_header"><?php echo $profile_data['name']; ?></font></h1>
|
<tr class="yellow">
|
||||||
<ul class="unstyled">
|
<th>
|
||||||
<?php
|
<?php if ($loadOutfits): ?>
|
||||||
$flags = $config['country_flags'];
|
<div class="outfit">
|
||||||
if ($flags['enabled'] && $flags['characterprofile']) {
|
<img src="<?php echo $config['show_outfits']['imageServer']; ?>?id=<?php echo $profile_data['looktype']; ?>&addons=<?php echo $profile_data['lookaddons']; ?>&head=<?php echo $profile_data['lookhead']; ?>&body=<?php echo $profile_data['lookbody']; ?>&legs=<?php echo $profile_data['looklegs']; ?>&feet=<?php echo $profile_data['lookfeet']; ?>" alt="img">
|
||||||
$account_data = user_znote_account_data($profile_data['account_id'], 'flag');
|
</div>
|
||||||
|
<?php endif;
|
||||||
if (strlen($account_data['flag']) > 0):
|
$flags = $config['country_flags'];
|
||||||
?><!-- Player country data -->
|
if ($flags['enabled'] && $flags['characterprofile']) {
|
||||||
<li><font class="profile_font" name="profile_font_country">Country: <?php echo '<img src="' . $flags['server'] . '/' . $account_data['flag'] . '.png">'; ?></font></li>
|
$account_data = user_znote_account_data($profile_data['account_id'], 'flag');
|
||||||
<?php
|
if (strlen($account_data['flag']) > 0):
|
||||||
endif;
|
?><!-- Player country data -->
|
||||||
}
|
<div class="flag">
|
||||||
?>
|
<img src="<?php echo $flags['server'] . '/' . $account_data['flag']; ?>.png">
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
endif;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<h1><?php echo $profile_data['name']; ?></h1>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
<!-- Player Position -->
|
<!-- Player Position -->
|
||||||
<?php if ($profile_data['group_id'] > 1) { ?>
|
<?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>
|
<tr>
|
||||||
<?php } ?>
|
<td>Position</td>
|
||||||
|
<td><?php echo group_id_to_name($profile_data['group_id']); ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
<!-- Player male / female -->
|
<!-- Player male / female -->
|
||||||
<li>
|
<tr>
|
||||||
<font class="profile_font" name="profile_font_level">Sex:
|
<td>Sex</td>
|
||||||
<?php
|
<td><?php echo ($profile_data['sex'] == 1) ? 'Male' : 'Female'; ?></td>
|
||||||
if ($profile_data['sex'] == 1)
|
</tr>
|
||||||
{
|
|
||||||
echo 'Male';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
echo 'Female';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</font>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<!-- Player level -->
|
<!-- Player level -->
|
||||||
<li>
|
<tr>
|
||||||
<font class="profile_font" name="profile_font_level">Level:
|
<td>Level</td>
|
||||||
<?php
|
<td><?php echo $profile_data['level']; ?></td>
|
||||||
echo $profile_data['level'];
|
</tr>
|
||||||
?>
|
|
||||||
</font>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<!-- Player vocation -->
|
<!-- Player vocation -->
|
||||||
<li><font class="profile_font" name="profile_font_vocation">Vocation: <?php echo vocation_id_to_name($profile_data['vocation']); ?></font></li>
|
<tr>
|
||||||
|
<td>Vocation</td>
|
||||||
|
<td><?php echo vocation_id_to_name($profile_data['vocation']); ?></td>
|
||||||
|
</tr>
|
||||||
<!-- Player guild -->
|
<!-- Player guild -->
|
||||||
<?php
|
<?php if ($guild_exist): ?>
|
||||||
if ($guild_exist)
|
<tr>
|
||||||
{
|
<td>Guild</td>
|
||||||
?>
|
<td><b><?php echo $guild['rank_name']; ?> </b> of <a href="guilds.php?name=<?php echo $guild_name; ?>"><?php echo $guild_name; ?></a></td>
|
||||||
<li>
|
</tr>
|
||||||
<font class="profile_font" name="profile_font_vocation">
|
<?php endif; ?>
|
||||||
<b><?php echo $guild['rank_name']; ?> </b> of <a href="guilds.php?name=<?php echo $guild_name; ?>"><?php echo $guild_name; ?></a>
|
|
||||||
</font>
|
|
||||||
</li>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!-- Player last login -->
|
<!-- Player last login -->
|
||||||
<li>
|
<tr>
|
||||||
<font class="profile_font" name="profile_font_lastlogin">Last Login:
|
<td>Last Login</td>
|
||||||
<?php
|
<td><?php echo ($profile_data['lastlogin'] != 0) ? getClock($profile_data['lastlogin'], true, true) : 'Never.'; ?></td>
|
||||||
if ($profile_data['lastlogin'] != 0)
|
</tr>
|
||||||
{
|
|
||||||
echo getClock($profile_data['lastlogin'], true, true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
echo 'Never.';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</font>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<!-- Achievement start -->
|
<!-- Achievement start -->
|
||||||
<?php
|
<?php if ($config['Ach'] && (int)$achievementPoints['sum'] > 0): ?>
|
||||||
if ($config['Ach'])
|
<tr>
|
||||||
{
|
<td>Achievement Points</td>
|
||||||
foreach ($achievementPoints as $achievement)
|
<td><?php echo (int)$achievementPoints['sum']; ?></td>
|
||||||
{
|
</tr>
|
||||||
//if player doesn't have any achievement points it won't echo the line below.
|
<?php endif; ?>
|
||||||
if ($achievement > 0)
|
|
||||||
{
|
|
||||||
echo '<li>Achievement Points: ' . $achievement . '</li>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!-- Achievement end -->
|
|
||||||
|
|
||||||
<!-- Display house start -->
|
<!-- Display house start -->
|
||||||
<?php
|
<?php
|
||||||
if ($config['ServerEngine'] !== 'TFS_02' || $config['ServerEngine'] == 'OTHIRE')
|
if ($config['ServerEngine'] !== 'TFS_02') {
|
||||||
{
|
// Compatibility fix
|
||||||
if ($config['ServerEngine'] == 'OTHIRE')
|
$column_town_id = array(
|
||||||
$townid = 'townid';
|
'OTHIRE' => 'townid',
|
||||||
if ($config['ServerEngine'] == 'TFS_03')
|
'TFS_03' => 'town'
|
||||||
$townid = 'town';
|
// Default: town_id
|
||||||
if ($config['ServerEngine'] !== 'TFS_03' && $config['ServerEngine'] !== 'OTHIRE')
|
);
|
||||||
$townid = 'town_id';
|
$column_town_id = (isset($column_town_id[$config['ServerEngine']]))
|
||||||
$houses = mysql_select_multi("SELECT `id`, `owner`, `name`, `$townid` AS `town_id` FROM `houses` WHERE `owner` = $user_id;");
|
? $column_town_id[$config['ServerEngine']]
|
||||||
|
: 'town_id';
|
||||||
if ($houses)
|
|
||||||
{
|
|
||||||
$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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!-- Display house end -->
|
|
||||||
|
|
||||||
<!-- Display player status -->
|
|
||||||
<li><font class="profile_font" name="profile_font_status">Status:</font> <?php
|
|
||||||
if ($config['ServerEngine'] == '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'])
|
|
||||||
{
|
|
||||||
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 player status end -->
|
|
||||||
|
|
||||||
<!-- Player created -->
|
|
||||||
<li><font class="profile_font" name="profile_font_created">Created: <?php echo getClock($profile_znote_data['created'], true); ?></font></li>
|
|
||||||
|
|
||||||
<!-- Player Comment -->
|
|
||||||
<?php
|
|
||||||
//if player doesnt have set a comment dont show it.
|
|
||||||
if (!empty($profile_znote_data['comment']))
|
|
||||||
{ ?>
|
|
||||||
<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 preg_replace('/\v+|\\\r\\\n/','<br/>',$profile_znote_data['comment']); ?></textarea>
|
|
||||||
</li>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!-- Achievements start -->
|
|
||||||
<?php if ($config['Ach'])
|
|
||||||
{ ?>
|
|
||||||
<h3 class="header-ok">Achievements</h3>
|
|
||||||
<div id="accordion">
|
|
||||||
<h3>Show/hide player achievements</h3>
|
|
||||||
<div>
|
|
||||||
<table class="table table-striped table-bordered">
|
|
||||||
<tbody>
|
|
||||||
<style>
|
|
||||||
#secondD {
|
|
||||||
margin-left:0px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<?php
|
|
||||||
foreach ($config['achievements'] as $key => $achiv)
|
|
||||||
{
|
|
||||||
$uery = mysql_select_single("SELECT `player_id`, `value`, `key` FROM `player_storage` WHERE `player_id`='$user_id' AND `key`='$key' LIMIT 1;");
|
|
||||||
if (!empty($uery) || $uery !== false)
|
|
||||||
{
|
|
||||||
foreach ($uery as $luery)
|
|
||||||
{
|
|
||||||
if ($luery == $key)
|
|
||||||
{
|
|
||||||
if (!array_key_exists($key, $achiv))
|
|
||||||
{
|
|
||||||
echo '<tr><td width="17%">' .$achiv[0]. '</td><td>' .$achiv[1]. '</td>';
|
|
||||||
|
|
||||||
if (!isset($achiv['secret']))
|
|
||||||
{
|
|
||||||
echo '<td><img id="secondD" src="http://img04.imgland.net/PuMz0mVqSG.gif"></td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '<td>'. $achiv['points'] .'</td>';
|
|
||||||
echo '<tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div><br>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!-- Achievements end -->
|
|
||||||
|
|
||||||
<!-- DEATH LIST -->
|
|
||||||
<li>
|
|
||||||
<b>Death List:</b><br>
|
|
||||||
<?php
|
|
||||||
if ($config['ServerEngine'] == 'TFS_02')
|
|
||||||
{
|
|
||||||
$array = user_fetch_deathlist($user_id);
|
|
||||||
if ($array)
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<ul>
|
|
||||||
<?php
|
|
||||||
// Design and present the list
|
|
||||||
foreach ($array as $value)
|
|
||||||
{ ?>
|
|
||||||
<li>
|
|
||||||
<?php
|
|
||||||
$value['time'] = getClock($value['time'], true);
|
|
||||||
|
|
||||||
if ($value['is_player'] == 1)
|
|
||||||
{
|
|
||||||
$value['killed_by'] = 'player: <a href="characterprofile.php?name='. $value['killed_by'] .'">'. $value['killed_by'] .'</a>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$value['killed_by'] = 'monster: '. $value['killed_by'] .'.';
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '['. $value['time'] .'] Killed at level '. $value['level'] .' by '. $value['killed_by']; ?>
|
|
||||||
</li>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
echo '<b><font color="green">This player has never died.</font></b>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ($config['ServerEngine'] == 'TFS_10')
|
|
||||||
{
|
|
||||||
$deaths = mysql_select_multi("SELECT
|
|
||||||
`player_id`, `time`, `level`, `killed_by`, `is_player`,
|
|
||||||
`mostdamage_by`, `mostdamage_is_player`, `unjustified`, `mostdamage_unjustified`
|
|
||||||
FROM `player_deaths`
|
|
||||||
WHERE `player_id`=$user_id ORDER BY `time` DESC LIMIT 10;");
|
|
||||||
|
|
||||||
if ($deaths)
|
$houses = mysql_select_multi("
|
||||||
{
|
SELECT `id`, `owner`, `name`, `{$column_town_id}` AS `town_id`
|
||||||
foreach ($deaths as $d)
|
FROM `houses`
|
||||||
{
|
WHERE `owner` = {$user_id};
|
||||||
?>
|
");
|
||||||
<li>
|
|
||||||
<?php echo "<b>".getClock($d['time'], true, true)."</b>";
|
if ($houses !== false) {
|
||||||
$lasthit = ($d['is_player']) ? "<a href='characterprofile.php?name=".$d['killed_by']."'>".$d['killed_by']."</a>" : $d['killed_by'];
|
foreach ($houses as $h): ?>
|
||||||
echo ": Killed at level ".$d['level']." by $lasthit";
|
<tr>
|
||||||
if ($d['unjustified'])
|
<td>House</td>
|
||||||
{echo " <font color='red' style='font-style: italic;'>(unjustified)</font>";}
|
<td><?php echo $h['name'] . ', ' . $config['towns'][$h['town_id']]; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<!-- Display player status -->
|
||||||
|
<tr class="status_<?php echo ($profile_data['online']) ? 'online' : 'offline'; ?>">
|
||||||
|
<td>Status</td>
|
||||||
|
<td><?php echo ($profile_data['online']) ? 'online' : 'offline'; ?></td>
|
||||||
|
</tr>
|
||||||
|
<!-- Player created -->
|
||||||
|
<tr>
|
||||||
|
<td>Created</td>
|
||||||
|
<td><?php echo getClock($profile_znote_data['created'], true); ?></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<!-- Player Comment -->
|
||||||
|
<?php if (!empty($profile_znote_data['comment'])): ?>
|
||||||
|
<table class="comment">
|
||||||
|
<thead>
|
||||||
|
<tr class="yellow">
|
||||||
|
<td><font class="profile_font" name="profile_font_comment">Comment:</font></td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo preg_replace('/\v+|\\\r\\\n/','<br/>',$profile_znote_data['comment']); ?></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<!-- Achievements start -->
|
||||||
|
<?php if ($config['Ach']):
|
||||||
|
$achievements = mysql_select_multi("
|
||||||
|
SELECT `player_id`, `value`, `key`
|
||||||
|
FROM `player_storage`
|
||||||
|
WHERE `player_id`='$user_id'
|
||||||
|
AND `key` LIKE '30___';
|
||||||
|
");
|
||||||
|
$c_achs = $config['achievements'];
|
||||||
|
$toggle = array(
|
||||||
|
'show' => '<a href="#show">Show</a>',
|
||||||
|
'hide' => '<a href="#hide">Hide</a>'
|
||||||
|
);
|
||||||
|
if ($achievements !== false): ?>
|
||||||
|
<h3>Achievements: <label id="ac_label_hide" for="ac_toggle_hide"><?php echo $toggle['show']; ?></label></h3>
|
||||||
|
<!-- <div id="accordion">
|
||||||
|
<h3>Show/hide player achievements</h3>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div><br> -->
|
||||||
|
<input type="checkbox" id="ac_toggle_hide" name="ac_toggle_hide">
|
||||||
|
<table class="achievements">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Description</th>
|
||||||
|
<th>Points</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach($achievements as $a): ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo $c_achs[$a['key']][0]; ?></td>
|
||||||
|
<td><?php echo $c_achs[$a['key']][1]; ?></td>
|
||||||
|
<td><?php echo $a['value']; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<style type="text/css">
|
||||||
|
table.achievements,
|
||||||
|
#ac_toggle_hide {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
#ac_toggle_hide:checked + table.achievements {
|
||||||
|
display: table;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
document.getElementById("ac_label_hide").addEventListener("click", function(event){
|
||||||
|
event.preventDefault();
|
||||||
|
if (document.getElementById("ac_label_hide").innerHTML == "<?php echo str_replace('"', '\"', $toggle['show']); ?>") {
|
||||||
|
document.getElementById("ac_label_hide").innerHTML = "<?php echo str_replace('"', '\"', $toggle['hide']); ?>";
|
||||||
|
document.getElementById("ac_toggle_hide").checked = true;
|
||||||
|
} else {
|
||||||
|
document.getElementById("ac_label_hide").innerHTML = "<?php echo str_replace('"', '\"', $toggle['show']); ?>";
|
||||||
|
document.getElementById("ac_toggle_hide").checked = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<!-- DEATH LIST -->
|
||||||
|
<table class="deathlist">
|
||||||
|
<thead>
|
||||||
|
<tr class="yellow">
|
||||||
|
<th colspan="2">Death List</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
if ($config['ServerEngine'] == 'TFS_10') {
|
||||||
|
$deaths = mysql_select_multi("
|
||||||
|
SELECT
|
||||||
|
`player_id`,
|
||||||
|
`time`,
|
||||||
|
`level`,
|
||||||
|
`killed_by`,
|
||||||
|
`is_player`,
|
||||||
|
`mostdamage_by`,
|
||||||
|
`mostdamage_is_player`,
|
||||||
|
`unjustified`,
|
||||||
|
`mostdamage_unjustified`
|
||||||
|
FROM `player_deaths`
|
||||||
|
WHERE `player_id`=$user_id
|
||||||
|
ORDER BY `time` DESC
|
||||||
|
LIMIT 10;
|
||||||
|
");
|
||||||
|
|
||||||
|
if ($deaths) {
|
||||||
|
foreach ($deaths as $d) {
|
||||||
|
$lasthit = ($d['is_player'])
|
||||||
|
? "<a href='characterprofile.php?name=".$d['killed_by']."'>".$d['killed_by']."</a>"
|
||||||
|
: $d['killed_by'];
|
||||||
|
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo getClock($d['time'], true, true); ?></td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
echo "Killed at level ".$d['level']." by {$lasthit}";
|
||||||
|
if ($d['unjustified']) {
|
||||||
|
echo " <font color='red' style='font-style: italic;'>(unjustified)</font>";
|
||||||
|
}
|
||||||
$mostdmg = ($d['mostdamage_by'] !== $d['killed_by']) ? true : false;
|
$mostdmg = ($d['mostdamage_by'] !== $d['killed_by']) ? true : false;
|
||||||
|
if ($mostdmg) {
|
||||||
if ($mostdmg)
|
$mostdmg = ($d['mostdamage_is_player'])
|
||||||
{
|
? "<a href='characterprofile.php?name=".$d['mostdamage_by']."'>".$d['mostdamage_by']."</a>"
|
||||||
$mostdmg = ($d['mostdamage_is_player']) ? "<a href='characterprofile.php?name=".$d['mostdamage_by']."'>".$d['mostdamage_by']."</a>" : $d['mostdamage_by'];
|
: $d['mostdamage_by'];
|
||||||
|
|
||||||
echo "<br>and by $mostdmg.";
|
echo "<br>and by $mostdmg.";
|
||||||
|
|
||||||
if ($d['mostdamage_unjustified'])
|
if ($d['mostdamage_unjustified']) {
|
||||||
{ echo " <font color='red' style='font-style: italic;'>(unjustified)</font>"; }
|
echo " <font color='red' style='font-style: italic;'>(unjustified)</font>";
|
||||||
}
|
}
|
||||||
else
|
} else {
|
||||||
{ echo " <b>(soloed)</b>"; }
|
echo " <b>(soloed)</b>";
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</li>
|
</td>
|
||||||
<?php
|
</tr>
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
echo '<b><font color="green">This player has never died.</font></b>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if ($config['ServerEngine'] == 'TFS_03' || $config['ServerEngine'] == 'OTHIRE')
|
|
||||||
{
|
|
||||||
//mysql_select_single("SELECT * FROM players WHERE name='TEST DEBUG';");
|
|
||||||
$array = user_fetch_deathlist03($user_id);
|
|
||||||
|
|
||||||
if ($array)
|
|
||||||
{?>
|
|
||||||
<ul>
|
|
||||||
<?php
|
|
||||||
// Design and present the list
|
|
||||||
foreach ($array as $value)
|
|
||||||
{ ?>
|
|
||||||
<li>
|
|
||||||
<?php
|
|
||||||
$value[3] = user_get_killer_id(user_get_kid($value['id']));
|
|
||||||
|
|
||||||
if ($value[3] !== false && $value[3] >= 1)
|
|
||||||
{
|
|
||||||
$namedata = user_character_data((int)$value[3], 'name');
|
|
||||||
|
|
||||||
if ($namedata !== false)
|
|
||||||
{
|
|
||||||
$value[3] = $namedata['name'];
|
|
||||||
$value[3] = 'player: <a href="characterprofile.php?name='. $value[3] .'">'. $value[3] .'</a>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$value[3] = 'deleted player.';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$value[3] = user_get_killer_m_name(user_get_kid($value['id']));
|
|
||||||
|
|
||||||
if ($value[3] === false)
|
|
||||||
{ $value[3] = 'deleted player.'; }
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '['. getClock($value['date'], true) .'] Killed at level '. $value['level'] .' by '. $value[3];
|
|
||||||
echo '</li>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</ul>
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
else { echo '<b><font color="green">This player has never died.</font></b>'; }
|
} else {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">This player has never died.</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
}
|
}
|
||||||
|
} elseif ($config['ServerEngine'] == 'TFS_02') {
|
||||||
|
$array = user_fetch_deathlist($user_id);
|
||||||
|
if ($array) {
|
||||||
|
foreach ($array as $value):
|
||||||
|
if ($value['is_player'] == 1) {
|
||||||
|
$value['killed_by'] = 'player: <a href="characterprofile.php?name='. $value['killed_by'] .'">'. $value['killed_by'] .'</a>';
|
||||||
|
} else {
|
||||||
|
$value['killed_by'] = 'monster: '. $value['killed_by'] .'.';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo getClock($value['time'], true, true); ?></td>
|
||||||
|
<td><?php echo 'Killed at level '. $value['level'] .' by '. $value['killed_by']; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach;
|
||||||
|
} else {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">This player has never died.</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
} elseif (in_array($config['ServerEngine'], array('TFS_03', 'OTHIRE'))) {
|
||||||
|
//mysql_select_single("SELECT * FROM players WHERE name='TEST DEBUG';");
|
||||||
|
$array = user_fetch_deathlist03($user_id);
|
||||||
|
if ($array) {
|
||||||
|
// Design and present the list
|
||||||
|
foreach ($array as $value):
|
||||||
|
$value[3] = user_get_killer_id(user_get_kid($value['id']));
|
||||||
|
if ($value[3] !== false && $value[3] >= 1) {
|
||||||
|
$namedata = user_character_data((int)$value[3], 'name');
|
||||||
|
if ($namedata !== false) {
|
||||||
|
$value[3] = $namedata['name'];
|
||||||
|
$value[3] = 'player: <a href="characterprofile.php?name='. $value[3] .'">'. $value[3] .'</a>';
|
||||||
|
} else {
|
||||||
|
$value[3] = 'deleted player.';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$value[3] = user_get_killer_m_name(user_get_kid($value['id']));
|
||||||
|
if ($value[3] === false) {
|
||||||
|
$value[3] = 'deleted player.';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo getClock($value['date'], true, true); ?></td>
|
||||||
|
<td><?php echo 'Killed at level '. $value['level'] .' by '. $value[3]; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach;
|
||||||
|
} else {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">This player has never died.</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<!-- QUEST PROGRESSION -->
|
||||||
|
<?php
|
||||||
|
$totalquests = 0;
|
||||||
|
$completedquests = 0;
|
||||||
|
$firstrun = 1;
|
||||||
|
|
||||||
|
if ($config['EnableQuests'] == true) {
|
||||||
|
$sqlquests = mysql_select_multi("
|
||||||
|
SELECT `player_id`, `key`, `value`
|
||||||
|
FROM player_storage
|
||||||
|
WHERE `player_id` = {$user_id}
|
||||||
|
");
|
||||||
|
foreach ($config['quests'] as $cquest) {
|
||||||
|
$totalquests = $totalquests + 1;
|
||||||
|
foreach ($sqlquests as $dbquest) {
|
||||||
|
if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value']) {
|
||||||
|
$completedquests = $completedquests + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($cquest[3] == 1) {
|
||||||
|
if ($completedquests != 0) {
|
||||||
|
if ($firstrun == 1): ?>
|
||||||
|
<b> Quest progression </b>
|
||||||
|
<table id="characterprofileQuest" class="table table-striped table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr class="yellow">
|
||||||
|
<th>Quest:</th>
|
||||||
|
<th>progression:</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$firstrun = 0;
|
||||||
|
endif;
|
||||||
|
$completed = $completedquests / $totalquests * 100;
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo $cquest[2]; ?></td>
|
||||||
|
<td id="progress">
|
||||||
|
<span id="percent"><?php echo round($completed); ?>%</span>
|
||||||
|
<div id="bar" style="width: '.$completed.'%"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
$completedquests = 0;
|
||||||
|
$totalquests = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($firstrun == 0): ?>
|
||||||
|
</tbody></table>
|
||||||
|
<?php endif; ?>
|
||||||
|
<!-- END QUEST PROGRESSION -->
|
||||||
|
|
||||||
|
<!-- CHARACTER LIST -->
|
||||||
|
<?php
|
||||||
|
if (user_character_hide($profile_data['name']) != 1 && user_character_list_count(user_character_account_id($name)) > 1)
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<li>
|
||||||
|
<b>Other visible characters on this account:</b><br>
|
||||||
|
<?php
|
||||||
|
$characters = user_character_list(user_character_account_id($profile_data['name']));
|
||||||
|
// characters: [0] = name, [1] = level, [2] = vocation, [3] = town_id, [4] = lastlogin, [5] = online
|
||||||
|
if ($characters && count($characters) > 0) {
|
||||||
?>
|
?>
|
||||||
</li>
|
<table id="characterprofileTable" class="table table-striped table-hover">
|
||||||
<!-- END DEATH LIST -->
|
<tr class="yellow">
|
||||||
|
<th>Name:</th>
|
||||||
<!-- QUEST PROGRESSION -->
|
<th>Level:</th>
|
||||||
<?php
|
<th>Vocation:</th>
|
||||||
$totalquests = 0;
|
<th>Last login:</th>
|
||||||
$completedquests = 0;
|
<th>Status:</th>
|
||||||
$firstrun = 1;
|
</tr>
|
||||||
|
|
||||||
if ($config['EnableQuests'] == true)
|
<?php
|
||||||
{
|
// Design and present the list
|
||||||
$sqlquests = mysql_select_multi("SELECT `player_id`, `key`, `value` FROM player_storage WHERE `player_id` = $user_id");
|
foreach ($characters as $char) {
|
||||||
foreach ($config['quests'] as $cquest)
|
if ($char['name'] != $profile_data['name']) {
|
||||||
{
|
if (hide_char_to_name(user_character_hide($char['name'])) != 'hidden'): ?>
|
||||||
$totalquests = $totalquests + 1;
|
<tr>
|
||||||
foreach ($sqlquests as $dbquest)
|
<td><a href="characterprofile.php?name=<?php echo $char['name']; ?>"><?php echo $char['name']; ?></a></td>
|
||||||
{
|
<td><?php echo (int)$char['level']; ?></td>
|
||||||
if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value'])
|
<td><?php echo $char['vocation']; ?></td>
|
||||||
{
|
<td><?php echo $char['lastlogin']; ?></td>
|
||||||
$completedquests = $completedquests + 1;
|
<td><?php echo $char['online']; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($cquest[3] == 1)
|
?>
|
||||||
{
|
</table>
|
||||||
if ($completedquests != 0)
|
<?php
|
||||||
{
|
}/* else {
|
||||||
if ($firstrun == 1)
|
echo '<b><font color="green">This player has never died.</font></b>';
|
||||||
{
|
}*/
|
||||||
?>
|
|
||||||
<li>
|
|
||||||
<b> Quest progression </b>
|
|
||||||
<table id="characterprofileQuest" class="table table-striped table-hover">
|
|
||||||
<tr class="yellow">
|
|
||||||
<th>Quest:</th>
|
|
||||||
<th>progression:</th>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
$firstrun = 0;
|
|
||||||
}
|
|
||||||
$completed = $completedquests / $totalquests * 100;
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td><?php echo $cquest[2]; ?></td>
|
|
||||||
<td id="progress">
|
|
||||||
<span id="percent"><?php echo round($completed); ?>%</span>
|
|
||||||
<div id="bar" style="width: '.$completed.'%"></div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
$completedquests = 0;
|
|
||||||
$totalquests = 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($firstrun == 0)
|
|
||||||
{ ?>
|
|
||||||
</table></li>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<!-- END QUEST PROGRESSION -->
|
</li>
|
||||||
|
<?php
|
||||||
<!-- CHARACTER LIST -->
|
}
|
||||||
<?php
|
?>
|
||||||
if (user_character_hide($profile_data['name']) != 1 && user_character_list_count(user_character_account_id($name)) > 1)
|
<!-- END CHARACTER LIST -->
|
||||||
{
|
|
||||||
?>
|
<p class="address">Address: <a href="<?php echo ($config['htwrite']) ? "//" . $_SERVER['HTTP_HOST']."/" . $profile_data['name'] : "//" . $_SERVER['HTTP_HOST'] . "/characterprofile.php?name=" . $profile_data['name']; ?>"><?php echo ($config['htwrite']) ? $_SERVER['HTTP_HOST']."/". $profile_data['name'] : $_SERVER['HTTP_HOST']."/characterprofile.php?name=". $profile_data['name']; ?></a></p>
|
||||||
<li>
|
|
||||||
<b>Other visible characters on this account:</b><br>
|
|
||||||
<?php
|
|
||||||
$characters = user_character_list(user_character_account_id($profile_data['name']));
|
|
||||||
// characters: [0] = name, [1] = level, [2] = vocation, [3] = town_id, [4] = lastlogin, [5] = online
|
|
||||||
if ($characters && count($characters) > 0)
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<table id="characterprofileTable" class="table table-striped table-hover">
|
|
||||||
<tr class="yellow">
|
|
||||||
<th>Name:</th>
|
|
||||||
<th>Level:</th>
|
|
||||||
<th>Vocation:</th>
|
|
||||||
<th>Last login:</th>
|
|
||||||
<th>Status:</th>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
// Design and present the list
|
|
||||||
foreach ($characters as $char)
|
|
||||||
{
|
|
||||||
if ($char['name'] != $profile_data['name'])
|
|
||||||
{
|
|
||||||
if (hide_char_to_name(user_character_hide($char['name'])) != 'hidden')
|
|
||||||
{ ?>
|
|
||||||
<tr>
|
|
||||||
<td><a href="characterprofile.php?name=<?php echo $char['name']; ?>"><?php echo $char['name']; ?></a></td>
|
|
||||||
<td><?php echo (int)$char['level']; ?></td>
|
|
||||||
<td><?php echo $char['vocation']; ?></td>
|
|
||||||
<td><?php echo $char['lastlogin']; ?></td>
|
|
||||||
<td><?php echo $char['online']; ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</table>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
echo '<b><font color="green">This player has never died.</font></b>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</li>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!-- END CHARACTER LIST -->
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<font class="profile_font" name="profile_font_share_url">Address:
|
|
||||||
<a href="
|
|
||||||
<?php
|
|
||||||
if ($config['htwrite'])
|
|
||||||
{
|
|
||||||
echo "http://" . $_SERVER['HTTP_HOST']."/" . $profile_data['name'];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
echo "http://" . $_SERVER['HTTP_HOST'] . "/characterprofile.php?name=" . $profile_data['name'];
|
|
||||||
}
|
|
||||||
?>">
|
|
||||||
<?php
|
|
||||||
if ($config['htwrite'])
|
|
||||||
{
|
|
||||||
echo "http://".$_SERVER['HTTP_HOST']."/". $profile_data['name'];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
echo "http://".$_SERVER['HTTP_HOST']."/characterprofile.php?name=". $profile_data['name'];
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</a></font></li>
|
|
||||||
</ul>
|
|
||||||
<!-- END PROFILE MARKUP HERE-->
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
echo htmlentities(strip_tags($name, ENT_QUOTES)) . ' does not exist.';
|
echo htmlentities(strip_tags($name, ENT_QUOTES)) . ' does not exist.';
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
header('Location: index.php');
|
header('Location: index.php');
|
||||||
}
|
}
|
||||||
|
include 'layout/overall/footer.php'; ?>
|
||||||
include 'layout/overall/footer.php'; ?>
|
|
@ -135,10 +135,11 @@ if ($config['log_ip']) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sub page override system
|
// Sub page override system
|
||||||
|
$filename = explode('/', $_SERVER['PHP_SELF']);
|
||||||
|
$filename = $filename[count($filename)-1];
|
||||||
|
$page_filename = str_replace('.php', '', $filename);
|
||||||
if ($config['allowSubPages']) {
|
if ($config['allowSubPages']) {
|
||||||
require_once 'layout/sub.php';
|
require_once 'layout/sub.php';
|
||||||
$filename = explode('/', $_SERVER['PHP_SELF']);
|
|
||||||
$filename = $filename[count($filename)-1];
|
|
||||||
if (isset($subpages) && !empty($subpages)) {
|
if (isset($subpages) && !empty($subpages)) {
|
||||||
foreach ($subpages as $page) {
|
foreach ($subpages as $page) {
|
||||||
if ($page['override'] && $page['file'] === $filename) {
|
if ($page['override'] && $page['file'] === $filename) {
|
||||||
|
@ -706,4 +706,30 @@ table.hide {
|
|||||||
.auction_char .outfitColumn img {
|
.auction_char .outfitColumn img {
|
||||||
top: -16px;
|
top: -16px;
|
||||||
left: -20px;
|
left: -20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Characterprofile table design */
|
||||||
|
#characterProfileTable thead th:first-of-type {
|
||||||
|
position: relative;
|
||||||
|
width: 28%;
|
||||||
|
}
|
||||||
|
#characterProfileTable thead th:nth-child(2) {
|
||||||
|
/*background-color: red;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
#characterProfileTable thead h1 {
|
||||||
|
text-shadow: none;
|
||||||
|
color: white;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#characterProfileTable .outfit {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: -16px;
|
||||||
|
}
|
||||||
|
#characterProfileTable .flag {
|
||||||
|
position: absolute;
|
||||||
|
right: 16px;
|
||||||
|
top: 16px;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user