* moved most of guilds html-in-php code to twig

* moved buttons to separate templates
* moved online search for to twig
This commit is contained in:
slawkens
2017-10-18 16:08:15 +02:00
parent a3d94db6eb
commit e45d27b5c7
354 changed files with 762 additions and 500 deletions

View File

@@ -87,19 +87,18 @@ else
<td width="30">&nbsp;</td>
<td align=left>
<form action="' . getLink('account/email') . '" method="post"><input type="hidden" name="changeemailsave" value=1 >
<INPUT TYPE=image NAME="I Agree" SRC="' . $template_path . '/images/buttons/sbutton_iagree.gif" BORDER=0 WIDTH=120 HEIGHT=17>
<INPUT TYPE=image NAME="I Agree" SRC="' . $template_path . '/images/global/buttons/sbutton_iagree.gif" BORDER=0 WIDTH=120 HEIGHT=17>
</form>
</td>
<td align=left>
<form action="' . getLink('account/email') . '" method="post">
<input type="hidden" name="emailchangecancel" value=1 >
<input type=image name="Cancel" src="' . $template_path . '/images/buttons/sbutton_cancel.gif" BORDER=0 WIDTH=120 HEIGHT=17>
' . $twig->render('buttons.cancel.html.twig') . '
</form>
</td>
<td align=right>
<form action="?subtopic=accountmanagement" method="post" >
<div class="BigButton" style="background-image:url(' . $template_path . '/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(' . $template_path . '/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="' . $template_path . '/images/buttons/_sbutton_back.gif" ></div>
</div>
' . $twig->render('buttons.back.html.twig') . '
</form>
</td>
<td width="30">&nbsp;</td>
@@ -123,8 +122,7 @@ else
<tr>
<td style="border:0px;" >
<input type="hidden" name="emailchangecancel" value="1" >
<div class="BigButton" style="background-image:url(' . $template_path . '/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(' . $template_path . '/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Cancel" alt="Cancel" src="'.$template_path.'/images/buttons/_sbutton_cancel.gif" ></div>
</div>
' . $twig->render('buttons.cancel.html.twig') . '
</td>
</tr>
</form>
@@ -135,8 +133,7 @@ else
<form action="' . getLink('account/manage') . '" method="post" >
<tr>
<td style="border:0px;" >
<div class="BigButton" style="background-image:url(' . $template_path . '/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(' . $template_path . '/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="' . $template_path . '/images/buttons/_sbutton_back.gif" ></div>
</div>
' . $twig->render('buttons.back.html.twig') . '
</td>
</tr>
</form>
@@ -155,7 +152,7 @@ if(isset($_POST['emailchangecancel']) && $_POST['emailchangecancel'] == 1) {
$account_logged->setCustomField("email_new", "");
$account_logged->setCustomField("email_new_time", 0);
$custom_buttons = '<center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
$custom_buttons = '<center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" >' . $twig->render('buttons.back.html.twig') . '</td></tr></form></table></center>';
echo $twig->render('success.html.twig', array(
'title' => 'Email Address Change Cancelled',

View File

@@ -250,5 +250,5 @@ else
echo 'Monster with name <b>'.$monster_name.'</b> doesn\'t exist.';
}
//back button
echo '<br/></br><center><form action="?subtopic=creatures" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
echo $twig->render('creatures.back_button.html.twig');
?>

View File

@@ -90,31 +90,35 @@ else
}
if(!$acc_invited) {
$errors[] = 'Any character from your account isn\'t invited to <b>'.$guild->getName().'</b>.';
$errors[] = "Any character from your account isn't invited to <b>" . $guild->getName() . "</b>.";
}
}
if(!empty($errors)) {
echo $twig->render('error_box.html.twig', array('errors' => $errors));
echo '
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><FORM ACTION="?subtopic=guilds&action=show&guild='.$guild_name.'" METHOD=post><TR><TD><center><INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center></TD></TR></FORM></TABLE>';
echo $twig->render('guilds.back_button.html.twig', array(
'action' => getLink('guilds') . '/' . $guild_name
));
}
else {
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
$guild->acceptInvite($player);
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD class="white"><B>Accept invitation</B></TD></TR><TR BGCOLOR='.$config['darkborder'].'><TD WIDTH=100%>Player with name <b>'.$player->getName().'</b> has been added to guild <b>'.$guild->getName().'</b>.</TD></TR></TABLE><br/><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><FORM ACTION="?subtopic=guilds&action=show&guild='.$guild_name.'" METHOD=post><TR><TD><center><INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center></TD></TR></FORM></TABLE>';
echo $twig->render('success.html.twig', array(
'title' => 'Accept invitation',
'description' => 'Player with name <b>'.$player->getName().'</b> has been added to guild <b>'.$guild->getName() . '</b>.',
'custom_buttons' => $twig->render('guilds.back_button.html.twig', array(
'action' => getLink('guilds') . '/' . $guild_name
))
));
}
else
{
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD class="white"><B>Accept invitation</B></TD></TR>';
echo '<TR BGCOLOR='.$config['lightborder'].'><TD WIDTH=100%>Select character to join guild:</TD></TR>';
echo '<TR BGCOLOR='.$config['darkborder'].'><TD>
<form action="?subtopic=guilds&action=accept_invite&guild='.$guild_name.'&todo=save" METHOD="post">';
sort($list_of_invited_players);
$i = 0;
foreach($list_of_invited_players as $invited_player_from_list) {
echo '<input type="radio" name="name" id="name_' . $i . '" value="'.$invited_player_from_list.'" /><label for="name_' . $i++ . '">'.$invited_player_from_list.'</label><br>';
}
echo '<br><input type="image" name="Submit" alt="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" border="0" width="120" height="18"></form></td></tr></table><br/><center><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><form action="?subtopic=guilds&action=show&guild='.$guild_name.'" method="post"><td><input type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/sbutton_back.gif" border=0 width=120 height=18></td></tr></form></table></center>';
echo $twig->render('guilds.accept_invite.html.twig', array(
'guild_name' => $guild_name,
'invited_players' => $list_of_invited_players
));
}
}

View File

@@ -57,7 +57,10 @@ if(empty($guild_errors)) {
if(!empty($guild_errors)) {
echo $twig->render('error_box.html.twig', array('errors' => $guild_errors));
echo '<br/><center><form action="?subtopic=guilds&guild='.$guild_name.'&action=show" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
echo $twig->render('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => '?subtopic=guilds&guild='.$guild_name.'&action=show'
));
}
}
else
@@ -65,7 +68,9 @@ else
if(!empty($guild_errors)) {
echo $twig->render('error_box.html.twig', array('errors' => $guild_errors));
echo '<br/><center><form action="?subtopic=guilds" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
echo $twig->render('guilds.back_button.html.twig', array(
'new_line' => true
));
}
}

View File

@@ -67,7 +67,10 @@ if(empty($errors)) {
if(!empty($errors)) {
echo $twig->render('error_box.html.twig', array('errors' => $errors));
echo '<br/><center><form action="?subtopic=guilds" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
echo $twig->render('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => '?subtopic=guilds'
));
}
?>

View File

@@ -118,6 +118,9 @@ if(empty($errors)) {
if(!empty($errors)) {
echo $twig->render('error_box.html.twig', array('errors' => $errors));
echo '<br/><center><form action="?subtopic=guilds" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
echo $twig->render('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => '?subtopic=guilds'
));
}
?>

