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 @@ <span><b>Group</b></span> </td> + {% if config.team_display_outfit %} + <td width="5%"><span><b>Outfit</b></span></td> + {% endif %} + <td width="40%"> <span><b>Name</b></span> </td> {% if config.team_display_status %} - <td width="10%"> + <td> <span><b>Status</b></span> </td> {% endif %} {% if (config.multiworld or config.team_display_world) %} - <td width="20%"> + <td> <span><b>World</b></span> </td> {% endif %} {% if config.team_display_lastlogin %} - <td width="20%"> + <td> <span><b>Last login</b></span> </td> {% endif %} @@ -52,6 +56,12 @@ <tr> <td>{{ group.group_name }}</td> + {% if config.team_display_outfit %} + <td> + <img style="position:absolute;margin-top:{% if member.player.looktype in [75, 266, 302] %}-20px;margin-left:-0px;{% else %}-45px;margin-left:-25px;{% endif %}" src="{{ member.outfit }}" alt="player outfit"/> + </td> + {% endif %} + <td> {% if config.account_country %} {{ member.flag_image|raw }} @@ -90,31 +100,41 @@ <table cellspacing="1" cellpadding="4" border="0" width="100%"> <tr> + {% if config.team_display_outfit %} + <td width="5%"><span><b>Outfit</b></span></td> + {% endif %} + <td width="40%"> <span><b>Name</b></span> </td> {% if config.team_display_status %} - <td width="20%"> + <td> <span><b>Status</b></span> </td> {% endif %} {% if (config.multiworld or config.team_display_world) %} - <td width="20%"> + <td> <span><b>World</b></span> </td> {% endif %} {% if config.team_display_lastlogin %} - <td width="20%"> + <td> <span><b>Last login</b></span> </td> {% endif %} </tr> {% for member in group.members %} - <tr> + <tr> + {% if config.team_display_outfit %} + <td> + <img style="position:absolute;margin-top:{% if member.player.looktype in [75, 266, 302] %}-20px;margin-left:-0px;{% else %}-45px;margin-left:-25px;{% endif %}" src="{{ member.outfit }}" alt="player outfit"/> + </td> + {% endif %} + <td> {% if config.account_country %} {{ member.flag_image|raw }}