Add outfit to highscores box in tibiacom template

This commit is contained in:
slawkens 2020-03-23 15:46:43 +01:00
parent 64de46943b
commit 71b4f4a64a
2 changed files with 18 additions and 3 deletions

View File

@ -1,5 +1,16 @@
<?php
$topPlayers = getTopPlayers(5);
foreach($topPlayers as &$player) {
$outfit_url = '';
if($config['online_outfit']) {
$outfit_url = $config['outfit_images_url'] . '?id=' . $player['looktype'] . (!empty
($player['lookaddons']) ? '&addons=' . $player['lookaddons'] : '') . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'];
$player['outfit'] = $outfit_url;
}
}
$twig->display('highscores.html.twig', array(
'topPlayers' => getTopPlayers(5)
'topPlayers' => $topPlayers
));

View File

@ -45,9 +45,13 @@
<div class="top_level" style="background:url({{ template_path }}/images/themeboxes/bg_top.png)" align=" ">
{% for player in topPlayers %}
<div style="text-align:left"><a href="{{ getPlayerLink(player['name'], false) }} " class="topfont {% if player['online'] %}online{% else %}offline{% endif %}">
<span style="color: #CCC">&nbsp;&nbsp;&nbsp;&nbsp;{{ player['rank'] }} - </span>{{ player['name'] }}
{% if config.online_outfit %}
<img style="position:absolute;margin-top:{% if player.looktype in [75, 266, 302] %}-20px;margin-left:-0px;{% else %}-45px;margin-left:-25px;{% endif %}" src="{{ player.outfit }}" alt="player outfit"/>
{% endif %}
<span style="color: #CCC; margin-left: 40px">{{ player['rank'] }} - </span>
{{ player['name'] }}
<br>
<small><span style="color: white">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Level: ({{ player['level'] }})</span></small>
<small><span style="color: white; margin-left: 50px">Level: ({{ player['level'] }})</span></small>
<br>
</a>
</div>