View File

@@ -69,7 +69,10 @@ if(empty($errors)) {
if(!empty($errors)) {
echo $twig->render('error_box.html.twig', array('errors' => $errors));
echo '<br/><center><form action="?subtopic=guilds" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
echo $twig->render('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => '?subtopic=guilds'
));
}
?>

View File

@@ -13,189 +13,192 @@ defined('MYAAC') or die('Direct access not allowed!');
$guild_name = $_REQUEST['guild'];
if(!Validator::guildName($guild_name))
$guild_errors[] = Validator::getLastError();
$errors[] = Validator::getLastError();
if(!$logged)
$guild_errors[] = 'You are not logged in. You can\'t change rank.';
if(empty($guild_errors))
$errors[] = 'You are not logged in. You can\'t change rank.';
if(empty($errors))
{
$guild = $ots->createObject('Guild');
$guild->find($guild_name);
if(!$guild->isLoaded())
$guild_errors[] = 'Guild with name <b>' . $guild_name . '</b> doesn\'t exist.';
$errors[] = 'Guild with name <b>' . $guild_name . '</b> doesn\'t exist.';
}
if(!empty($guild_errors))
if(!empty($errors))
{
echo $twig->render('error_box.html.twig', array('errors' => $guild_errors));
echo '
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><FORM ACTION="?subtopic=guilds" METHOD=post><TR><TD><center><INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center></TD></TR></FORM></TABLE>';
echo $twig->render('error_box.html.twig', array('errors' => $errors));
echo $twig->render('guilds.back_button.html.twig');
return;
}
else
//check is it vice or/and leader account (leader has vice + leader rights)
$rank_list = $guild->getGuildRanksList();
$rank_list->orderBy('level', POT::ORDER_DESC);
$guild_leader = false;
$guild_vice = false;
$account_players = $account_logged->getPlayers();
foreach($account_players as $player)
{
//check is it vice or/and leader account (leader has vice + leader rights)
$rank_list = $guild->getGuildRanksList();
$rank_list->orderBy('level', POT::ORDER_DESC);
$guild_leader = false;
$guild_vice = false;
$account_players = $account_logged->getPlayers();
foreach($account_players as $player)
{
$player_rank = $player->getRank();
if($player_rank->isLoaded()) {
foreach($rank_list as $rank_in_guild)
$player_rank = $player->getRank();
if($player_rank->isLoaded()) {
foreach($rank_list as $rank_in_guild)
{
if($rank_in_guild->getId() == $player_rank->getId())
{
if($rank_in_guild->getId() == $player_rank->getId())
$players_from_account_in_guild[] = $player->getName();
if($player_rank->getLevel() > 1) {
$guild_vice = true;
$level_in_guild = $player_rank->getLevel();
}
if($guild->getOwner()->getId() == $player->getId()) {
$guild_vice = true;
$guild_leader = true;
}
}
}
}
}
if($guild_vice)
{
$rid = 0;
$sid = 0;
foreach($rank_list as $rank)
{
if($guild_leader || $rank->getLevel() < $level_in_guild)
{
$ranks[$rid]['0'] = $rank->getId();
$ranks[$rid]['1'] = $rank->getName();
$rid++;
if(fieldExist('rank_id', 'players'))
$players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;');
else
$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`;');
$players_with_rank_number = $players_with_rank->rowCount();
if(count($players_with_rank) > 0)
{
foreach($players_with_rank as $result)
{
$players_from_account_in_guild[] = $player->getName();
if($player_rank->getLevel() > 1) {
$guild_vice = true;
$level_in_guild = $player_rank->getLevel();
}
if($guild->getOwner()->getId() == $player->getId()) {
$guild_vice = true;
$guild_leader = true;
$player = new OTS_Player();
$player->load($result['id']);
if(!$player->isLoaded())
continue;
if($guild->getOwner()->getId() != $player->getId() || $guild_leader)
{
$players_with_lower_rank[$sid][0] = $player->getName();
$players_with_lower_rank[$sid][1] = $player->getName().' ('.$rank->getName().')';
$sid++;
}
}
}
}
}
//tworzenie listy osob z nizszymi uprawnieniami i rank z nizszym levelem
if($guild_vice)
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save')
{
$rid = 0;
$sid = 0;
foreach($rank_list as $rank)
$player_name = stripslashes($_REQUEST['name']);
$new_rank = (int) $_REQUEST['rankid'];
if(!Validator::characterName($player_name))
$change_errors[] = 'Invalid player name format.';
$rank = $ots->createObject('GuildRank');
$rank->load($new_rank);
if(!$rank->isLoaded())
$change_errors[] = 'Rank with this ID doesn\'t exist.';
if($level_in_guild <= $rank->getLevel() && !$guild_leader)
$change_errors[] = 'You can\'t set ranks with equal or higher level than your.';
if(empty($change_errors))
{
if($guild_leader || $rank->getLevel() < $level_in_guild)
$player_to_change = $ots->createObject('Player');
$player_to_change->find($player_name);
if(!$player_to_change->isLoaded())
$change_errors[] = 'Player with name '.$player_name.'</b> doesn\'t exist.';
else
{
$ranks[$rid]['0'] = $rank->getId();
$ranks[$rid]['1'] = $rank->getName();
$rid++;
if(fieldExist('rank_id', 'players'))
$players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;');
else
$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`;');
$players_with_rank_number = $players_with_rank->rowCount();
if(count($players_with_rank) > 0)
$player_in_guild = false;
if($guild->getName() == $player_to_change->getRank()->getGuild()->getName() || $guild_leader)
{
foreach($players_with_rank as $result)
{
$player = $ots->createObject('Player');
$player->load($result['id']);
if(!$player->isLoaded())
continue;
if($guild->getOwner()->getId() != $player->getId() || $guild_leader)
{
$players_with_lower_rank[$sid]['0'] = $player->getName();
$players_with_lower_rank[$sid]['1'] = $player->getName().' ('.$rank->getName().')';
$sid++;
}
}
$player_in_guild = true;
$player_has_lower_rank = false;
if($player_to_change->getRank()->getLevel() < $level_in_guild || $guild_leader)
$player_has_lower_rank = true;
}
}
$rank_in_guild = false;
foreach($rank_list as $rank_from_guild)
if($rank_from_guild->getId() == $rank->getId())
$rank_in_guild = true;
if(!$player_in_guild)
$change_errors[] = 'This player isn\'t in your guild.';
if(!$rank_in_guild)
$change_errors[] = 'This rank isn\'t in your guild.';
if(!$player_has_lower_rank)
$change_errors[] = 'This player has higher rank in guild than you. You can\'t change his/her rank.';
}
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save')
if(empty($change_errors))
{
$player_name = stripslashes($_REQUEST['name']);
$new_rank = (int) $_REQUEST['rankid'];
if(!Validator::characterName($player_name))
$change_errors[] = 'Invalid player name format.';
$rank = $ots->createObject('GuildRank');
$rank->load($new_rank);
if(!$rank->isLoaded())
$change_errors[] = 'Rank with this ID doesn\'t exist.';
if($level_in_guild <= $rank->getLevel() && !$guild_leader)
$change_errors[] = 'You can\'t set ranks with equal or higher level than your.';
if(empty($change_errors))
$player_to_change->setRank($rank);
echo $twig->render('success.html.twig', array(
'title' => 'Rank Changed',
'description' => 'Rank of player <b>'.$player_to_change->getName().'</b> has been changed to <b>'.$rank->getName().'</b>.',
'custom_buttons' => ''
));
unset($players_with_lower_rank);
unset($ranks);
$rid = 0;
$sid= 0;
foreach($rank_list as $rank)
{
$player_to_change = $ots->createObject('Player');
$player_to_change->find($player_name);
if(!$player_to_change->isLoaded())
$change_errors[] = 'Player with name '.$player_name.'</b> doesn\'t exist.';
else
if($guild_leader || $rank->getLevel() < $level_in_guild)
{
$player_in_guild = false;
if($guild->getName() == $player_to_change->getRank()->getGuild()->getName() || $guild_leader)
$ranks[$rid]['0'] = $rank->getId();
$ranks[$rid]['1'] = $rank->getName();
$rid++;
if(fieldExist('rank_id', 'players'))
$players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;');
else
$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`;');
$players_with_rank_number = $players_with_rank->rowCount();
if(count($players_with_rank) > 0)
{
$player_in_guild = true;
$player_has_lower_rank = false;
if($player_to_change->getRank()->getLevel() < $level_in_guild || $guild_leader)
$player_has_lower_rank = true;
}
}
$rank_in_guild = false;
foreach($rank_list as $rank_from_guild)
if($rank_from_guild->getId() == $rank->getId())
$rank_in_guild = true;
if(!$player_in_guild)
$change_errors[] = 'This player isn\'t in your guild.';
if(!$rank_in_guild)
$change_errors[] = 'This rank isn\'t in your guild.';
if(!$player_has_lower_rank)
$change_errors[] = 'This player has higher rank in guild than you. You can\'t change his/her rank.';
}
if(empty($change_errors))
{
$player_to_change->setRank($rank);
echo '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <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 Deleted</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> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>Rank of player <b>'.$player_to_change->getName().'</b> has been changed to <b>'.$rank->getName().'</b>.</td></tr> </table> </div> </table></div></td></tr><br>';
unset($players_with_lower_rank);
unset($ranks);
$rid = 0;
$sid= 0;
foreach($rank_list as $rank)
{
if($guild_leader || $rank->getLevel() < $level_in_guild)
{
$ranks[$rid]['0'] = $rank->getId();
$ranks[$rid]['1'] = $rank->getName();
$rid++;
if(fieldExist('rank_id', 'players'))
$players_with_rank = $db->query('SELECT `id`, `rank_id` FROM `players` WHERE `rank_id` = ' . $rank->getId() . ' AND `deleted` = 0;');
else
$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`;');
$players_with_rank_number = $players_with_rank->rowCount();
if(count($players_with_rank) > 0)
foreach($players_with_rank as $result)
{
foreach($players_with_rank as $result)
$player = $ots->createObject('Player');
$player->load($result['id']);
if(!$player->isLoaded())
continue;
if($guild->getOwner()->getId() != $player->getId() || $guild_leader)
{
$player = $ots->createObject('Player');
$player->load($result['id']);
if(!$player->isLoaded())
continue;
if($guild->getOwner()->getId() != $player->getId() || $guild_leader)
{
$players_with_lower_rank[$sid]['0'] = $player->getName();
$players_with_lower_rank[$sid]['1'] = $player->getName().' ('.$rank->getName().')';
$sid++;
}
$players_with_lower_rank[$sid][0] = $player->getName();
$players_with_lower_rank[$sid][1] = $player->getName().' ('.$rank->getName().')';
$sid++;
}
}
}
}
}
else
{
echo $twig->render('error_box.html.twig', array('errors' => $change_errors));
}
}
echo '<FORM ACTION="?subtopic=guilds&action=change_rank&guild='.$guild->getName().'&todo=save" METHOD=post>
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
<TR BGCOLOR='.$config['vdarkborder'].'><TD class="white"><B>Change Rank</B></TD></TR>
<TR BGCOLOR='.$config['darkborder'].'><TD>Name: <SELECT NAME="name">';
foreach($players_with_lower_rank as $player_to_list)
echo '<OPTION value="'.$player_to_list['0'].'">'.$player_to_list['1'];
echo '</SELECT>&nbsp;Rank:&nbsp;<SELECT NAME="rankid">';
foreach($ranks as $rank)
echo '<OPTION value="'.$rank['0'].'">'.$rank['1'];
echo '</SELECT>&nbsp;&nbsp;&nbsp;<INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD><TR>
</TABLE></FORM><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><FORM ACTION="?subtopic=guilds&action=show&guild='.$guild->getName().'" METHOD=post><TR><TD><center><INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center></TD></TR></FORM></TABLE>';
else
{
echo $twig->render('error_box.html.twig', array('errors' => $change_errors));
}
}
else
echo 'Error. You are not a leader or vice leader in guild '.$guild->getName().'.<FORM ACTION="?subtopic=guilds&action=show&guild='.$guild->getName().'" METHOD=post><INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></FORM>';
echo $twig->render('guilds.change_rank.html.twig', array(
'players' => $players_with_lower_rank,
'guild_name' => $guild->getName(),
'ranks' => $ranks
));
}
else {
echo 'Error. You are not a leader or vice leader in guild ' . $guild->getName();
echo $twig->render('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => getLink('guilds') . '/' . $guild->getName()
));
}

