mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
* added player status to tibiacom top 5 highscores box
* fix when there are no changelogs or highscores yet
This commit is contained in:
parent
3e49ef42a2
commit
01c0d021b2
@ -974,7 +974,15 @@ function getTopPlayers($limit = 5) {
|
|||||||
if(fieldExist('deletion', 'players'))
|
if(fieldExist('deletion', 'players'))
|
||||||
$deleted = 'deletion';
|
$deleted = 'deletion';
|
||||||
|
|
||||||
$players = $db->query('SELECT `id`, `name`, `level`, `experience` FROM `players` WHERE `group_id` < ' . $config['highscores_groups_hidden'] . ' AND `id` NOT IN (' . implode(', ', $config['highscores_ids_hidden']) . ') AND `' . $deleted . '` = 0 AND `account_id` != 1 ORDER BY `experience` DESC LIMIT ' . (int)$limit)->fetchAll();
|
$is_tfs10 = tableExist('players_online');
|
||||||
|
$players = $db->query('SELECT `id`, `name`, `level`, `experience`' . ($is_tfs10 ? '' : ', `online`') . ' FROM `players` WHERE `group_id` < ' . $config['highscores_groups_hidden'] . ' AND `id` NOT IN (' . implode(', ', $config['highscores_ids_hidden']) . ') AND `' . $deleted . '` = 0 AND `account_id` != 1 ORDER BY `experience` DESC LIMIT ' . (int)$limit)->fetchAll();
|
||||||
|
|
||||||
|
if($is_tfs10) {
|
||||||
|
foreach($players as &$player) {
|
||||||
|
$query = $db->query('SELECT `player_id` FROM `players_online` WHERE `player_id` = ' . $player['id']);
|
||||||
|
$player['online'] = ($query->rowCount() > 0 ? 1 : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach($players as &$player) {
|
foreach($players as &$player) {
|
||||||
|
@ -228,8 +228,10 @@ echo '
|
|||||||
$show_link_to_next_page = true;
|
$show_link_to_next_page = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$i)
|
if(!$i) {
|
||||||
echo '<tr bgcolor="' . $config['darkborder'] . '"><td colspan="' . ($skill == POT::SKILL__LEVEL ? 5 : 4) . '">No records yet.</td></tr>';
|
$extra = ($config['highscores_outfit'] ? 1 : 0);
|
||||||
|
echo '<tr bgcolor="' . $config['darkborder'] . '"><td colspan="' . ($skill == POT::SKILL__LEVEL ? 5 + $extra : 4 + $extra) . '">No records yet.</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</table>
|
</table>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<tr>
|
<tr>
|
||||||
<td bgcolor="{{ config.lightborder }}">There are no change logs for the moment.</td>
|
<td colspan="4" bgcolor="{{ config.darkborder }}">There are no changelogs for the moment.</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@ -26,12 +26,17 @@
|
|||||||
|
|
||||||
#Topbar a {
|
#Topbar a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
cursor: auto;
|
}
|
||||||
|
.online {
|
||||||
|
color: #008000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.offline {
|
||||||
|
color: #FF0000;
|
||||||
}
|
}
|
||||||
a.topfont {
|
a.topfont {
|
||||||
font-family: Verdana, Arial, Helvetica;
|
font-family: Verdana, Arial, Helvetica;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
color: #FF0000;
|
|
||||||
text-decoration: none
|
text-decoration: none
|
||||||
}
|
}
|
||||||
a:hover.topfont {
|
a:hover.topfont {
|
||||||
@ -47,7 +52,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
foreach(getTopPlayers(5) as $player) {
|
foreach(getTopPlayers(5) as $player) {
|
||||||
echo '<div align="left"><a href="'.getPlayerLink($player['name'], false).'" class="topfont">
|
echo '<div align="left"><a href="'.getPlayerLink($player['name'], false).'" class="topfont ' . ($player['online'] == 1 ? 'online' : 'offline') . '">
|
||||||
<font color="#CCC"> '.$player['rank'].' - </font>'.$player['name'].'
|
<font color="#CCC"> '.$player['rank'].' - </font>'.$player['name'].'
|
||||||
<br>
|
<br>
|
||||||
<small><font color="white"> Level: ('.$player['level'].')</font></small>
|
<small><font color="white"> Level: ('.$player['level'].')</font></small>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user