Skip to content

Commit

Permalink
Add outfit to highscores box in tibiacom template
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed Mar 23, 2020
1 parent 64de469 commit 71b4f4a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
13 changes: 12 additions & 1 deletion templates/tibiacom/boxes/highscores.php
@@ -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
));
8 changes: 6 additions & 2 deletions templates/tibiacom/boxes/templates/highscores.html.twig
Expand Up @@ -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>
Expand Down

0 comments on commit 71b4f4a

Please sign in to comment.