View File

@@ -61,5 +61,6 @@ if($logged)
}
else
echo "You are not logged in.";
echo "<center><h3><a href=\"?subtopic=guilds\">BACK</a></h3></center>";
echo $twig->render('guilds.back_button.html.twig');
?>

View File

@@ -63,5 +63,6 @@ if($logged)
}
else
echo "You are not logged in.";
echo "<center><h3><a href=\"?subtopic=guilds\">BACK</a></h3></center>";
echo $twig->render('guilds.back_button.html.twig');
?>

View File

@@ -116,10 +116,9 @@ if(isset($todo) && $todo == 'save')
$player->setRank($rank);
}
}
echo $twig->render('success.html.twig', array(
'title' => 'Created guild',
'description' => '<b>Congratulations!</b><br/>You have created guild <b>' . $guild_name . '</b>. <b>'.$player->getName().'</b> is leader of this guild. Now you can invite players, change picture, description' . (MOTD_EXISTS ? ' and motd' : '') . ' of guild. Press submit to open guild manager.',
'custom_buttons' => '<table border="0" cellspacing="0" cellpadding="0" width="100%"><form action="?subtopic=guilds&action=show&guild='.$guild_name.'" method="post"><tr><td><center><input type="image" name="Submit" alt="Submit" src="'.$template_path.'/images/buttons/sbutton_Submit.gif" border="0" width="120" height="18"></center></td></tr></form></table>'
echo $twig->render('guilds.create_guild.success.html.twig', array(
'guild_name' => $guild_name,
'leader_name' => $player->getName()
));
/*$db->query('INSERT INTO `guild_ranks` (`id`, `guild_id`, `name`, `level`) VALUES (null, '.$new_guild->getId().', "the Leader", 3)');

View File

@@ -37,15 +37,15 @@ if(empty($errors)) {
echo $twig->render('success.html.twig', array(
'title' => 'Guild Deleted',
'description' => 'Guild with name <b>' . $guild_name . '</b> has been deleted.',
'custom_buttons' => '<center><form action="?subtopic=guilds" METHOD=post><div class="BigButton" style="background-image:url(' . $template_path . '/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(' . $template_path . '/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>'
'custom_buttons' => $twig->render('guilds.back_button.html.twig')
));
}
else {
echo $twig->render('success.html.twig', array(
'title' => 'Delete Guild',
'description' => 'Are you sure you want delete guild <b>' . $guild_name . '</b>?<br>
'description' => 'Are you sure you want delete guild <b>' . $guild_name . '</b>?<br/>
<form action="?subtopic=guilds&guild=' . $guild->getName() . '&action=delete_by_admin" METHOD="post"><input type="hidden" name="todo" value="save"><input type="submit" value="Yes, delete"></form>',
'custom_buttons' => '<center><form action="?subtopic=guilds" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>'
'custom_buttons' => $twig->render('guilds.back_button.html.twig')
));
}
}
@@ -60,7 +60,10 @@ if(empty($errors)) {
if(!empty($errors)) {
echo $twig->render('error_box.html.twig', array('errors' => $errors));
echo '<br/><center><form action="?subtopic=guilds" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
echo $twig->render('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => '?subtopic=guilds'
));
}
?>

View File

@@ -52,7 +52,7 @@ if(empty($errors)) {
echo $twig->render('success.html.twig', array(
'title' => 'Guild Deleted',
'description' => 'Guild with name <b>'.$guild_name.'</b> has been deleted.',
'custom_buttons' => '<center><form action="?subtopic=guilds" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>'
'custom_buttons' => $twig->render('guilds.back_button.html.twig')
));
}
else {
@@ -73,7 +73,9 @@ if(empty($errors)) {
if(!empty($errors)) {
echo $twig->render('error_box.html.twig', array('errors' => $errors));
echo '<br/><center><form action="?subtopic=guilds" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
echo $twig->render('guilds.back_button.html.twig', array(
'new_line' => true
));
}
?>

View File

@@ -18,7 +18,7 @@ if(!$logged)
$guild_errors[] = 'You are not logged in. You can\'t delete invitations.';
if(!Validator::guildName($guild_name))
$guild_errors[] = Validator::getLastError();
if(!Validator($name))
if(!Validator::characterName($name))
$guild_errors[] = 'Invalid name format.';
if(empty($guild_errors))
{
@@ -88,16 +88,24 @@ if(empty($guild_errors))
if(!empty($guild_errors))
{
echo $twig->render('error_box.html.twig', array('errors' => $guild_errors));
echo '
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><FORM ACTION="?subtopic=guilds&action=show&guild='.$guild_name.'" METHOD=post><TR><TD><center><INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center></TD></TR></FORM></TABLE>';
echo $twig->render('guilds.back_button.html.twig', array('action' => '?subtopic=guilds&action=show&guild=' . $guild_name));
}
else
{
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save')
{
$guild->deleteInvite($player);
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD class="white"><B>Delete player invitation</B></TD></TR><TR BGCOLOR='.$config['darkborder'].'><TD WIDTH=100%>Player with name <b>'.$player->getName().'</b> has been deleted from "invites list".</TD></TR></TABLE><br/><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><FORM ACTION="?subtopic=guilds&action=show&guild='.$guild_name.'" METHOD=post><TR><TD><center><INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center></TD></TR></FORM></TABLE>';
echo $twig->render('success.html.twig', array(
'title' => 'Deleted player invitation',
'description' => 'Player with name <b>' . $player->getName() . '</b> has been deleted from invites list.',
'custom_buttons' => $twig->render('guilds.back_button.html.twig', array('action' => '?subtopic=guilds&action=show&guild=' . $guild_name))
));
}
else {
echo $twig->render('guilds.delete_invite.html.twig', array(
'player_name' => $player->getName(),
'guild_name' => $guild->getName()
));
}
else
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD class="white"><B>Delete player invitation</B></TD></TR><TR BGCOLOR='.$config['darkborder'].'><TD WIDTH=100%>Are you sure you want to delete player with name <b>'.$player->getName().'</b> from "invites list"?</TD></TR></TABLE><br/><center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><TR><FORM ACTION="?subtopic=guilds&action=delete_invite&guild='.$guild->getName().'&name='.$player->getName().'&todo=save" METHOD=post><TD align="right" width="50%"><INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18>&nbsp;&nbsp;</TD></FORM><FORM ACTION="?subtopic=guilds&action=show&guild='.$guild_name.'" METHOD=post><TD>&nbsp;&nbsp;<INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></FORM></TABLE></center>';
}

View File

@@ -87,12 +87,19 @@ if(empty($guild_errors)) {
}
}
if($saved) {
echo '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <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" >Rank Deleted</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> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>Rank <b>'.$rank->getName().'</b> has been deleted. Players with this rank has now other rank.</td></tr> </table> </div> </table></div></td></tr>';
echo $twig->render('success.html.twig', array(
'title' => 'Rank Deleted',
'description' => 'Rank <b>'.$rank->getName().'</b> has been deleted. Players with this rank has now other rank.',
'custom_buttons' => ''
));
} else {
echo $twig->render('error_box.html.twig', array('errors' => $guild_errors2));
}
//back button
echo '<br/><center><form action="?subtopic=guilds&guild='.$guild->getName().'&action=manager" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
echo $twig->render('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => '?subtopic=guilds&guild='.$guild->getName().'&action=manager'
));
}
else
{
@@ -107,7 +114,10 @@ if(empty($guild_errors)) {
if(!empty($guild_errors)) {
echo $twig->render('error_box.html.twig', array('errors' => $guild_errors));
echo '<br/><center><form action="?subtopic=guilds" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
echo $twig->render('guilds.back_button.html.twig', array(
'new_line' => true,
'action' => '?subtopic=guilds'
));
}
?>

View File

@@ -15,22 +15,22 @@ defined('MYAAC') or die('Direct access not allowed!');
$guild_name = isset($_REQUEST['guild']) ? $_REQUEST['guild'] : NULL;
$name = isset($_REQUEST['name']) ? stripslashes($_REQUEST['name']) : NULL;
if(!$logged) {
$guild_errors[] = 'You are not logged in. You can\'t invite players.';
$errors[] = "You are not logged in. You can't invite players.";
}
if(!Validator::guildName($guild_name)) {
$guild_errors[] = Validator::getLastError();
$errors[] = Validator::getLastError();
}
if(empty($guild_errors)) {
if(empty($errors)) {
$guild = $ots->createObject('Guild');
$guild->find($guild_name);
if(!$guild->isLoaded()) {
$guild_errors[] = 'Guild with name <b>'.$guild_name.'</b> doesn\'t exist.';
$errors[] = 'Guild with name <b>'.$guild_name.'</b> doesn\'t exist.';
}
}
if(empty($guild_errors)) {
if(empty($errors)) {
$rank_list = $guild->getGuildRanksList();
$rank_list->orderBy('level', POT::ORDER_DESC);
$guild_leader = false;
@@ -58,53 +58,69 @@ if(empty($guild_errors)) {
}
if(!$guild_vice) {
$guild_errors[] = 'You are not a leader or vice leader of guild <b>'.$guild_name.'</b>.'.$level_in_guild;
$errors[] = 'You are not a leader or vice leader of guild <b>'.$guild_name.'</b>.'.$level_in_guild;
}
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
if(!Validator::characterName($name)) {
$guild_errors[] = 'Invalid name format.';
$errors[] = 'Invalid name format.';
}
if(empty($guild_errors)) {
if(empty($errors)) {
$player = new OTS_Player();
$player->find($name);
if(!$player->isLoaded()) {
$guild_errors[] = 'Player with name <b>' . $name . '</b> doesn\'t exist.';
$errors[] = 'Player with name <b>' . $name . '</b> doesn\'t exist.';
}
else
{
$rank_of_player = $player->getRank();
if($rank_of_player->isLoaded()) {
$guild_errors[] = 'Player with name <b>' . $name . '</b> is already in guild. He must leave guild before you can invite him.';
$errors[] = 'Player with name <b>' . $name . '</b> is already in guild. He must leave guild before you can invite him.';
}
}
}
}
if(empty($guild_errors)) {
if(empty($errors)) {
include(SYSTEM . 'libs/pot/InvitesDriver.php');
new InvitesDriver($guild);
$invited_list = $guild->listInvites();
if(count($invited_list) > 0) {
foreach($invited_list as $invited) {
if($invited->getName() == $player->getName()) {
$guild_errors[] = '<b>'.$invited->getName().'</b> is already invited to your guild.';
$errors[] = '<b>'.$invited->getName().'</b> is already invited to your guild.';
}
}
}
}
if(!empty($guild_errors)) {
echo $twig->render('error_box.html.twig', array('errors' => $guild_errors));
echo '
<table border="0" cellspacing="0" cellpadding="0" width="100%"><form action="?subtopic=guilds&action=show&guild='.$guild_name.'" method="post"><tr><td><center><input type=image name="Back" alt="Back" src="'.$template_path.'/images/buttons/sbutton_back.gif" border=0 width=120 height="18"></center></td></tr></form></table>';
$show = true;
if(!empty($errors)) {
echo $twig->render('error_box.html.twig', array('errors' => $errors));
}
else {
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
$guild->invite($player);
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD class="white"><B>Invite player</B></TD></TR><TR BGCOLOR='.$config['darkborder'].'><TD WIDTH=100%>Player with name <b>'.$player->getName().'</b> has been invited to your guild.</TD></TR></TABLE><br/><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><FORM ACTION="?subtopic=guilds&action=show&guild='.$guild_name.'" METHOD=post><TR><TD><center><INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center></TD></TR></FORM></TABLE>';
echo $twig->render('success.html.twig', array(
'title' => 'Invite player',
'description' => 'Player with name <b>' . $player->getName() . '</b> has been invited to your guild.',
'custom_buttons' => ''
));
$show = false;
}
else {
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD class="white"><B>Invite player</B></TD></TR><TR BGCOLOR='.$config['darkborder'].'><TD WIDTH=100%><FORM ACTION="?subtopic=guilds&action=invite&guild='.$guild->getName().'&todo=save" METHOD=post>Invite player with name:&nbsp;&nbsp;<INPUT TYPE="text" NAME="name">&nbsp;&nbsp;&nbsp;&nbsp;<INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></FORM></TD></TD></TR></TR></TABLE><br/><center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><TR><FORM ACTION="?subtopic=guilds&action=show&guild='.$guild_name.'" METHOD=post><TD><INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></FORM></TABLE></center>';
}
}
}
if($show) {
echo $twig->render('success.html.twig', array(
'title' => 'Invite player',
'description' => $twig->render('guilds.invite.html.twig', array(
'guild_name' => $guild->getName()
)),
'custom_buttons' => ''
));
}
echo $twig->render('guilds.back_button.html.twig', array(
'action' => getLink('guilds') . '/' . $guild_name
));

View File

@@ -94,19 +94,28 @@ if(empty($errors)) {
if(!empty($errors)) {
echo $twig->render('error_box.html.twig', array('errors' => $errors));
echo '
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><FORM ACTION="?subtopic=guilds&action=show&guild='.$guild_name.'" METHOD=post><TR><TD><center><INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center></TD></TR></FORM></TABLE>';
echo $twig->render('guilds.back_button.html.twig', array(
'action' => getLink('guilds') . '/' . $guild_name
));
}
else
{
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
$player->setRank();
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD class="white"><B>Kick player</B></TD></TR><TR BGCOLOR='.$config['darkborder'].'><TD WIDTH=100%>Player with name <b>'.$player->getName().'</b> has been kicked from your guild.</TD></TR></TABLE><br/><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><FORM ACTION="?subtopic=guilds&action=show&guild='.$guild_name.'" METHOD=post><TR><TD><center><INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center></TD></TR></FORM></TABLE>';
echo $twig->render('success.html.twig', array(
'title' => 'Kick player',
'description' => 'Player with name <b>'.$player->getName().'</b> has been kicked from your guild.',
'custom_buttons' => $twig->render('guilds.back_button.html.twig', array(
'action' => getLink('guilds') . '/' . $guild_name
))
));
}
else
{
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD class="white"><B>Kick player</B></TD></TR><TR BGCOLOR='.$config['darkborder'].'><TD WIDTH=100%>Are you sure you want to kick player with name <b>'.$player->getName().'</b> from your guild?</TD></TR></TABLE><br/><center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><TR><FORM ACTION="?subtopic=guilds&action=kick_player&guild='.$guild->getName().'&name='.$player->getName().'&todo=save" METHOD=post><TD align="right" width="50%"><INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18>&nbsp;&nbsp;</TD></FORM><FORM ACTION="?subtopic=guilds&action=show&guild='.$guild_name.'" METHOD=post><TD>&nbsp;&nbsp;<INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></FORM></TABLE></center>';
else {
echo $twig->render('guilds.kick_player.html.twig', array(
'player_name' => $player->getName(),
'guild_name' => $guild->getName()
));
}
}
?>

View File

@@ -15,7 +15,7 @@ defined('MYAAC') or die('Direct access not allowed!');
$guild_name = isset($_REQUEST['guild']) ? $_REQUEST['guild'] : NULL;
$name = isset($_REQUEST['name']) ? stripslashes($_REQUEST['name']) : NULL;
if(!$logged) {
$errors[] = 'You are not logged in. You can\'t leave guild.';
$errors[] = "You are not logged in. You can't leave guild.";
}
if(!Validator::guildName($guild_name)) {
@@ -26,7 +26,7 @@ if(empty($errors)) {
$guild = new OTS_Guild();
$guild->find($guild_name);
if(!$guild->isLoaded()) {
$errors[] = 'Guild with name <b>'.$guild_name.'</b> doesn\'t exist.';
$errors[] = "Guild with name <b>" . $guild_name . "</b> doesn't exist.";
}
}
@@ -42,11 +42,11 @@ if(empty($errors)) {
$player = new OTS_Player();
$player->find($name);
if(!$player->isLoaded()) {
$errors[] = 'Character <b>'.$name.'</b> doesn\'t exist.';
$errors[] = "Character <b>" . $name . "</b> doesn't exist.";
}
else {
if($player->getAccount()->getId() != $account_logged->getId()) {
$errors[] = 'Character <b>'.$name.'</b> isn\'t from your account!';
$errors[] = "Character <b>" . $name . "</b> isn't from your account!";
}
}
}
@@ -55,17 +55,17 @@ if(empty($errors)) {
$player_loaded_rank = $player->getRank();
if($player_loaded_rank->isLoaded()) {
if($player_loaded_rank->getGuild()->getName() != $guild->getName()) {
$errors[] = 'Character <b>'.$name.'</b> isn\'t from guild <b>'.$guild->getName().'</b>.';
$errors[] = "Character <b>" . $name . "</b> isn't from guild <b>" . $guild->getName() . "</b>.";
}
}
else {
$errors[] = 'Character <b>'.$name.'</b> isn\'t in any guild.';
$errors[] = "Character <b>" . $name . "</b> isn't in any guild.";
}
}
if(empty($errors)) {
if($guild_owner_name == $player->getName()) {
$errors[] = 'You can\'t leave guild. You are an owner of guild.';
$errors[] = "You can't leave guild. You are an owner of guild.";
}
}
}
@@ -87,39 +87,30 @@ if(empty($errors)) {
if(!empty($errors)) {
echo $twig->render('error_box.html.twig', array('errors' => $errors));
echo '
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><FORM ACTION="?subtopic=guilds&action=show&guild='.$guild_name.'" METHOD=post><TR><TD><center><INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center></TD></TR></FORM></TABLE>';
echo $twig->render('guilds.back_button.html.twig', array(
'action' => getLink('guilds') . '/' . $guild_name
));
}
else
{
if(isset($_REQUEST['todo']) && $_REQUEST['todo'] == 'save') {
$player->setRank();
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD class="white"><B>Leave guild</B></TD></TR><TR BGCOLOR='.$config['darkborder'].'><TD WIDTH=100%>Player with name <b>'.$player->getName().'</b> leaved guild <b>'.$guild->getName().'</b>.</TD></TR></TABLE><br/><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><FORM ACTION="?subtopic=guilds&action=show&guild='.$guild_name.'" METHOD=post><TR><TD><center><INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center></TD></TR></FORM></TABLE>';
$twig->render('success.html.twig', array(
'title' => 'Leave guild',
'description' => 'Player with name <b>'.$player->getName().'</b> leaved guild <b>'.$guild->getName().'</b>.',
'custom_buttons' => $twig->render('guilds.back_button.html.twig', array(
'action' => getLink('guilds') . '/' . $guild_name
))
));
}
else
{
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'><TD class="white"><B>Leave guild</B></TD></TR>';
if(count($array_of_player_ig) > 0) {
echo '<TR BGCOLOR='.$config['lightborder'].'><TD WIDTH=100%>Select character to leave guild:</TD></TR>';
echo '<TR BGCOLOR='.$config['darkborder'].'><TD>
<form action="?subtopic=guilds&action=leave_guild&guild='.$guild_name.'&todo=save" METHOD="post">';
sort($array_of_player_ig);
foreach($array_of_player_ig as $player_to_leave) {
echo '<input type="radio" name="name" value="'.$player_to_leave.'" />'.$player_to_leave.'<br>';
}
echo '</TD></TR><br></TABLE>';
}
else {
echo '<TR BGCOLOR='.$config['lightborder'].'><TD WIDTH=100%>Any of your characters can\'t leave guild.</TD></TR>';
}
sort($array_of_player_ig);
echo '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><tr>';
if(count($array_of_player_ig) > 0) {
echo '<td width="130" valign="top"><INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></form></td>';
}
echo '<td><FORM ACTION="?subtopic=guilds&action=show&guild='.$guild_name.'" METHOD=post><INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></FORM></td></tr></table>';
echo $twig->render('guilds.leave_guild.html.twig', array(
'players' => $array_of_player_ig,
'guild_name' => $guild_name
));
}
}

View File

@@ -67,7 +67,7 @@ if($_REQUEST['preview'] == 2)
if($logged)
echo '
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds&action=create_guild" METHOD=post><TR><TD>
<INPUT TYPE=image NAME="Create Guild" ALT="Create Guild" SRC="'.$template_path.'/images/buttons/sbutton_createguild.png" BORDER=0 WIDTH=120 HEIGHT=18>
<INPUT TYPE=image NAME="Create Guild" ALT="Create Guild" SRC="'.$template_path.'/images/global/buttons/sbutton_createguild.png" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR></FORM></TABLE>';
echo '
@@ -95,7 +95,7 @@ else
if(admin())
echo '<br /><a href="?subtopic=guilds&action=delete_by_admin&guild='.$guild->getName().'">Delete this guild (for ADMIN only!)</a>';
echo '</TD><TD><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="' . $link . '" METHOD=post><TR><TD>
<INPUT TYPE=image NAME="View" ALT="View" SRC="'.$template_path.'/images/buttons/sbutton_view.gif" BORDER=0 WIDTH=120 HEIGHT=18>
<INPUT TYPE=image NAME="View" ALT="View" SRC="'.$template_path.'/images/global/buttons/sbutton_view.gif" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR></FORM></TABLE>
</TD></TR>';
}
@@ -106,7 +106,7 @@ else
<TD>';
if($logged)
echo '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds&action=create_guild" METHOD=post><TR><TD>
<INPUT TYPE=image NAME="Create Guild" ALT="Create Guild" SRC="'.$template_path.'/images/buttons/sbutton_createguild.png" BORDER=0 WIDTH=120 HEIGHT=18>
<INPUT TYPE=image NAME="Create Guild" ALT="Create Guild" SRC="'.$template_path.'/images/global/buttons/sbutton_createguild.png" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR></FORM></TABLE>';
echo '
</TD></TR>';
@@ -116,13 +116,13 @@ else
echo '</TABLE><br><br>';
if($logged)
echo '<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><TD ALIGN=center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=guilds&action=create_guild" METHOD=post><TR><TD>
<INPUT TYPE=image NAME="Create Guild" ALT="Create Guild" SRC="'.$template_path.'/images/buttons/sbutton_createguild.png" BORDER=0 WIDTH=120 HEIGHT=18>
<INPUT TYPE=image NAME="Create Guild" ALT="Create Guild" SRC="'.$template_path.'/images/global/buttons/sbutton_createguild.png" BORDER=0 WIDTH=120 HEIGHT=18>
</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>
<BR />If you have any problem with guilds try:
<BR /><a href="?subtopic=guilds&action=cleanup_players">Cleanup players</a> - can\'t join guild/be invited? Can\'t create guild? Try cleanup players.
<BR /><a href="?subtopic=guilds&action=cleanup_guilds">Cleanup guilds</a> - made guild, you are a leader, but you are not on players list? Cleanup guilds!';
else
echo 'Before you can create guild you must login.<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><TD ALIGN=center><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=accountmanagement&redirect=' . getLink('guilds') . '" METHOD=post><TR><TD>
<INPUT TYPE=image NAME="Login" ALT="Login" SRC="'.$template_path.'/images/buttons/sbutton_login.gif" BORDER=0 WIDTH=120 HEIGHT=18>
<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><TD ALIGN=center><IMG SRC="'.$template_path.'/images/general/blank.gif" WIDTH=80 HEIGHT=1 BORDER=0<BR></TD></TR></TABLE>';
?>

View File

@@ -86,7 +86,7 @@ if(empty($guild_errors) && empty($guild_errors2)) {
echo $twig->render('success.html.twig', array(
'title' => 'Leadership passed',
'description' => '<b>'.$to_player->getName().'</b> is now a Leader of <b>'.$guild_name.'</b>.',
'custom_buttons' => '<center><form action="?subtopic=guilds&guild='.$guild->getName().'&action=show" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>'
'custom_buttons' => '<center><form action="' . getLink('guilds') . '/' . $guild->getName().'" METHOD=post>' . $twig->render('buttons.back.html.twig') . '</form></center>'
));
}
else {
@@ -106,7 +106,7 @@ if(empty($guild_errors) && empty($guild_errors2)) {
if(empty($guild_errors) && !empty($guild_errors2)) {
echo $twig->render('error_box.html.twig', array('errors' => $guild_errors2));
echo '<br/><center><form action="?subtopic=guilds&guild='.$guild->getName().'&action=pass_leadership" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
echo '<br/><center><form action="?subtopic=guilds&guild='.$guild->getName().'&action=pass_leadership" method="post">' . $twig->render('buttons.back.html.twig') . '</form></center>';
}
if(!empty($guild_errors)) {
if(!empty($guild_errors2)) {
@@ -114,7 +114,7 @@ if(!empty($guild_errors)) {
}
echo $twig->render('error_box.html.twig', array('errors' => $guild_errors));
echo '<br/><center><form action="?subtopic=guilds" METHOD=post><div class="BigButton" style="background-image:url('.$template_path.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$template_path.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$template_path.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
echo '<br/><center><form action="?subtopic=guilds" method="post">' . $twig->render('buttons.back.html.twig') . '</form></center>';
}
?>

View File

@@ -13,19 +13,19 @@ defined('MYAAC') or die('Direct access not allowed!');
$guild_name = $_REQUEST['guild'];
if(!Validator::guildName($guild_name))
$guild_errors[] = Validator::getLastError();
if(empty($guild_errors))
$errors[] = Validator::getLastError();
if(empty($errors))
{
$guild = $ots->createObject('Guild');
$guild->find($guild_name);
if(!$guild->isLoaded())
$guild_errors[] = 'Guild with name <b>'.$guild_name.'</b> doesn\'t exist.';
$errors[] = 'Guild with name <b>'.$guild_name.'</b> doesn\'t exist.';
}
if(!empty($guild_errors))
if(!empty($errors))
{
echo $twig->render('error_box.html.twig', array('errors' => $guild_errors));
echo '
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%><FORM ACTION="?subtopic=guilds" METHOD=post><TR><TD><center><INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center></TD></TR></FORM></TABLE>';
echo $twig->render('error_box.html.twig', array('errors' => $errors));
echo $twig->render('guilds.back_button.html.twig');
}
else
{
@@ -88,7 +88,7 @@ else
<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/buttons/sbutton_manageguild.png" BORDER=0 WIDTH=120 HEIGHT=18 alt="Manage Guild"></a>';
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>
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
@@ -196,7 +196,7 @@ else
<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/buttons/sbutton_view.gif" BORDER=0 WIDTH=120>
<INPUT TYPE=image NAME="View" ALT="View" SRC="'.$template_path.'/images/global/buttons/sbutton_view.gif" BORDER=0 WIDTH=120>
</FORM>
</TD>
</TR>';
@@ -219,7 +219,7 @@ else
$showed_invited = 1;
foreach($invited_list as $invited_player)
{
if(count($account_players) > 0)
if($logged && count($account_players) > 0)
foreach($account_players as $player_from_acc)
if($player_from_acc->getName() == $invited_player->getName())
$show_accept_invite++;
@@ -235,30 +235,30 @@ else
<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/buttons/sbutton_login.gif" BORDER=0 WIDTH=120 HEIGHT=18>
<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/buttons/sbutton_acceptinvite.png" BORDER=0 WIDTH=120 HEIGHT=18>
<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/buttons/sbutton_inviteplayer.png" BORDER=0 WIDTH=120 HEIGHT=18>
<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/buttons/sbutton_changerank.png" BORDER=0 WIDTH=120 HEIGHT=18>
<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/buttons/sbutton_leaveguild.png" BORDER=0 WIDTH=120 HEIGHT=18>
<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>
<INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18>
' . $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>

View File

@@ -225,7 +225,7 @@ $type = '';
<FORM ACTION=?subtopic=houses&page=view METHOD=post>
<TR><TD>
<INPUT TYPE=hidden NAME=house VALUE="'.$house['name'].'">
<INPUT TYPE=image NAME="View" ALT="View" SRC="'.$template_path.'/images/buttons/sbutton_view.gif" BORDER=0 WIDTH=120 HEIGHT=18>
<INPUT TYPE=image NAME="View" ALT="View" SRC="'.$template_path.'/images/global/buttons/sbutton_view.gif" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR>
</FORM>
</TABLE>
@@ -301,7 +301,7 @@ $type = '';
<BR>
<CENTER>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD>
<INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18>
' . $twig->render('buttons.submit.html.twig') . '
</TD></TR></FORM></TABLE>
</CENTER>';
}

View File

@@ -53,7 +53,7 @@ elseif($action == 'step1' && $action_type == 'email')
</TABLE>
<BR>
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center>
<INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center>
' . $twig->render('buttons.submit.html.twig') . '</center>
</TD></TR></FORM></TABLE></TABLE>';
else
{
@@ -70,7 +70,7 @@ elseif($action == 'step1' && $action_type == 'email')
else
echo 'Invalid player name format. If you have other characters on account try with other name.';
echo '<BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center>
<a href="?subtopic=lostaccount" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center>
<a href="?subtopic=lostaccount" border="0"><IMG SRC="'.$template_path.'/images/global/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center>
</TD></TR></FORM></TABLE></TABLE>';
}
elseif($action == 'sendcode')
@@ -133,7 +133,7 @@ elseif($action == 'sendcode')
else
echo 'Invalid player name format. If you have other characters on account try with other name.';
echo '<BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center>
<a href="?subtopic=lostaccount&action=step1&action_type=email&nick='.urlencode($nick).'" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center>
<a href="?subtopic=lostaccount&action=step1&action_type=email&nick='.urlencode($nick).'" border="0"><IMG SRC="'.$template_path.'/images/global/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center>
</TD></TR></FORM></TABLE></TABLE>';
}
elseif($action == 'step1' && $action_type == 'reckey')
@@ -162,7 +162,7 @@ elseif($action == 'step1' && $action_type == 'reckey')
</TABLE>
<BR>
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center>
<INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center>
' . $twig->render('buttons.submit.html.twig') . '</center>
</TD></TR></FORM></TABLE></TABLE>';
}
else
@@ -174,7 +174,7 @@ elseif($action == 'step1' && $action_type == 'reckey')
else
echo 'Invalid player name format. If you have other characters on account try with other name.';
echo '<BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center>
<a href="?subtopic=lostaccount" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center>
<a href="?subtopic=lostaccount" border="0"><IMG SRC="'.$template_path.'/images/global/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center>
</TD></TR></FORM></TABLE></TABLE>';
}
elseif($action == 'step2')
@@ -248,7 +248,7 @@ elseif($action == 'step2')
</TABLE>
<BR>
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center>
<INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center>
' . $twig->render('buttons.submit.html.twig') . '</center>
</TD></TR></FORM></TABLE></TABLE>';
}
else
@@ -263,7 +263,7 @@ elseif($action == 'step2')
else
echo 'Invalid player name format. If you have other characters on account try with other name.';
echo '<BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center>
<a href="?subtopic=lostaccount&action=step1&action_type=reckey&nick='.urlencode($nick).'" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center>
<a href="?subtopic=lostaccount&action=step1&action_type=reckey&nick='.urlencode($nick).'" border="0"><IMG SRC="'.$template_path.'/images/global/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center>
</TD></TR></FORM></TABLE></TABLE>';
}
elseif($action == 'step3')
@@ -341,7 +341,7 @@ elseif($action == 'step3')
<INPUT TYPE=hidden NAME="password_login" VALUE="'.$new_pass.'">
</TD></TR></TABLE><BR>
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center>
<INPUT TYPE=image NAME="Login" ALT="Login" SRC="'.$template_path.'/images/buttons/sbutton_login.gif" BORDER=0 WIDTH=120 HEIGHT=18></center>
<INPUT TYPE=image NAME="Login" ALT="Login" SRC="'.$template_path.'/images/global/buttons/sbutton_login.gif" BORDER=0 WIDTH=120 HEIGHT=18></center>
</TD></TR></FORM></TABLE></TABLE>';
}
else
@@ -362,7 +362,7 @@ elseif($action == 'step3')
else
echo 'Invalid player name format. If you have other characters on account try with other name.';
echo '<BR /><TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center>
<a href="?subtopic=lostaccount&action=step1&action_type=reckey&nick='.urlencode($nick).'" border="0"><IMG SRC="'.$template_path.'/images/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center>
<a href="?subtopic=lostaccount&action=step1&action_type=reckey&nick='.urlencode($nick).'" border="0"><IMG SRC="'.$template_path.'/images/global/buttons/sbutton_back.gif" NAME="Back" ALT="Back" BORDER=0 WIDTH=120 HEIGHT=18></a></center>
</TD></TR></FORM></TABLE></TABLE>';
}
elseif($action == 'checkcode')
@@ -381,7 +381,7 @@ elseif($action == 'checkcode')
</TABLE>
<BR>
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center>
<INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center>
' . $twig->render('buttons.submit.html.twig') . '</center>
</TD></TR></FORM></TABLE></TABLE>';
else
{
@@ -431,7 +431,7 @@ elseif($action == 'checkcode')
</TABLE>
<BR>
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center>
<INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center>
' . $twig->render('buttons.submit.html.twig') . '</center>
</TD></TR></FORM></TABLE></TABLE>';
}
else
@@ -452,7 +452,7 @@ elseif($action == 'checkcode')
</TABLE>
<BR>
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center>
<INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center>
' . $twig->render('buttons.submit.html.twig') . '</center>
</TD></TR></FORM></TABLE></TABLE>';
}
elseif($action == 'setnewpassword')
@@ -465,7 +465,7 @@ elseif($action == 'setnewpassword')
echo '<font color="red"><b>Error. Try again.</b></font><br />Please enter code from e-mail and name of one character from account. Then press Submit.<BR>
<BR><FORM ACTION="?subtopic=lostaccount&action=checkcode" METHOD=post>
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center>
<INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center>
<INPUT TYPE=image NAME="Back" ALT="Back" SRC="'.$template_path.'/images/global/buttons/sbutton_back.gif" BORDER=0 WIDTH=120 HEIGHT=18></center>
</TD></TR></FORM></TABLE></TABLE>';
else
{
@@ -519,7 +519,7 @@ elseif($action == 'setnewpassword')
<BR>
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center>
<FORM ACTION="?subtopic=accountmanagement" METHOD=post>
<INPUT TYPE=image NAME="Login" ALT="Login" SRC="'.$template_path.'/images/buttons/sbutton_login.gif" BORDER=0 WIDTH=120 HEIGHT=18></center>
<INPUT TYPE=image NAME="Login" ALT="Login" SRC="'.$template_path.'/images/global/buttons/sbutton_login.gif" BORDER=0 WIDTH=120 HEIGHT=18></center>
</TD></TR></FORM></TABLE></TABLE>';
}
else
@@ -543,7 +543,7 @@ elseif($action == 'setnewpassword')
</TABLE>
<BR>
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%><TR><TD><center>
<INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$template_path.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></center>
' . $twig->render('buttons.submit.html.twig') . '</center>
</TD></TR></FORM></TABLE></TABLE>';
}
?>

View File

@@ -69,7 +69,7 @@ if(isset($_GET['archive']))
?>
<center>
<table cellspacing="0" cellpadding="0" border="0"><form method="post" action="<?php echo getLink('news/archive'); ?>"><tbody><tr><td>
<input width="120" height="18" border="0" type="image" src="<?php echo $template_path; ?>/images/buttons/sbutton_back.gif" alt="Back" name="Back">
<input width="120" height="18" border="0" type="image" src="<?php echo $template_path; ?>/images/global/buttons/sbutton_back.gif" alt="Back" name="Back">
</form></td></tr></tbody></table>
</center>
<?php

View File

@@ -127,29 +127,5 @@ echo $twig->render('online.html.twig', array(
));
//search bar
echo '<br/>
<form action="?subtopic=characters" method=post>
<table width="100%" border="0" cellspacing="1" cellpadding="4">
<tr>
<td bgcolor="'.$config['vdarkborder'].'" class="white">
<b>Search Character</b>
</td>
</tr>
<tr>
<td bgcolor="'.$config['darkborder'].'">
<table border=0 cellpadding=1>
<tr>
<td>Name:</td>
<td>
<input name="name" value=""size=29 maxlength=29>
</td>
<td>
<input type="image" name="Submit" src="'.$template_path.'/images/buttons/sbutton_submit.gif" border="0" width="120" height="18">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>';
echo $twig->render('online.form.html.twig');
?>

View File

@@ -46,24 +46,33 @@ if(!in_array($order, array('spell', 'words', 'type', 'mana', 'level', 'maglevel'
<td class="white"><b>Spell Search</b></td>
</tr>
<tr bgcolor="<?php echo $config['darkborder']; ?>">
<td>Only for vocation: <select name="vocation_id">
<option value="All" <?php
if('All' == $vocation_id)
echo 'SELECTED';
echo '>All';
foreach($config['vocations'] as $id => $vocation)
{
echo '<option value="' . $id . '" ';
if($id == $vocation_id && $vocation_id != "All" && $vocation_id != '')
echo 'SELECTED';
echo '>' . $vocation;
}
?>
</select>
<input type="hidden" name="order" value="<?php echo $order; ?>">&nbsp;&nbsp;&nbsp;<input type="image" name="Submit" alt="Submit" src="<?php echo $template_path; ?>/images/buttons/sbutton_submit.gif" border="0" width="120" height="18">
<td>
<table border="0" cellpadding="1">
<tr>
<td>Only for vocation: <select name="vocation_id">
<option value="All" <?php
if('All' == $vocation_id)
echo 'SELECTED';
echo '>All';
foreach($config['vocations'] as $id => $vocation)
{
echo '<option value="' . $id . '" ';
if($id == $vocation_id && $vocation_id != "All" && $vocation_id != '')
echo 'SELECTED';
echo '>' . $vocation;
}
?>
</select>
<input type="hidden" name="order" value="<?php echo $order; ?>">
</td>
<td>
<?php echo $twig->render('buttons.submit.html.twig'); ?>
</td>
</tr>
</table>
</td>
</tr>
</table>