diff --git a/system/pages/team.php b/system/pages/team.php
index e06d84a9..0032fa9b 100644
--- a/system/pages/team.php
+++ b/system/pages/team.php
@@ -21,15 +21,7 @@ if(!$groups->count())
return;
}
-$newStyle = ($config['team_style'] == 2);
-if(!$newStyle)
-{
- echo '
Support in game
- ' . getGroupHeader();
-}
-
-$group_tmp = array();
-$i = 0;
+$groupMember = array();
$groupList = $groups->getGroups();
foreach($groupList as $id => $group)
{
@@ -40,87 +32,33 @@ foreach($groupList as $id => $group)
if(!count($group_members))
continue;
- $members_count = 0;
- $groupNames = array();
+ $members = array();
foreach($group_members as $member)
{
if(!admin() && $member->isHidden())
continue;
- $members_count++;
- $flag = '';
- if($config['account_country'])
- $flag = getFlagImage($member->getAccount()->getCountry());
+ $lastLogin = 'Never.';
+ if($member->getLastLogin() > 0)
+ $lastLogin = date("j F Y, g:i a", $member->getLastLogin());
- $tmp = '';
- if(!$newStyle)
- $tmp .= '' . ucfirst($group->getName()) . ' | ';
-
- $tmp .= '' . $flag . ' ' . getPlayerLink($member->getName()) . ' | ';
- if($config['team_display_status'])
- $tmp .= '' . ($member->isOnline() > 0 ? 'Online' : 'Offline') . ' | ';
-
- if($config['multiworld'] || $config['team_display_world'])
- $tmp .= '' . getWorldName($member->getWorldId()) . ' | ';
-
- $lastLogin = '';
- if($config['team_display_lastlogin'])
- {
- $lastLogin = 'Never.';
- if($member->getLastLogin() > 0)
- $lastLogin = date("j F Y, g:i a", $member->getLastLogin());
- }
-
- $tmp .= '' . $lastLogin . ' |
';
- if($newStyle)
- {
- if(isset($groupNames[$group->getName()]))
- $groupNames[$group->getName()] .= $tmp;
- else
- $groupNames[$group->getName()] = $tmp;
- }
- else
- echo $tmp;
+ $members[] = array(
+ 'group_name' => $group->getName(),
+ 'status' => $member->isOnline(),
+ 'link' => getPlayerLink($member->getName()),
+ 'flag_image' => getFlagImage($member->getAccount()->getCountry()),
+ 'world_name' => getWorldName($member->getWorldId()),
+ 'last_login' => $lastLogin
+ );
}
- if($newStyle && $members_count > 0)
- {
- $group_tmp[$id] = '' . ucfirst($group->getName()) . 's
- ' . getGroupHeader(false) . $groupNames[$group->getName()] . '
';
- }
+ $groupMember[] = array(
+ 'group_name' => $group->getName(),
+ 'members' => $members
+ );
}
-if($newStyle)
-{
- for($i = $id; $i >= 0; $i--)
- {
- if(isset($group_tmp[$i]))
- echo $group_tmp[$i];
- }
-}
-else
- echo '
';
-
-function getGroupHeader($groupField = true)
-{
- global $config;
-
- $ret = '';
- if($groupField)
- $ret .= 'Group | ';
-
- $ret .= 'Name | ';
-
- if($config['team_display_status'])
- $ret .= 'Status | ';
-
- if($config['multiworld'] || $config['team_display_world'])
- $ret .= 'World | ';
-
- if($config['team_display_lastlogin'])
- $ret .= 'Last login | ';
-
- $ret .= '
';
- return $ret;
-}
-?>
+$twig->display('team.html.twig', array(
+ 'groupmember' => $groupMember
+));
+?>
\ No newline at end of file
diff --git a/system/templates/team.html.twig b/system/templates/team.html.twig
new file mode 100644
index 00000000..d0c4abc1
--- /dev/null
+++ b/system/templates/team.html.twig
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+
+
Support in game
+
+
+
+
+
+
+
+
+
+
+
+ {% if config.team_style == 1 %}
+
+
+ Group
+ |
+
+
+ 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 %}
+
+
+ {% for group in groupmember|reverse %}
+ {% for member in group.members|reverse %}
+
+ {{ group.group_name }} |
+
+
+ {% if config.account_country %}
+ {{ member.flag_image|raw }}
+ {% endif %}
+ {{ member.link|raw }}
+ |
+
+ {% if config.team_display_status %}
+
+ {% if member.status %}
+ Online
+ {% else %}
+ Offline
+ {% endif %}
+ |
+ {% endif %}
+
+ {% if (config.multiworld or config.team_display_world) %}
+
+ {{ member.world_name }}
+ |
+ {% endif %}
+
+ {% if config.team_display_lastlogin %}
+
+ {{ member.last_login }}
+ |
+ {% endif %}
+
+ {% endfor %}
+ {% endfor %}
+
+ {% elseif config.team_style == 2 %}
+ {% for group in groupmember|reverse %}
+ {{ group.group_name }}
+
+
+
+
+ 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 %}
+
+
+ {% for member in group.members %}
+
+
+ {% if config.account_country %}
+ {{ member.flag_image|raw }}
+ {% endif %}
+ {{ member.link|raw }}
+ |
+
+ {% if config.team_display_status %}
+
+ {% if member.status %}
+ Online
+ {% else %}
+ Offline
+ {% endif %}
+ |
+ {% endif %}
+
+ {% if (config.multiworld or config.team_display_world) %}
+
+ {{ member.world_name }}
+ |
+ {% endif %}
+
+ {% if config.team_display_lastlogin %}
+
+ {{ member.last_login }}
+ |
+ {% endif %}
+
+ {% endfor %}
+
+ {% endfor %}
+ {% endif %}
+
+
+ |
+
+
+
\ No newline at end of file