|
|
'.htmlspecialchars($guild->getName()).' |
|
'.$description.'
'.htmlspecialchars($guild_owner).' is guild leader of '.htmlspecialchars($guild->getName()).'. The guild was founded on '.htmlspecialchars($config['server']['serverName']).' on '.date("j F Y", $guild->getCreationData()).'.';
if($guild_leader)
$main_content .= ' ';
$main_content .= '
Guild Members |
Rank |
Name and Title | ';
$showed_players = 1;
foreach($rank_list as $rank)
{
$players_with_rank = $rank->getPlayersList();
$players_with_rank_number = count($players_with_rank);
if($players_with_rank_number > 0)
{
if(is_int($showed_players / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $showed_players++;
$main_content .= ''.htmlspecialchars($rank->getName()).' |
';
foreach($players_with_rank as $player)
{
$main_content .= ' | ';
}
$main_content .= ' | ';
}
}
$main_content .= ' ';
$invited_list = $guild->listInvites();
if(count($invited_list) == 0)
$main_content .= '
Invited Characters | No invited characters found. | ';
else
{
$main_content .= '
Invited Characters | ';
$show_accept_invite = 0;
$showed_invited = 1;
foreach($invited_list as $invited_player)
{
if(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['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $showed_invited++;
$main_content .= ''.htmlspecialchars($invited_player->getName()).'';
if($guild_vice)
$main_content .= ' (Cancel Invitation)';
$main_content .= ' | ';
}
$main_content .= ' ';
}
$main_content .= "Guild Wars";
if($logged)
{
$main_content .= 'Click here to start new war - only guild leader can invite other guild to war.
';
}
$main_content .= "
Aggressor |
Information |
Enemy |
";
$warFrags = array();
foreach($SQL->query('SELECT * FROM `guildwar_kills` WHERE `killerguild` = ' . $guild_id . ' OR `targetguild` = ' . $guild_id . ' ORDER BY `time` DESC')->fetchAll() as $frag)
{
$warFrags[$frag['warid']][] = $frag;
}
$count = 0;
foreach($SQL->query('SELECT `guild_wars`.`id`, `guild_wars`.`guild1`, `guild_wars`.`guild2`, `guild_wars`.`name1`, `guild_wars`.`name2`, `guild_wars`.`status`, `guild_wars`.`started`, `guild_wars`.`ended`, (SELECT COUNT(1) FROM `guildwar_kills` WHERE `guildwar_kills`.`warid` = `guild_wars`.`id` AND `guildwar_kills`.`killerguild` = `guild_wars`.`guild1`) guild1_kills, (SELECT COUNT(1) FROM `guildwar_kills` WHERE `guildwar_kills`.`warid` = `guild_wars`.`id` AND `guildwar_kills`.`killerguild` = `guild_wars`.`guild2`) guild2_kills FROM `guild_wars` WHERE `guild1` = ' . $guild_id . ' OR `guild2` = ' . $guild_id . ' ORDER BY CASE `status` WHEN 0 THEN 2 WHEN 1 THEN 1 WHEN 4 THEN 3 WHEN 3 THEN 4 WHEN 2 THEN 5 END, `started` DESC') as $war)
{
$count++;
$main_content .= "
".htmlspecialchars($war['name1'])." |
";
switch($war['status'])
{
case 0:
{
$main_content .= "Pending acceptation Invited on " . date("M d Y, H:i:s", $war['started']) . " for 7 days war. ";
if($guild_leader && $war['guild2'] == $guild->getID())
{
$main_content .= ' » Click here to accept invitation to war «';
$main_content .= '
» Click here to reject invitation to war «';
}
if($guild_leader && $war['guild1'] == $guild->getID())
{
$main_content .= '
» Click here to cancel invitation to war «';
}
$main_content .= '';
break;
}
case 1:
{
$main_content .= "" . $war['guild1_kills'] . " : " . $war['guild2_kills'] . "
On a brutal war Began on " . date("M d Y, H:i:s", $war['started']) . ", will end up after server restart after " . date("M d Y, H:i:s", $war['started'] + (7*86400)) . ". ";
$main_content .= "
";
if(in_array($war['status'], array(1,4)))
{
$main_content .= "» Details «";
}
break;
}
case 2:
{
$main_content .= "Rejected invitation Invited on " . date("M d Y, H:i:s", $war['started']) . ", rejected on " . date("M d Y, H:i:s", $war['ended']) . ".";
break;
}
case 3:
{
$main_content .= "Canceled invitation Sent invite on " . date("M d Y, H:i:s", $war['started']) . ", canceled on " . date("M d Y, H:i:s", $war['ended']) . ".";
break;
}
case 4:
{
$main_content .= "Ended Began on " . date("M d Y, H:i:s", $war['started']) . ", ended on " . date("M d Y, H:i:s", $war['ended']) . ". Frag statistics: " . $war['guild1_kills'] . " to " . $war['guild2_kills'] . ".";
$main_content .= "
";
if(in_array($war['status'], array(1,4)))
{
$main_content .= "» Details «";
}
$main_content .= "";
break;
}
default:
{
$main_content .= "Unknown, please contact with gamemaster.";
break;
}
}
$main_content .= " |
".htmlspecialchars($war['name2'])." |
";
if(in_array($war['status'], array(1,4)))
{
if(isset($warFrags[$war['id']]))
{
foreach($warFrags[$war['id']] as $frag)
{
$main_content .= date("j M Y, H:i", $frag['time']) . " +".htmlspecialchars($frag['killer'])." killed " . htmlspecialchars($frag['target']) . "";
}
}
else
$main_content .= "There were no frags on this war so far.";
}
else
$main_content .= " | ";
}
if($count == 0)
$main_content .= "
Currently there are no active wars. |
";
$main_content .= " ";
$main_content .= '
| ';
if(!$logged)
$main_content .= ' | ';
else
{
if($show_accept_invite > 0)
$main_content .= ' | ';
if($guild_vice)
{
$main_content .= ' | ';
$main_content .= ' | ';
}
if($players_from_account_in_guild > 0)
$main_content .= ' | ';
}
$main_content .= '
| |
| |