From 622122562f88cf1a2997e0f3f03447d0222de383 Mon Sep 17 00:00:00 2001 From: whiteblXK Date: Wed, 13 Mar 2019 20:39:16 +0100 Subject: [PATCH] Team page - display outfits of the players (configurable) --- TODO | 1 - config.php | 1 + system/pages/team.php | 12 ++++++++++++ system/templates/team.html.twig | 34 ++++++++++++++++++++++++++------- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/TODO b/TODO index 81809218..c51aca1d 100644 --- a/TODO +++ b/TODO @@ -12,7 +12,6 @@ * migrations: option to downgrade the database * create account: create character * csrf token protection - * team page - display outfits of the players (configurable) * guild wars support like in Gesior * Install: create admin account: e-mail + Nazwa postaci * move lostaccount.php to Twig diff --git a/config.php b/config.php index 590f22fa..f0968c44 100644 --- a/config.php +++ b/config.php @@ -184,6 +184,7 @@ $config = array( 'team_display_status' => true, 'team_display_lastlogin' => true, 'team_display_world' => false, + 'team_display_outfit' => true, // bans page 'bans_limit' => 50, diff --git a/system/pages/team.php b/system/pages/team.php index 0032fa9b..202ee1bb 100644 --- a/system/pages/team.php +++ b/system/pages/team.php @@ -21,6 +21,16 @@ if(!$groups->count()) return; } +$outfit_addons = false; +$outfit = ''; +if($config['team_display_outfit']) { + $outfit = ', lookbody, lookfeet, lookhead, looklegs, looktype'; + if($db->hasColumn('players', 'lookaddons')) { + $outfit .= ', lookaddons'; + $outfit_addons = true; + } +} + $groupMember = array(); $groupList = $groups->getGroups(); foreach($groupList as $id => $group) @@ -44,6 +54,8 @@ foreach($groupList as $id => $group) $members[] = array( 'group_name' => $group->getName(), + 'player' => $member, + 'outfit' => $config['team_display_outfit'] ? $config['outfit_images_url'] . '?id=' . $member->getLookType() . ($outfit_addons ? '&addons=' . $member->getLookAddons() : '') . '&head=' . $member->getLookHead() . '&body=' . $member->getLookBody() . '&legs=' . $member->getLookLegs() . '&feet=' . $member->getLookFeet() : null, 'status' => $member->isOnline(), 'link' => getPlayerLink($member->getName()), 'flag_image' => getFlagImage($member->getAccount()->getCountry()), diff --git a/system/templates/team.html.twig b/system/templates/team.html.twig index d0c4abc1..b3353644 100644 --- a/system/templates/team.html.twig +++ b/system/templates/team.html.twig @@ -24,24 +24,28 @@ Group + {% if config.team_display_outfit %} + Outfit + {% endif %} + Name {% if config.team_display_status %} - + Status {% endif %} {% if (config.multiworld or config.team_display_world) %} - + World {% endif %} {% if config.team_display_lastlogin %} - + Last login {% endif %} @@ -52,6 +56,12 @@ {{ group.group_name }} + {% if config.team_display_outfit %} + + player outfit + + {% endif %} + {% if config.account_country %} {{ member.flag_image|raw }} @@ -90,31 +100,41 @@ + {% if config.team_display_outfit %} + + {% endif %} + {% if config.team_display_status %} - {% endif %} {% if (config.multiworld or config.team_display_world) %} - {% endif %} {% if config.team_display_lastlogin %} - {% endif %} {% for member in group.members %} - + + {% if config.team_display_outfit %} + + {% endif %} +
Outfit Name + Status + World + Last login
+ player outfit + {% if config.account_country %} {{ member.flag_image|raw }}