Rest of Guild View to Twig

This commit is contained in:
whiteblXK 2019-05-06 23:26:01 +02:00
parent abb2b36ae6
commit bda7982134
2 changed files with 467 additions and 231 deletions

View File

@ -5,7 +5,8 @@
* @package MyAAC
* @author Gesior <jerzyskalski@wp.pl>
* @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC
* @author whiteblXK
* @copyright 2019 MyAAC
* @link http://my-aac.org
*/
defined('MYAAC') or die('Direct access not allowed!');
@ -26,244 +27,136 @@ if(empty($errors))
if(!empty($errors))
{
$twig->display('error_box.html.twig', array('errors' => $errors));
$twig->display('guilds.back_button.html.twig');
return;
}
else
$guild_name = $guild->getName();
$title = $guild_name . ' - ' . $title;
$guild_owner = $guild->getOwner();
$rank_list = $guild->getGuildRanksList();
$rank_list->orderBy('level', POT::ORDER_DESC);
$guild_leader = false;
$guild_vice = false;
$level_in_guild = 0;
$players_from_account_in_guild = array();
$players_from_account_ids = array();
if($logged)
{
$title = $guild->getName() . ' - ' . $title;
//check is it vice or/and leader account (leader has vice + leader rights)
$guild_leader_char = $guild->getOwner();
$rank_list = $guild->getGuildRanksList();
$rank_list->orderBy('level', POT::ORDER_DESC);
$guild_leader = false;
$guild_vice = false;
$level_in_guild = 0;
$players_from_account_in_guild = array();
if($logged)
{
$players_from_account_ids = array();
$account_players = $account_logged->getPlayers();
foreach($account_players as $player)
{
$players_from_account_ids[] = $player->getId();
$player_rank = $player->getRank();
if($player_rank->isLoaded())
{
foreach($rank_list as $rank_in_guild)
{
if($rank_in_guild->isLoaded() && $player_rank->isLoaded() &&
$rank_in_guild->getId() == $player_rank->getId())
{
$players_from_account_in_guild[] = $player->getName();
if($guild->getOwner()->getId() == $player->getId())
{
$guild_vice = true;
$guild_leader = true;
}
else if($player_rank->getLevel() > 1)
{
$guild_vice = true;
$level_in_guild = $player_rank->getLevel();
}
}
}
}
}
}
//show guild page
$guild_logo = $guild->getCustomField('logo_name');
if(empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo))
$guild_logo = "default.gif";
$description = $guild->getCustomField('description');
$description_with_lines = str_replace(array("\r\n", "\n", "\r"), '<br />', $description, $count);
if($count < $config['guild_description_lines_limit'])
$description = wordwrap(nl2br($description), 60, "<br />", true);
//$description = $description_with_lines;
$guild_owner = $guild->getOwner();
if($guild_owner->isLoaded())
$guild_owner = $guild_owner->getName();
echo '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR>
<TD><IMG SRC="'.$template_path.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD>
<TABLE BORDER=0 WIDTH=100%>
<TR><TD WIDTH=64><IMG SRC="images/guilds/' . $guild_logo.'" WIDTH=64 HEIGHT=64></TD>
<TD ALIGN=center WIDTH=100%><H1>'.$guild->getName().'</H1></TD>
<TD WIDTH=64><IMG SRC="images/guilds/' . $guild_logo.'" WIDTH=64 HEIGHT=64></TD></TR>
</TABLE><BR>'.$description.'<BR><BR><a href="' . getPlayerLink($guild_owner, false).'"><b>'.$guild_owner.'</b></a> is guild leader of <b>'.$guild->getName().'</b>.<BR>The guild was founded on '.$config['lua']['serverName'].' on '.date("j F Y", $guild->getCreationData()).'.';
if($guild_leader)
echo '&nbsp;&nbsp;&nbsp;<a href="?subtopic=guilds&action=manager&guild='.$guild->getName().'"><IMG SRC="'.$template_path.'/images/global/buttons/sbutton_manageguild.png" BORDER=0 WIDTH=120 HEIGHT=18 alt="Manage Guild"></a>';
echo '<BR><BR>
$account_players = $account_logged->getPlayers();
foreach($account_players as $player)
{
$players_from_account_ids[] = $player->getId();
$player_rank = $player->getRank();
if($player_rank->isLoaded())
{
foreach($rank_list as $rank_in_guild)
{
if($guild_owner->isLoaded() && $rank_in_guild->isLoaded() && $player_rank->isLoaded() &&
$rank_in_guild->getId() == $player_rank->getId())
{
$players_from_account_in_guild[] = $player->getName();
if($guild_owner->getId() == $player->getId())
{
$guild_vice = true;
$guild_leader = true;
}
else if($player_rank->getLevel() > 1)
{
$guild_vice = true;
$level_in_guild = $player_rank->getLevel();
}
}
}
}
}
}
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
<TR BGCOLOR='.$config['vdarkborder'].'>
<TD COLSPAN=3 class="white"><B>Guild Members</B></TD>
</TR>
<TR BGCOLOR='.$config['darkborder'].'>
<TD WIDTH=30%><B>Rank</B></TD>
<TD WIDTH=30%><B>Name, title, level & status</B></TD>
</TR>';
//show guild page
$guild_logo = $guild->getCustomField('logo_name');
if(empty($guild_logo) || !file_exists('images/guilds/' . $guild_logo))
$guild_logo = "default.gif";
//Slaw stats values
//$s_total_members = 0;
//$s_members_online = 0;
//$s_total_level = 0;
//End Slaw stats values
$description = $guild->getCustomField('description');
$description_with_lines = str_replace(array("\r\n", "\n", "\r"), '<br />', $description, $count);
if($count < $config['guild_description_lines_limit'])
$description = wordwrap(nl2br($description), 60, "<br />", true);
//$description = $description_with_lines;
$showed_players = 1;
foreach($rank_list as $rank)
{
if($db->hasTable(GUILD_MEMBERS_TABLE))
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `' . GUILD_MEMBERS_TABLE . '`.`rank_id` as `rank_id` FROM `players`, `' . GUILD_MEMBERS_TABLE . '` WHERE `' . GUILD_MEMBERS_TABLE . '`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `' . GUILD_MEMBERS_TABLE . '`.`player_id` ORDER BY `name`;');
else if($db->hasColumn('players', 'rank_id'))
$players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;');
$guild_owner = $guild->getOwner();
if($guild_owner->isLoaded())
$guild_owner_name = $guild_owner->getName();
$players_with_rank_number = $players_with_rank->rowCount();
if($players_with_rank_number > 0)
{
$bgcolor = getStyle($showed_players);
$showed_players++;
echo '
<TR BGCOLOR="'.$bgcolor.'">
<TD valign="top">'.$rank->getName().'</TD>
<TD>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%>';
foreach($players_with_rank as $result)
{
$player = new OTS_Player();
$player->load($result['id']);
if(!$player->isLoaded())
continue;
$guild_members = array();
foreach($rank_list as $rank)
{
if($db->hasTable(GUILD_MEMBERS_TABLE))
$players_with_rank = $db->query('SELECT `players`.`id` as `id`, `' . GUILD_MEMBERS_TABLE . '`.`rank_id` as `rank_id` FROM `players`, `' . GUILD_MEMBERS_TABLE . '` WHERE `' . GUILD_MEMBERS_TABLE . '`.`rank_id` = ' . $rank->getId() . ' AND `players`.`id` = `' . GUILD_MEMBERS_TABLE . '`.`player_id` ORDER BY `name`;');
else if($db->hasColumn('players', 'rank_id'))
$players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;');
//$s_total_members++;
//$s_total_level += $player->getLevel();
echo '<TR><TD>' . getPlayerLink($player->getName()) . '<FORM ACTION="?subtopic=guilds&action=change_nick&name='.$player->getName().'" METHOD=post>';
$guild_nick = $player->getGuildNick();
if($logged)
{
if(in_array($player->getId(), $players_from_account_ids))
echo ' (<input type="text" name="nick" value="'.htmlentities($player->getGuildNick()).'"><input type="submit" value="Change">)';
else
{
if(!empty($guild_nick))
echo ' ('.htmlentities($player->getGuildNick()).')';
}
}
else
if(!empty($guild_nick))
echo ' ('.htmlentities($player->getGuildNick()).')';
$players_with_rank_number = $players_with_rank->rowCount();
if($players_with_rank_number > 0)
{
$members = array();
foreach($players_with_rank as $result)
{
$player = new OTS_Player();
$player->load($result['id']);
if(!$player->isLoaded())
continue;
if($level_in_guild > $rank->getLevel() || $guild_leader)
if($guild_leader_char->getName() != $player->getName())
echo '&nbsp;<span style="font-size: 10px">{<a href="?subtopic=guilds&action=kick_player&guild='.urlencode($guild->getName()).'&name='.urlencode($player->getName()).'">KICK</a>}</span>';
$members[] = $player;
}
echo '</FORM></TD><TD align="right" width="10%">'.$player->getLevel().'</TD><TD align="right" width="20%"><span style="color: '.($player->isOnline() ? 'green"><b>Online' : 'red"><b>Offline').'</b></span></TD></TR>';
}
echo '</TABLE></TD></TR>';
}
}
echo '</TABLE>';
/*
//Statistics ;)
echo '<BR>
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
<TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=2 class="white"><B>Statistics</B></TD></TR>
<TR BGCOLOR='.$config['darkborder'].'>
<TD WIDTH=30%>Total members:</TD>
<TD WIDTH=50%><B>'.$s_total_members.'</B></TD>
</TR>
<TR BGCOLOR='.$config['lightborder'].'>
<TD WIDTH=30%>Members currently online:</TD>
<TD WIDTH=50%><B>'.$s_members_online.'</B></TD>
</TR>
<TR BGCOLOR='.$config['darkborder'].'>
<TD WIDTH=30%>Total members level:</TD>
<TD WIDTH=50%><B>'.$s_total_level.'</B></TD>
</TR>
<TR BGCOLOR='.$config['lightborder'].'>
<TD WIDTH=30%>Average members level:</TD>
<TD WIDTH=50%><B>'.ceil($s_total_level/$s_total_members).'</B></TD>
</TR>
<TR BGCOLOR='.$config['darkborder'].'>
<TD WIDTH=30%>Frags:</TD>
<TD WIDTH=50%><B>'.$guild->getCustomField('frags').'</B></TD>
</TR>';
//guild hall?
$houseInfo = $db->query('SELECT `id`, `name` FROM `houses` WHERE `owner` = ' . $guild->getId() . ' AND `guild` = 1');
if($houseInfo->rowCount() > 0) //have guild hall
{
$houseInfo = $houseInfo->fetch();
echo
'<TR BGCOLOR='.$config['lightborder'].'>
<TD WIDTH=30%>Guildhall:</TD>
<TD WIDTH=50%>
<B>'.$houseInfo['name'].'</B>
<FORM ACTION=?subtopic=houses&page=view METHOD=post>
<INPUT TYPE=hidden NAME=houseid VALUE='.$houseInfo['id'].'>
<INPUT TYPE=image NAME="View" ALT="View" SRC="'.$template_path.'/images/global/buttons/sbutton_view.gif" BORDER=0 WIDTH=120>
</FORM>
</TD>
</TR>';
}
echo '</TABLE>';
*/
//End statistics
$guild_members[] = array(
'rank_name' => $rank->getName(),
'rank_level' => $rank->getLevel(),
'members' => $members
);
}
}
//Lets update some stuff in database
//$db->query('UPDATE `guilds` SET `total_members` = '.$s_total_members.', `members_online` = '.$s_members_online.', `total_level` = '.$s_total_level.', `average_level` = '.ceil($s_total_level/$s_total_members).' WHERE `id` = '.$guild->getId());
include(SYSTEM . 'libs/pot/InvitesDriver.php');
new InvitesDriver($guild);
$invited_list = $guild->listInvites();
$show_accept_invite = 0;
if(count($invited_list) == 0)
echo '<BR><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=2 class="white"><B>Invited Characters</B></TD></TR><TR BGCOLOR='.$config['lightborder'].'><TD>No invited characters found.</TD></TR></TABLE>';
else
{
echo '<BR><BR><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD COLSPAN=2 class="white"><B>Invited Characters</B></TD></TR>';
$showed_invited = 1;
foreach($invited_list as $invited_player)
{
if($logged && count($account_players) > 0)
foreach($account_players as $player_from_acc)
if($player_from_acc->getName() == $invited_player->getName())
$show_accept_invite++;
if(is_int($showed_invited / 2)) { $bgcolor = $config['darkborder']; } else { $bgcolor = $config['lightborder']; } $showed_invited++;
echo '<TR bgcolor="'.$bgcolor.'"><TD>' . getPlayerLink($invited_player->getName());
if($guild_vice)
echo ' (<a href="?subtopic=guilds&action=delete_invite&guild='.$guild->getName().'&name='.$invited_player->getName().'">Cancel Invitation</a>)';
echo '</TD></TR>';
}
echo '</TABLE>';
}
echo '<BR><BR>
<TABLE BORDER=0 WIDTH=100%><TR><TD ALIGN=center><IMG SRC="'.$template_path.'/images/general/blank.gif" WIDTH=80 HEIGHT=1 BORDER=0<BR></TD>';
if(!$logged)
echo '<TD ALIGN=center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=accountmanagement&redirect='.getGuildLink($guild->getName(), false).'" METHOD=post><TR><TD>
<INPUT TYPE=image NAME="Login" ALT="Login" SRC="'.$template_path.'/images/global/buttons/sbutton_login.gif" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR></FORM></TABLE></TD>';
else
{
if($show_accept_invite > 0)
echo '<TD ALIGN=center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds&action=accept_invite&guild='.$guild->getName().'" METHOD=post><TR><TD>
<INPUT TYPE=image NAME="Accept Invite" ALT="Accept Invite" SRC="'.$template_path.'/images/global/buttons/sbutton_acceptinvite.png" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR></FORM></TABLE></TD>';
if($guild_vice)
{
echo '<TD ALIGN=center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds&action=invite&guild='.$guild->getName().'" METHOD=post><TR><TD>
<INPUT TYPE=image NAME="Invite Player" ALT="Invite Player" SRC="'.$template_path.'/images/global/buttons/sbutton_inviteplayer.png" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR></FORM></TABLE></TD>';
echo '<TD ALIGN=center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds&action=change_rank&guild='.$guild->getName().'" METHOD=post><TR><TD>
<INPUT TYPE=image NAME="Change Rank" ALT="Change Rank" SRC="'.$template_path.'/images/global/buttons/sbutton_changerank.png" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR></FORM></TABLE></TD>';
}
if(count($players_from_account_in_guild) > 0)
echo '<TD ALIGN=center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds&action=leave_guild&guild='.$guild->getName().'" METHOD=post><TR><TD>
<INPUT TYPE=image NAME="Leave Guild" ALT="Leave Guild" SRC="'.$template_path.'/images/global/buttons/sbutton_leaveguild.png" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR></FORM></TABLE></TD>';
}
echo '<TD ALIGN=center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds" METHOD=post><TR><TD>
' . $twig->render('buttons.back.html.twig') . '
</TD></TR></FORM></TABLE>
</TD><TD ALIGN=center><IMG SRC="'.$template_path.'/images/general/blank.gif" WIDTH=80 HEIGHT=1 BORDER=0<BR></TD></TR></TABLE>
</TD><TD><IMG src="'.$template_path.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD>
</TR></TABLE></TABLE>';
}
include(SYSTEM . 'libs/pot/InvitesDriver.php');
new InvitesDriver($guild);
$invited_list = $guild->listInvites();
$show_accept_invite = 0;
if($logged && count($invited_list) > 0)
{
foreach($invited_list as $invited_player)
{
if(count($account_players) > 0)
{
foreach($account_players as $player_from_acc)
{
if($player_from_acc->isLoaded() && $invited_player->isLoaded() && $player_from_acc->getName() == $invited_player->getName())
$show_accept_invite++;
}
}
}
}
$useGuildNick = false;
if($db->hasColumn('players', 'guildnick'))
$useGuildNick = true;
$twig->display('guilds.view.html.twig', array(
'logo' => $guild_logo,
'guild_name' => $guild_name,
'description' => $description,
'guild_owner' => $guild_owner->isLoaded() ? $guild_owner : null,
'guild_creation_date' => $guild->getCreationData(),
'guild_members' => $guild_members,
'players_from_account_ids' => $players_from_account_ids,
'players_from_account_in_guild' => $players_from_account_in_guild,
'level_in_guild' => $level_in_guild,
'isLeader' => $guild_leader,
'isVice' => $guild_vice,
'logged' => $logged,
'invited_list' => $invited_list,
'show_accept_invite' => $show_accept_invite,
'useGuildNick' => $useGuildNick
));

