diff --git a/templates/tibiacom/boxes/highscores.php b/templates/tibiacom/boxes/highscores.php index e46a3e81..808bb237 100644 --- a/templates/tibiacom/boxes/highscores.php +++ b/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 )); diff --git a/templates/tibiacom/boxes/templates/highscores.html.twig b/templates/tibiacom/boxes/templates/highscores.html.twig index 50b98c1c..d1f455ee 100644 --- a/templates/tibiacom/boxes/templates/highscores.html.twig +++ b/templates/tibiacom/boxes/templates/highscores.html.twig @@ -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"> {{ 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"> Level: ({{ player['level'] }})</span></small> + <small><span style="color: white; margin-left: 50px">Level: ({{ player['level'] }})</span></small> <br> </a> </div>