Merge pull request #70 from whiteblXK/master

Team page - display outfits of the players (configurable)
This commit is contained in:
slawkens 2019-03-13 22:38:08 +01:00 committed by GitHub
commit f9ea7af3ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 8 deletions

1
TODO
View File

@ -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

View File

@ -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,

View File

@ -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()),

View File

@ -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 }}