View File

@ -0,0 +1,343 @@
<div class="Border_2">
<div class="Border_3">
<div class="BoxContent">
<table border="0" width="100%">
<tbody>
<tr>
<td width="64">
<img src="images/guilds/{{ logo }}" width="64" height="64">
</td>
<td align="center" width="100%"><h1>{{ guild_name }}</h1></td>
<td width="64">
<img src="images/guilds/{{ logo }}" width="64" height="64">
</td>
</tr>
</tbody>
</table>
<br>
<table width="100%">
<tbody>
<tr>
<td style="vertical-align:top;">
<div class="TableContainer">
<div class="TableContainer">
<div class="CaptionContainer">
<div class="CaptionInnerContainer">
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
<div class="Text">Guild Information</div>
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
</div>
</div>
</div>
<table class="Table1" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>
<div class="InnerTableContainer">
<table style="width:100%;">
<tbody>
<tr>
<td>
<div id="GuildInformationContainer">
{% if descriptions is not empty %}
{{ description }}
<br>
<br>
{% endif %}
{% if guild_owner is not empty %}
{% set guildOwnerName = guild_owner.getName() %}
<a href="{{ getPlayerLink(guildOwnerName, false) }}"><b>{{ guildOwnerName }}</b></a> is guild leader of <b>{{ guild_name }}</b>.
<br>
{% endif %}
The guild was founded on {{ config.lua.serverName }} on {{ guild_creation_date|date("j F Y") }}.
{% if isLeader %}
<a href="?subtopic=guilds&action=manager&guild={{ guild_name }}" style="float: right;">
<img src="{{ template_path }}/images/global/buttons/sbutton_manageguild.png" style="width: 120px; height: 20px;" alt="Manage Guild">
</a>
{% endif %}
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
<br>
<div class="TableContainer">
<div class="TableContainer">
<div class="CaptionContainer">
<div class="CaptionInnerContainer">
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
<div class="Text">Guild Members</div>
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
</div>
</div>
</div>
<table class="Table3" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>
<div class="InnerTableContainer">
<table style="width:100%;">
<tbody>
<tr>
<td>
<div class="TableContentAndRightShadow">
<div class="TableContentContainer">
<table class="TableContent" width="100%">
<tbody>
<tr class="LabelH">
<td>Rank</td>
<td>Name{% if useGuildNick %} and Title{% endif %}</td>
<td>Vocation</td>
<td>Level</td>
<td>Status</td>
</tr>
{% set showedRank, i = false, 0 %}
{% for rank in guild_members if rank.members|length > 0 %}
{% set rankStyle, i = getStyle(i), i + 1 %}
{% for player in rank.members %}
<tr bgcolor="{{ rankStyle }}">
<td>
{% if not showedRank %}{{ rank.rank_name }}{% endif %}
{% set showedRank = true %}
</td>
<td>
{% set playerName = player.getName() %}
<form action="?subtopic=guilds&action=change_nick&name={{ playerName }}" method="post">
{{ getPlayerLink(playerName, true)|raw }}
{% if useGuildNick %}
{% set showGuildNick = false %}
{% if player.getGuildNick() is not empty %}
{% set showGuildNick = true %}
{% set guildNickRaw = player.getGuildNick()|raw %}
{% endif %}
{% if logged %}
{% if player.getId() in players_from_account_ids %}
(<input type="text" name="nick" value="{{ guildNickRaw }}"><input type="submit" value="Change">)
{% else %}
{% if showGuildNick %} ({{ guildNickRaw }}){% endif %}
{% endif %}
{% if level_in_guild > rank.rank_level or isLeader %}
{% if guildOwnerName != playerName %}
<span style="font-size: 10px; float: right">
{<a href="?subtopic=guilds&action=kick_player&guild={{ guild_name|url_encode }}&name={{ playerName|url_encode }}">KICK</a>}
</span>
{% endif %}
{% endif %}
{% else %}
{% if showGuildNick %} ({{ guildNickRaw }}){% endif %}
{% endif %}
{% endif %}
</form>
</td>
<td>{{ player.getVocationName() }}</td>
<td>{{ player.getLevel() }}</td>
<td>
<span style="color: {% if player.isOnline() %} green;"><b>Online{% else %} red;"><b>Offline{% endif %}</b></span>
</td>
</tr>
{% endfor %}
{% set showedRank = false %}
{% else %}
<tr bgcolor="{{ getStyle(i) }}">
<td colspan="5">No guild members found.</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<div class="TableContainer">
<div class="CaptionContainer">
<div class="CaptionInnerContainer">
<span class="CaptionEdgeLeftTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
<span class="CaptionEdgeRightTop" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
<span class="CaptionBorderTop" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
<span class="CaptionVerticalLeft" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
<div class="Text">Invited Characters</div>
<span class="CaptionVerticalRight" style="background-image:url({{ template_path }}/images/content/box-frame-vertical.gif);"></span>
<span class="CaptionBorderBottom" style="background-image:url({{ template_path }}/images/content/table-headline-border.gif);"></span>
<span class="CaptionEdgeLeftBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
<span class="CaptionEdgeRightBottom" style="background-image:url({{ template_path }}/images/content/box-frame-edge.gif);"></span>
</div>
</div>
<table class="Table3" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>
<div class="InnerTableContainer">
<table style="width:100%;">
<tbody>
<tr>
<td>
<div class="TableContentContainer">
<table class="TableContent" width="100%">
<tbody>
<tr class="LabelH">
<td><b>Name</b></td>
</tr>
{% set i = 0 %}
{% for invited_player in invited_list if invited_list|length > 0 %}
{% if invited_player.isLoaded() %}
<tr bgcolor="{{ getStyle(i) }}">
{% set i = i + 1 %}
<td>
{{ getPlayerLink(invited_player.getName(), true)|raw }}
{% if isVice %}
<div style="float: right">
{<a href="?subtopic=guilds&action=delete_invite&guild={{ guild_name|url_encode }}&name={{ invited_player.getName()|url_encode }}">Cancel Invitation</a>}
</div>
{% endif %}
</td>
</tr>
{% endif %}
{% else %}
<tr bgcolor="{{ getStyle(i) }}">
<td>
No invited characters found.
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<div class="TableContainer">
<table class="Table3" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>
<div class="InnerTableContainer">
<table style="width:100%;">
<tbody>
<tr>
<td>
<div class="TableContentContainer">
<table class="TableContent" width="100%">
<tbody>
<tr>
{% if not logged %}
<form action="?subtopic=accountmanagement&redirect={{ getGuildLink(guild_name|url_encode, false) }}" method="post">
<th>
<input type="image" name="Login" alt="Login" src="{{ template_path }}/images/global/buttons/sbutton_login.gif" style="width: 120px; height: 20px;">
</th>
</form>
{% else %}
{% if show_accept_invite > 0 %}
<form action="?subtopic=guilds&action=accept_invite&guild={{ guild_name|url_encode }}" method="post">
<th>
<input type="image" name="Accept Invite" alt="Accept Invite" src="{{ template_path }}/images/global/buttons/sbutton_acceptinvite.png" style="width: 120px; height: 20px;">
</th>
</form>
{% endif %}
{% if isVice %}
<form action="?subtopic=guilds&action=invite&guild={{ guild_name|url_encode }}" method="post">
<th>
<input type="image" name="Invite Player" alt="Invite Player" src="{{ template_path }}/images/global/buttons/sbutton_inviteplayer.png" style="width: 120px; height: 20px;">
</th>
</form>
<form action="?subtopic=guilds&action=change_rank&guild={{ guild_name|url_encode }}" method="post">
<th>
<input type="image" name="Change Rank" alt="Change Rank" src="{{ template_path }}/images/global/buttons/sbutton_changerank.png" style="width: 120px; height: 20px;">
</th>
</form>
{% endif %}
{% if players_from_account_in_guild|length > 0 %}
<form action="?subtopic=guilds&action=leave_guild&guild={{ guild_name|url_encode }}" method="post">
<th>
<input type="image" name="Leave Guild" alt="Leave Guild" src="{{ template_path }}/images/global/buttons/sbutton_leaveguild.png" style="width: 120px; height: 20px;">
</th>
</form>
{% endif %}
{% endif %}
<form action="{{ getLink('guilds') }}" method="post">
<th style="float: right">
{{ include('buttons.back.html.twig') }}
</th>
</form>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>