mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-29 02:39:21 +02:00
Fix #429 Various warnings
Rewrote other characters on this account list in characterprofile Added hash_equal() backport for low PHP versions Fixed some warnings
This commit is contained in:
parent
5d9b0f3d00
commit
4b0db861d5
@ -7,7 +7,7 @@ if ($config['log_ip']) {
|
|||||||
if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
||||||
$name = getValue($_GET['name']);
|
$name = getValue($_GET['name']);
|
||||||
$user_id = user_character_exist($name);
|
$user_id = user_character_exist($name);
|
||||||
|
|
||||||
if ($user_id !== false) {
|
if ($user_id !== false) {
|
||||||
$loadOutfits = $config['show_outfits']['characterprofile'];
|
$loadOutfits = $config['show_outfits']['characterprofile'];
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$profile_data['online'] = user_is_online_10($user_id);
|
$profile_data['online'] = user_is_online_10($user_id);
|
||||||
|
|
||||||
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} LIMIT 1");
|
$achievementPoints = mysql_select_single("SELECT SUM(`value`) AS `sum` FROM `player_storage` WHERE `key` LIKE '30___' AND `player_id`={$user_id} LIMIT 1");
|
||||||
@ -42,7 +42,7 @@ 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) {
|
||||||
@ -61,9 +61,9 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
<div class="outfit">
|
<div class="outfit">
|
||||||
<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">
|
<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">
|
||||||
</div>
|
</div>
|
||||||
<?php endif;
|
<?php endif;
|
||||||
$flags = $config['country_flags'];
|
$flags = $config['country_flags'];
|
||||||
if ($flags['enabled'] && $flags['characterprofile']) {
|
if ($flags['enabled'] && $flags['characterprofile']) {
|
||||||
$account_data = user_znote_account_data($profile_data['account_id'], 'flag');
|
$account_data = user_znote_account_data($profile_data['account_id'], 'flag');
|
||||||
if (strlen($account_data['flag']) > 0):
|
if (strlen($account_data['flag']) > 0):
|
||||||
?><!-- Player country data -->
|
?><!-- Player country data -->
|
||||||
@ -131,16 +131,16 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
'TFS_03' => 'town'
|
'TFS_03' => 'town'
|
||||||
// Default: town_id
|
// Default: town_id
|
||||||
);
|
);
|
||||||
$column_town_id = (isset($column_town_id[$config['ServerEngine']]))
|
$column_town_id = (isset($column_town_id[$config['ServerEngine']]))
|
||||||
? $column_town_id[$config['ServerEngine']]
|
? $column_town_id[$config['ServerEngine']]
|
||||||
: 'town_id';
|
: 'town_id';
|
||||||
|
|
||||||
$houses = mysql_select_multi("
|
$houses = mysql_select_multi("
|
||||||
SELECT `id`, `owner`, `name`, `{$column_town_id}` AS `town_id`
|
SELECT `id`, `owner`, `name`, `{$column_town_id}` AS `town_id`
|
||||||
FROM `houses`
|
FROM `houses`
|
||||||
WHERE `owner` = {$user_id};
|
WHERE `owner` = {$user_id};
|
||||||
");
|
");
|
||||||
|
|
||||||
if ($houses !== false) {
|
if ($houses !== false) {
|
||||||
foreach ($houses as $h): ?>
|
foreach ($houses as $h): ?>
|
||||||
<tr>
|
<tr>
|
||||||
@ -161,7 +161,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
<td>Created</td>
|
<td>Created</td>
|
||||||
<td><?php echo getClock($profile_znote_data['created'], true); ?></td>
|
<td><?php echo getClock($profile_znote_data['created'], true); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<!-- EQ shower -->
|
<!-- EQ shower -->
|
||||||
<?php if ($config['EQ_shower']['enabled']): ?>
|
<?php if ($config['EQ_shower']['enabled']): ?>
|
||||||
<tr>
|
<tr>
|
||||||
@ -170,30 +170,30 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
$imageServer = $config['shop']['imageServer'];
|
$imageServer = $config['shop']['imageServer'];
|
||||||
$imageType = $config['shop']['imageType'];
|
$imageType = $config['shop']['imageType'];
|
||||||
$PEQ = mysql_select_multi("
|
$PEQ = mysql_select_multi("
|
||||||
SELECT
|
SELECT
|
||||||
`player_id`,
|
`player_id`,
|
||||||
`pid`,
|
`pid`,
|
||||||
`itemtype`,
|
`itemtype`,
|
||||||
`count`
|
`count`
|
||||||
FROM `player_items`
|
FROM `player_items`
|
||||||
WHERE `player_id`={$user_id}
|
WHERE `player_id`={$user_id}
|
||||||
AND `pid`<'11'
|
AND `pid`<'11'
|
||||||
");
|
");
|
||||||
|
|
||||||
$soulStamina = (in_array($config['ServerEngine'], ['TFS_10']))
|
$soulStamina = (in_array($config['ServerEngine'], ['TFS_10']))
|
||||||
? " `soul`, `stamina`,"
|
? " `soul`, `stamina`,"
|
||||||
: " `p`.`soul`, `p`.`stamina`,";
|
: " `p`.`soul`, `p`.`stamina`,";
|
||||||
|
|
||||||
if ($config['client'] < 780) {
|
if ($config['client'] < 780) {
|
||||||
$soulStamina = " 0 AS `soul`, 0 AS `stamina`,";
|
$soulStamina = " 0 AS `soul`, 0 AS `stamina`,";
|
||||||
}
|
}
|
||||||
|
|
||||||
$player_query = (in_array($config['ServerEngine'], ['TFS_10']))
|
$player_query = (in_array($config['ServerEngine'], ['TFS_10']))
|
||||||
? /* true */ "SELECT
|
? /* true */ "SELECT
|
||||||
`health`, `healthmax`,
|
`health`, `healthmax`,
|
||||||
`mana`, `manamax`,
|
`mana`, `manamax`,
|
||||||
`cap`,
|
`cap`,
|
||||||
`experience`, `level`,
|
`experience`, `level`,
|
||||||
{$soulStamina}
|
{$soulStamina}
|
||||||
`maglevel`,
|
`maglevel`,
|
||||||
`skill_fist`,
|
`skill_fist`,
|
||||||
@ -203,14 +203,14 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
`skill_dist`,
|
`skill_dist`,
|
||||||
`skill_shielding`,
|
`skill_shielding`,
|
||||||
`skill_fishing`
|
`skill_fishing`
|
||||||
FROM `players`
|
FROM `players`
|
||||||
WHERE `id`={$user_id}
|
WHERE `id`={$user_id}
|
||||||
LIMIT 1;"
|
LIMIT 1;"
|
||||||
: /* false */ "SELECT
|
: /* false */ "SELECT
|
||||||
`p`.`health`, `p`.`healthmax`,
|
`p`.`health`, `p`.`healthmax`,
|
||||||
`p`.`mana`, `p`.`manamax`,
|
`p`.`mana`, `p`.`manamax`,
|
||||||
`p`.`cap`,
|
`p`.`cap`,
|
||||||
`p`.`experience`, `p`.`level`,
|
`p`.`experience`, `p`.`level`,
|
||||||
{$soulStamina}
|
{$soulStamina}
|
||||||
`p`.`maglevel`,
|
`p`.`maglevel`,
|
||||||
`fist`.`value` AS `skill_fist`,
|
`fist`.`value` AS `skill_fist`,
|
||||||
@ -220,7 +220,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
`dist`.`value` AS `skill_dist`,
|
`dist`.`value` AS `skill_dist`,
|
||||||
`shield`.`value` AS `skill_shielding`,
|
`shield`.`value` AS `skill_shielding`,
|
||||||
`fish`.`value` AS `skill_fishing`
|
`fish`.`value` AS `skill_fishing`
|
||||||
FROM `players` AS `p`
|
FROM `players` AS `p`
|
||||||
LEFT JOIN `player_skills` AS `fist` ON `p`.`id` = `fist`.`player_id` AND `fist`.`skillid` = 0
|
LEFT JOIN `player_skills` AS `fist` ON `p`.`id` = `fist`.`player_id` AND `fist`.`skillid` = 0
|
||||||
LEFT JOIN `player_skills` AS `club` ON `p`.`id` = `club`.`player_id` AND `club`.`skillid` = 1
|
LEFT JOIN `player_skills` AS `club` ON `p`.`id` = `club`.`player_id` AND `club`.`skillid` = 1
|
||||||
LEFT JOIN `player_skills` AS `sword` ON `p`.`id` = `sword`.`player_id` AND `sword`.`skillid` = 2
|
LEFT JOIN `player_skills` AS `sword` ON `p`.`id` = `sword`.`player_id` AND `sword`.`skillid` = 2
|
||||||
@ -243,7 +243,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
else {
|
else {
|
||||||
$bar_mana = 100;
|
$bar_mana = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
$outfit_server = $config['show_outfits']['imageServer'];
|
$outfit_server = $config['show_outfits']['imageServer'];
|
||||||
$outfit_storage = $config['EQ_shower']['storage_value'];
|
$outfit_storage = $config['EQ_shower']['storage_value'];
|
||||||
|
|
||||||
@ -282,15 +282,15 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$highest_outfit_id = MAX($outfit_list);
|
$highest_outfit_id = MAX($outfit_list);
|
||||||
$outfit_storage_max = $outfit_storage + $highest_outfit_id + 1;
|
$outfit_storage_max = $outfit_storage + $highest_outfit_id + 1;
|
||||||
|
|
||||||
$player_outfits = array();
|
$player_outfits = array();
|
||||||
$storage_sql = mysql_select_multi("
|
$storage_sql = mysql_select_multi("
|
||||||
SELECT `key`, `value`
|
SELECT `key`, `value`
|
||||||
FROM `player_storage`
|
FROM `player_storage`
|
||||||
WHERE `player_id`={$user_id}
|
WHERE `player_id`={$user_id}
|
||||||
AND `key` > {$outfit_storage}
|
AND `key` > {$outfit_storage}
|
||||||
AND `key` < {$outfit_storage_max}
|
AND `key` < {$outfit_storage_max}
|
||||||
");
|
");
|
||||||
if ($storage_sql !== false && !empty($storage_sql)) {
|
if ($storage_sql !== false && !empty($storage_sql)) {
|
||||||
foreach ($storage_sql as $row) {
|
foreach ($storage_sql as $row) {
|
||||||
@ -315,7 +315,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
<div id="piv_lifebar"></div><div id="piv_lifetext"><span><?php echo $playerstats['health']; ?></span></div>
|
<div id="piv_lifebar"></div><div id="piv_lifetext"><span><?php echo $playerstats['health']; ?></span></div>
|
||||||
<div id="piv_manabar"></div><div id="piv_manatext"><span><?php echo $playerstats['mana']; ?></span></div>
|
<div id="piv_manabar"></div><div id="piv_manatext"><span><?php echo $playerstats['mana']; ?></span></div>
|
||||||
<?php if ($PEQ !== false && !empty($PEQ)): foreach($PEQ as $item): ?>
|
<?php if ($PEQ !== false && !empty($PEQ)): foreach($PEQ as $item): ?>
|
||||||
<img class="itm itm-<?php echo $item['pid']; ?>"
|
<img class="itm itm-<?php echo $item['pid']; ?>"
|
||||||
src="<?php echo "http://{$imageServer}/".$item['itemtype'].".{$imageType}"; ?>">
|
src="<?php echo "http://{$imageServer}/".$item['itemtype'].".{$imageType}"; ?>">
|
||||||
<?php endforeach; endif; ?>
|
<?php endforeach; endif; ?>
|
||||||
<span id="piv_cap">Cap:<br><?php echo $playerstats['cap']; ?></span>
|
<span id="piv_cap">Cap:<br><?php echo $playerstats['cap']; ?></span>
|
||||||
@ -387,7 +387,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
/*align-items: center;*/
|
/*align-items: center;*/
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-family: Verdana,Geneva,sans-serif;
|
font-family: Verdana,Geneva,sans-serif;
|
||||||
font-size: 7.0pt;
|
font-size: 7.0pt;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
color: rgb(201,201,201);
|
color: rgb(201,201,201);
|
||||||
@ -633,11 +633,11 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<!-- Achievements start -->
|
<!-- Achievements start -->
|
||||||
<?php if ($config['Ach']):
|
<?php if ($config['Ach']):
|
||||||
$achievements = mysql_select_multi("
|
$achievements = mysql_select_multi("
|
||||||
SELECT `player_id`, `value`, `key`
|
SELECT `player_id`, `value`, `key`
|
||||||
FROM `player_storage`
|
FROM `player_storage`
|
||||||
WHERE `player_id`='$user_id'
|
WHERE `player_id`='$user_id'
|
||||||
AND `key` LIKE '30___';
|
AND `key` LIKE '30___';
|
||||||
");
|
");
|
||||||
$c_achs = $config['achievements'];
|
$c_achs = $config['achievements'];
|
||||||
@ -695,7 +695,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
</script>
|
</script>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<!-- DEATH LIST -->
|
<!-- DEATH LIST -->
|
||||||
<table class="deathlist">
|
<table class="deathlist">
|
||||||
<thead>
|
<thead>
|
||||||
@ -707,50 +707,50 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
<?php
|
<?php
|
||||||
if ($config['ServerEngine'] == 'TFS_10') {
|
if ($config['ServerEngine'] == 'TFS_10') {
|
||||||
$deaths = mysql_select_multi("
|
$deaths = mysql_select_multi("
|
||||||
SELECT
|
SELECT
|
||||||
`player_id`,
|
`player_id`,
|
||||||
`time`,
|
`time`,
|
||||||
`level`,
|
`level`,
|
||||||
`killed_by`,
|
`killed_by`,
|
||||||
`is_player`,
|
`is_player`,
|
||||||
`mostdamage_by`,
|
`mostdamage_by`,
|
||||||
`mostdamage_is_player`,
|
`mostdamage_is_player`,
|
||||||
`unjustified`,
|
`unjustified`,
|
||||||
`mostdamage_unjustified`
|
`mostdamage_unjustified`
|
||||||
FROM `player_deaths`
|
FROM `player_deaths`
|
||||||
WHERE `player_id`=$user_id
|
WHERE `player_id`=$user_id
|
||||||
ORDER BY `time` DESC
|
ORDER BY `time` DESC
|
||||||
LIMIT 10;
|
LIMIT 10;
|
||||||
");
|
");
|
||||||
|
|
||||||
if ($deaths) {
|
if ($deaths) {
|
||||||
foreach ($deaths as $d) {
|
foreach ($deaths as $d) {
|
||||||
$lasthit = ($d['is_player'])
|
$lasthit = ($d['is_player'])
|
||||||
? "<a href='characterprofile.php?name=".$d['killed_by']."'>".$d['killed_by']."</a>"
|
? "<a href='characterprofile.php?name=".$d['killed_by']."'>".$d['killed_by']."</a>"
|
||||||
: $d['killed_by'];
|
: $d['killed_by'];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo getClock($d['time'], true, true); ?></td>
|
<td><?php echo getClock($d['time'], true, true); ?></td>
|
||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
echo "Killed at level ".$d['level']." by {$lasthit}";
|
echo "Killed at level ".$d['level']." by {$lasthit}";
|
||||||
if ($d['unjustified']) {
|
if ($d['unjustified']) {
|
||||||
echo " <font color='red' style='font-style: italic;'>(unjustified)</font>";
|
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'])
|
$mostdmg = ($d['mostdamage_is_player'])
|
||||||
? "<a href='characterprofile.php?name=".$d['mostdamage_by']."'>".$d['mostdamage_by']."</a>"
|
? "<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>";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
@ -767,7 +767,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
} elseif ($config['ServerEngine'] == 'TFS_02') {
|
} elseif ($config['ServerEngine'] == 'TFS_02') {
|
||||||
$array = user_fetch_deathlist($user_id);
|
$array = user_fetch_deathlist($user_id);
|
||||||
if ($array) {
|
if ($array) {
|
||||||
foreach ($array as $value):
|
foreach ($array as $value):
|
||||||
if ($value['is_player'] == 1) {
|
if ($value['is_player'] == 1) {
|
||||||
$value['killed_by'] = 'player: <a href="characterprofile.php?name='. $value['killed_by'] .'">'. $value['killed_by'] .'</a>';
|
$value['killed_by'] = 'player: <a href="characterprofile.php?name='. $value['killed_by'] .'">'. $value['killed_by'] .'</a>';
|
||||||
} else {
|
} else {
|
||||||
@ -803,8 +803,8 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$value[3] = user_get_killer_m_name(user_get_kid($value['id']));
|
$value[3] = user_get_killer_m_name(user_get_kid($value['id']));
|
||||||
if ($value[3] === false) {
|
if ($value[3] === false) {
|
||||||
$value[3] = 'deleted player.';
|
$value[3] = 'deleted player.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -813,7 +813,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
<td><?php echo 'Killed at level '. $value['level'] .' by '. $value[3]; ?></td>
|
<td><?php echo 'Killed at level '. $value['level'] .' by '. $value[3]; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach;
|
<?php endforeach;
|
||||||
} else {
|
} else {
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">This player has never died.</td>
|
<td colspan="2">This player has never died.</td>
|
||||||
@ -833,18 +833,20 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
|
|
||||||
if ($config['EnableQuests'] == true) {
|
if ($config['EnableQuests'] == true) {
|
||||||
$sqlquests = mysql_select_multi("
|
$sqlquests = mysql_select_multi("
|
||||||
SELECT `player_id`, `key`, `value`
|
SELECT `player_id`, `key`, `value`
|
||||||
FROM player_storage
|
FROM player_storage
|
||||||
WHERE `player_id` = {$user_id}
|
WHERE `player_id` = {$user_id}
|
||||||
");
|
");
|
||||||
if (isset($config['quests']) && !empty($config['quests'])) {
|
if (isset($config['quests']) && !empty($config['quests'])) {
|
||||||
foreach ($config['quests'] as $cquest) {
|
foreach ($config['quests'] as $cquest) {
|
||||||
$totalquests = $totalquests + 1;
|
$totalquests = $totalquests + 1;
|
||||||
foreach ($sqlquests as $dbquest) {
|
if ($sqlquests !== false) {
|
||||||
if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value']) {
|
foreach ($sqlquests as $dbquest) {
|
||||||
$completedquests = $completedquests + 1;
|
if ($cquest[0] == $dbquest['key'] && $cquest[1] == $dbquest['value']) {
|
||||||
}
|
$completedquests = $completedquests + 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($cquest[3] == 1) {
|
if ($cquest[3] == 1) {
|
||||||
if ($completedquests != 0) {
|
if ($completedquests != 0) {
|
||||||
if ($firstrun == 1): ?>
|
if ($firstrun == 1): ?>
|
||||||
@ -877,7 +879,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($firstrun == 0): ?>
|
if ($firstrun == 0): ?>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@ -885,55 +887,71 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
|
|
||||||
<!-- CHARACTER LIST -->
|
<!-- CHARACTER LIST -->
|
||||||
<?php
|
<?php
|
||||||
if (user_character_hide($profile_data['name']) != 1 && user_character_list_count(user_character_account_id($name)) > 1)
|
// Backward compatibility
|
||||||
{
|
$select_online = "CASE WHEN `l`.`player_id` IS NULL THEN 0 else 1 END as `online`";
|
||||||
?>
|
$join_online = "LEFT JOIN `players_online` as `l` ON `p`.`id` = `l`.`player_id`";
|
||||||
|
if ($config['ServerEngine'] != 'TFS_10') {
|
||||||
|
$select_online = "`p`.`online`";
|
||||||
|
$join_online = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load other visible characters
|
||||||
|
$otherChars = mysql_select_multi("
|
||||||
|
SELECT
|
||||||
|
`p`.`id`,
|
||||||
|
`p`.`name`,
|
||||||
|
`p`.`level`,
|
||||||
|
`p`.`vocation`,
|
||||||
|
`p`.`lastlogin`,
|
||||||
|
{$select_online}
|
||||||
|
FROM `players` as `o`
|
||||||
|
JOIN `players` as `p`
|
||||||
|
ON `o`.`account_id` = `p`.`account_id`
|
||||||
|
LEFT JOIN `znote_players` as `z`
|
||||||
|
ON `p`.`id` = `z`.`player_id`
|
||||||
|
{$join_online}
|
||||||
|
WHERE `o`.`id` = {$user_id}
|
||||||
|
AND `p`.`id` != `o`.`id`
|
||||||
|
AND `z`.`hide_char` = 0
|
||||||
|
ORDER BY `p`.`experience` DESC;
|
||||||
|
");
|
||||||
|
|
||||||
|
// Render table if there are any characters to show
|
||||||
|
if ($otherChars !== false) {
|
||||||
|
?>
|
||||||
<li>
|
<li>
|
||||||
<b>Other visible characters on this account:</b><br>
|
<b>Other visible characters on this account:</b><br>
|
||||||
<?php
|
<table id="characterprofileTable" class="table table-striped table-hover">
|
||||||
$characters = user_character_list(user_character_account_id($profile_data['name']));
|
<tr class="yellow">
|
||||||
// characters: [0] = name, [1] = level, [2] = vocation, [3] = town_id, [4] = lastlogin, [5] = online
|
<th>Name:</th>
|
||||||
if ($characters && count($characters) > 0) {
|
<th>Level:</th>
|
||||||
?>
|
<th>Vocation:</th>
|
||||||
<table id="characterprofileTable" class="table table-striped table-hover">
|
<th>Last login:</th>
|
||||||
<tr class="yellow">
|
<th>Status:</th>
|
||||||
<th>Name:</th>
|
</tr>
|
||||||
<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 endif;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</table>
|
|
||||||
<?php
|
<?php
|
||||||
}/* else {
|
// Add character rows
|
||||||
echo '<b><font color="green">This player has never died.</font></b>';
|
foreach ($otherChars as $char):
|
||||||
}*/
|
?>
|
||||||
?>
|
<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 vocation_id_to_name($char['vocation']); ?></td>
|
||||||
|
<td><?php echo ($char['lastlogin'] != 0) ? getClock($char['lastlogin'], true, true) : 'Never.'; ?></td>
|
||||||
|
<td><?php echo ($char['online']) ? 'online' : 'offline'; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
endforeach;
|
||||||
|
?>
|
||||||
|
</table>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!-- END CHARACTER LIST -->
|
<!-- 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>
|
<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>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
echo htmlentities(strip_tags($name, ENT_QUOTES)) . ' does not exist.';
|
echo htmlentities(strip_tags($name, ENT_QUOTES)) . ' does not exist.';
|
||||||
|
@ -70,10 +70,10 @@ function generate_recovery_key($lenght) {
|
|||||||
$tmp = rand(1000, 9000);
|
$tmp = rand(1000, 9000);
|
||||||
$tmp += time();
|
$tmp += time();
|
||||||
$tmp = sha1($tmp);
|
$tmp = sha1($tmp);
|
||||||
|
|
||||||
$results = '';
|
$results = '';
|
||||||
for ($i = 0; $i < $lenght; $i++) $results = $results.''.$tmp[$i];
|
for ($i = 0; $i < $lenght; $i++) $results = $results.''.$tmp[$i];
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ function generate_recovery_key($lenght) {
|
|||||||
function calculate_discount($orig, $new) {
|
function calculate_discount($orig, $new) {
|
||||||
$orig = (int)$orig;
|
$orig = (int)$orig;
|
||||||
$new = (int)$new;
|
$new = (int)$new;
|
||||||
|
|
||||||
$tmp = '';
|
$tmp = '';
|
||||||
if ($new >= $orig) {
|
if ($new >= $orig) {
|
||||||
if ($new != $orig) {
|
if ($new != $orig) {
|
||||||
@ -122,14 +122,14 @@ function znote_visitors_get_data() {
|
|||||||
function znote_visitor_set_data($visitor_data) {
|
function znote_visitor_set_data($visitor_data) {
|
||||||
$exist = false;
|
$exist = false;
|
||||||
$ip = getIPLong();
|
$ip = getIPLong();
|
||||||
|
|
||||||
foreach ((array)$visitor_data as $row) {
|
foreach ((array)$visitor_data as $row) {
|
||||||
if ($ip == $row['ip']) {
|
if ($ip == $row['ip']) {
|
||||||
$exist = true;
|
$exist = true;
|
||||||
$value = $row['value'];
|
$value = $row['value'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($exist && isset($value)) {
|
if ($exist && isset($value)) {
|
||||||
// Update the value
|
// Update the value
|
||||||
$value++;
|
$value++;
|
||||||
@ -178,7 +178,7 @@ function create_token() {
|
|||||||
var_dump($token, $token2);
|
var_dump($token, $token2);
|
||||||
$_SESSION['token'] = $token2;
|
$_SESSION['token'] = $token2;
|
||||||
#}
|
#}
|
||||||
|
|
||||||
echo "<input type=\"hidden\" name=\"token\" value=\"". $_SESSION['token'] ."\" />";
|
echo "<input type=\"hidden\" name=\"token\" value=\"". $_SESSION['token'] ."\" />";
|
||||||
}
|
}
|
||||||
function reset_token() {
|
function reset_token() {
|
||||||
@ -393,10 +393,10 @@ function protect_page() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// When function is called, you will be redirected to protect_page and deny access to rest of page, as long as you are not admin.
|
// When function is called, you will be redirected to protect_page and deny access to rest of page, as long as you are not admin.
|
||||||
function admin_only($user_data) {
|
function admin_only($user_data) {
|
||||||
// Chris way
|
// Chris way
|
||||||
$gotAccess = is_admin($user_data);
|
$gotAccess = is_admin($user_data);
|
||||||
|
|
||||||
if ($gotAccess == false) {
|
if ($gotAccess == false) {
|
||||||
logged_in_redirect();
|
logged_in_redirect();
|
||||||
exit();
|
exit();
|
||||||
@ -407,7 +407,7 @@ function is_admin($user_data) {
|
|||||||
if (config('ServerEngine') === 'OTHIRE')
|
if (config('ServerEngine') === 'OTHIRE')
|
||||||
return in_array($user_data['id'], config('page_admin_access')) ? true : false;
|
return in_array($user_data['id'], config('page_admin_access')) ? true : false;
|
||||||
else
|
else
|
||||||
return in_array($user_data['name'], config('page_admin_access')) ? true : false;
|
return in_array($user_data['name'], config('page_admin_access')) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function array_sanitize(&$item) {
|
function array_sanitize(&$item) {
|
||||||
@ -472,7 +472,7 @@ function check_image($image) {
|
|||||||
|
|
||||||
// Last one
|
// Last one
|
||||||
if ($path_info['extension'] === 'gif') {
|
if ($path_info['extension'] === 'gif') {
|
||||||
|
|
||||||
// Resize image
|
// Resize image
|
||||||
$img = resize_imagex($image_data, 100, 100);
|
$img = resize_imagex($image_data, 100, 100);
|
||||||
|
|
||||||
@ -595,4 +595,19 @@ function random_bytes_compat($length, &$crypto_strong = null) {
|
|||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hash_equals legacy support < 5.6
|
||||||
|
if(!function_exists('hash_equals')) {
|
||||||
|
function hash_equals($str1, $str2) {
|
||||||
|
if(strlen($str1) != strlen($str2)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$res = $str1 ^ $str2;
|
||||||
|
$ret = 0;
|
||||||
|
for($i = strlen($res) - 1; $i >= 0; $i--) {
|
||||||
|
$ret |= ord($res[$i]);
|
||||||
|
}
|
||||||
|
return !$ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -105,28 +105,27 @@ function fetchLatestDeaths_03($rowz = 30, $killers = false) {
|
|||||||
|
|
||||||
// Support list
|
// Support list
|
||||||
function support_list() {
|
function support_list() {
|
||||||
$TFS = Config('ServerEngine');
|
$TFS = Config('ServerEngine');
|
||||||
|
if ($TFS == 'TFS_10') $staffs = mysql_select_multi("SELECT `p`.`id`, `a`.`type` as `group_id`, `p`.`name`, `p`.`account_id` FROM `players` AS `p` INNER JOIN `accounts` AS `a` ON `p`.`account_id` = `a`.`id` WHERE `a`.`type` > 1 ORDER BY `p`.`account_id` DESC, `p`.`group_id` ASC, `p`.`level` ASC;");
|
||||||
if ($TFS == 'TFS_10') $staffs = mysql_select_multi("SELECT `p`.`id`, `a`.`type` as `group_id`, `p`.`name`, `p`.`account_id` FROM `players` AS `p` INNER JOIN `accounts` AS `a` ON `p`.`account_id` = `a`.`id` WHERE `a`.`type` > 1 ORDER BY `p`.`account_id` DESC, `p`.`group_id` ASC, `p`.`level` ASC;");
|
else $staffs = mysql_select_multi("SELECT `a`.`type` as `group_id`, `p`.`name`, `p`.`online`, `p`.`account_id` FROM `players` AS `p` INNER JOIN `accounts` AS `a` ON `a`.`id` = `p`.`account_id` WHERE `a`.`type` > 1 ORDER BY `p`.`account_id` DESC, `p`.`group_id` ASC, `p`.`level` ASC;");
|
||||||
else $staffs = mysql_select_multi("SELECT `a`.`type` as `group_id`, `p`.`name`, `p`.`online`, `p`.`account_id` FROM `players` AS `p` INNER JOIN `accounts` AS `a` ON `a`.`id` = `p`.`account_id` WHERE `a`.`type` > 1 ORDER BY `p`.`account_id` DESC, `p`.`group_id` ASC, `p`.`level` ASC;");
|
if ($staffs !== false) {
|
||||||
|
foreach($staffs as $k => $v) {
|
||||||
foreach($staffs as $k => $v) {
|
foreach($staffs as $key => $value) {
|
||||||
foreach($staffs as $key => $value) {
|
if($k != $key && $v['account_id'] == $value['account_id']) {
|
||||||
if($k != $key && $v['account_id'] == $value['account_id']) {
|
unset($staffs[$k]);
|
||||||
unset($staffs[$k]);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$staffs = array_values($staffs);
|
||||||
|
if ($TFS == 'TFS_10') {
|
||||||
|
for ($i = 0; $i < count($staffs); $i++) {
|
||||||
|
// Fix online status on TFS 1.0
|
||||||
|
$staffs[$i]['online'] = (isset($staffs[$i]['id']) && user_is_online_10($staffs[$i]['id'])) ? 1 : 0;
|
||||||
|
unset($staffs[$i]['id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$staffs = array_values($staffs);
|
return $staffs;
|
||||||
|
|
||||||
if ($staffs !== false && $TFS == 'TFS_10') {
|
|
||||||
for ($i = 0; $i < count($staffs); $i++) {
|
|
||||||
// Fix online status on TFS 1.0
|
|
||||||
$staffs[$i]['online'] = (isset($staffs[$i]['id']) && user_is_online_10($staffs[$i]['id'])) ? 1 : 0;
|
|
||||||
unset($staffs[$i]['id']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $staffs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function support_list03() {
|
function support_list03() {
|
||||||
|
@ -124,28 +124,32 @@
|
|||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($guilds) || $guilds !== false) {
|
if (!empty($guilds) && $guilds !== false) {
|
||||||
?>
|
?>
|
||||||
|
<h3><center>Top 10 guilds with most frags</center></h3>
|
||||||
<table id="onlinelistTable" class="table table-striped table-hover">
|
<table id="onlinelistTable" class="table table-striped table-hover">
|
||||||
<tr class="yellow">
|
<tr class="yellow">
|
||||||
<b><tr><h3><center>Top 10 guilds with most frags</center></h3></tr></b>
|
<th>#</th>
|
||||||
<th>#</th>
|
<th>Name:</th>
|
||||||
<th>Name:</th>
|
<th>Frags:</th>
|
||||||
<th>Frags:</th>
|
</tr>
|
||||||
</tr>
|
<?php
|
||||||
<?php foreach ($guilds as $guild) {
|
foreach ($guilds as $guild):
|
||||||
|
$url = url("guilds.php?name=". $guild['name']);
|
||||||
$url = url("guilds.php?name=". $guild['name']);
|
?>
|
||||||
echo '<tr class="special" onclick="javascript:window.location.href=\'' . $url . '\'">'; ?>
|
<tr class="special" onclick="javascript:window.location.href='<?php echo $url; ?>'">
|
||||||
<td><?php echo convert_number_to_words($count);
|
<td><?php
|
||||||
$count++; ?></td>
|
echo convert_number_to_words($count);
|
||||||
<td><a href="" onclick="return false"><?php echo $guild['name']; ?></a></td>
|
$count++;
|
||||||
<td><?php echo $guild['frags']; ?></td>
|
?></td>
|
||||||
</tr>
|
<td><a href="" onclick="return false"><?php echo $guild['name']; ?></a></td>
|
||||||
<?php } ?>
|
<td><?php echo $guild['frags']; ?></td>
|
||||||
</table>
|
</tr>
|
||||||
|
<?php
|
||||||
<?php
|
endforeach; ?>
|
||||||
} else echo '<h1>No frags yet.</h1>';
|
</table>
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
echo '<h1>No frags yet.</h1>';
|
||||||
|
}
|
||||||
include 'layout/overall/footer.php'; ?>
|
include 'layout/overall/footer.php'; ?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user