Ir para conteúdo
  • 0

Premium Time Adicionando Errado


eduardosm14

Pergunta

quando eu clico em comprar 30 dias de premium, ele nao compra 30 premium

 

Premium Account, 1354438189 days left

(Premium time expired at 2 December 2012, 1:49:49 CEST)

 

 

isso tah certo?, se nao tiver ocmo arruma?

 

 

shopsystem.php

 

 

 

<?PHP

if($config['site']['shop_system'] == 1) {

if($logged)

$user_premium_points = $account_logged->getCustomField('premium_points');

else

$user_premium_points = 'Login first';

 

function getItemByID($id)

{

$id = (int) $id;

$SQL = $GLOBALS['SQL'];

$data = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_offer').' WHERE '.$SQL->fieldName('id').' = '.$SQL->quote($id).';')->fetch();

if ($data['offer_type'] == 'pacc')

{

$offer['id'] = $data['id'];

$offer['type'] = $data['offer_type'];

$offer['days'] = $data['count1'];

$offer['points'] = $data['points'];

$offer['description'] = $data['offer_description'];

$offer['name'] = $data['offer_name'];

}

elseif ($data['offer_type'] == 'item')

{

$offer['id'] = $data['id'];

$offer['type'] = $data['offer_type'];

$offer['item_id'] = $data['itemid1'];

$offer['item_count'] = $data['count1'];

$offer['points'] = $data['points'];

$offer['description'] = $data['offer_description'];

$offer['name'] = $data['offer_name'];

}

elseif ($data['offer_type'] == 'vipdays')

{

$offer['id'] = $data['id'];

$offer['type'] = $data['offer_type'];

$offer['days'] = $data['count1'];

$offer['points'] = $data['points'];

$offer['description'] = $data['offer_description'];

$offer['name'] = $data['offer_name'];

}

elseif ($data['offer_type'] == 'itemvip')

{

$offer['id'] = $data['id'];

$offer['type'] = $data['offer_type'];

$offer['item_id'] = $data['itemid1'];

$offer['item_count'] = $data['count1'];

$offer['points'] = $data['points'];

$offer['description'] = $data['offer_description'];

$offer['name'] = $data['offer_name'];

}

elseif ($data['offer_type'] == 'container')

{

$offer['id'] = $data['id'];

$offer['type'] = $data['offer_type'];

$offer['container_id'] = $data['itemid2'];

$offer['container_count'] = $data['count2'];

$offer['item_id'] = $data['itemid1'];

$offer['item_count'] = $data['count1'];

$offer['points'] = $data['points'];

$offer['description'] = $data['offer_description'];

$offer['name'] = $data['offer_name'];

}

elseif ($data['offer_type'] == 'unban')

{

$offer['id'] = $data['id'];

$offer['type'] = $data['offer_type'];

$offer['points'] = $data['points'];

$offer['description'] = $data['offer_description'];

$offer['name'] = $data['offer_name'];

}

 

elseif ($data['offer_type'] == 'redskull')

{

$offer['id'] = $data['id'];

$offer['type'] = $data['offer_type'];

$offer['points'] = $data['points'];

$offer['description'] = $data['offer_description'];

$offer['name'] = $data['offer_name'];

}

elseif ($data['offer_type'] == 'itemlogout')

{

$offer['id'] = $data['id'];

$offer['type'] = $data['offer_type'];

$offer['points'] = $data['points'];

$offer['description'] = $data['offer_description'];

$offer['pid'] = $data['pid'];

$offer['count1'] = $data['count1'];

$offer['item_id'] = $data['itemid1'];

$offer['free_cap'] = $data['free_cap'];

}

elseif ($data['offer_type'] == 'changename')

{

$offer['id'] = $data['id'];

$offer['type'] = $data['offer_type'];

$offer['points'] = $data['points'];

$offer['description'] = $data['offer_description'];

$offer['name'] = $data['offer_name'];

}

return $offer;

}

 

function getOfferArray()

{

$offer_list = $GLOBALS['SQL']->query('SELECT * FROM '.$GLOBALS['SQL']->tableName('z_shop_offer').';');

$i_pacc = 0;

$i_item = 0;

$i_vipdays = 0;

$i_itemvip = 0;

$i_container = 0;

$i_unban = 0;

$i_redskull = 0;

$i_itemlogout = 0;

$i_changename = 0;

while($data = $offer_list->fetch()) {

if ($data['offer_type'] == 'pacc')

{

$offer_array['pacc'][$i_pacc]['id'] = $data['id'];

$offer_array['pacc'][$i_pacc]['days'] = $data['count1'];

$offer_array['pacc'][$i_pacc]['points'] = $data['points'];

$offer_array['pacc'][$i_pacc]['description'] = $data['offer_description'];

$offer_array['pacc'][$i_pacc]['name'] = $data['offer_name'];

$i_pacc++;

}

elseif ($data['offer_type'] == 'item')

{

$offer_array['item'][$i_item]['id'] = $data['id'];

$offer_array['item'][$i_item]['item_id'] = $data['itemid1'];

$offer_array['item'][$i_item]['item_count'] = $data['count1'];

$offer_array['item'][$i_item]['points'] = $data['points'];

$offer_array['item'][$i_item]['description'] = $data['offer_description'];

$offer_array['item'][$i_item]['name'] = $data['offer_name'];

$i_item++;

}

elseif ($data['offer_type'] == 'vipdays')

{

$offer_array['vipdays'][$i_vipdays]['id'] = $data['id'];

$offer_array['vipdays'][$i_vipdays]['days'] = $data['count1'];

$offer_array['vipdays'][$i_vipdays]['points'] = $data['points'];

$offer_array['vipdays'][$i_vipdays]['description'] = $data['offer_description'];

$offer_array['vipdays'][$i_vipdays]['name'] = $data['offer_name'];

$i_vipdays++;

}

elseif ($data['offer_type'] == 'itemvip')

{

$offer_array['itemvip'][$i_itemvip]['id'] = $data['id'];

$offer_array['itemvip'][$i_itemvip]['item_id'] = $data['itemid1'];

$offer_array['itemvip'][$i_itemvip]['item_count'] = $data['count1'];

$offer_array['itemvip'][$i_itemvip]['points'] = $data['points'];

$offer_array['itemvip'][$i_itemvip]['description'] = $data['offer_description'];

$offer_array['itemvip'][$i_itemvip]['name'] = $data['offer_name'];

$i_itemvip++;

}

elseif ($data['offer_type'] == 'container')

{

$offer_array['container'][$i_container]['id'] = $data['id'];

$offer_array['container'][$i_container]['container_id'] = $data['itemid2'];

$offer_array['container'][$i_container]['container_count'] = $data['count2'];

$offer_array['container'][$i_container]['item_id'] = $data['itemid1'];

$offer_array['container'][$i_container]['item_count'] = $data['count1'];

$offer_array['container'][$i_container]['points'] = $data['points'];

$offer_array['container'][$i_container]['description'] = $data['offer_description'];

$offer_array['container'][$i_container]['name'] = $data['offer_name'];

$i_container++;

}

elseif ($data['offer_type'] == 'unban')

{

$offer_array['unban'][$i_unban]['id'] = $data['id'];

$offer_array['unban'][$i_unban]['points'] = $data['points'];

$offer_array['unban'][$i_unban]['description'] = $data['offer_description'];

$offer_array['unban'][$i_unban]['name'] = $data['offer_name'];

$i_unban++;

}

elseif ($data['offer_type'] == 'redskull')

{

$offer_array['redskull'][$i_redskull]['id'] = $data['id'];

$offer_array['redskull'][$i_redskull]['points'] = $data['points'];

$offer_array['redskull'][$i_redskull]['description'] = $data['offer_description'];

$offer_array['redskull'][$i_redskull]['name'] = $data['offer_name'];

$i_redskull++;

}

elseif ($data['offer_type'] == 'itemlogout')

{

$offer_array['itemlogout'][$i_itemlogout]['id'] = $data['id'];

$offer_array['itemlogout'][$i_itemlogout]['points'] = $data['points'];

$offer_array['itemlogout'][$i_itemlogout]['description'] = $data['offer_description'];

$offer_array['itemlogout'][$i_itemlogout]['name'] = $data['offer_name'];

$offer_array['itemlogout'][$i_itemlogout]['count1'] = $data['count1'];

$offer_array['itemlogout'][$i_itemlogout]['pid'] = $data['pid'];

$offer_array['itemlogout'][$i_itemlogout]['item_id'] = $data['itemid1'];

$offer_array['itemlogout'][$i_itemlogout]['free_cap'] = $data['free_cap'];

$i_itemlogout++;

}

elseif ($data['offer_type'] == 'changename')

{

$offer_array['changename'][$i_changename]['id'] = $data['id'];

$offer_array['changename'][$i_changename]['points'] = $data['points'];

$offer_array['changename'][$i_changename]['description'] = $data['offer_description'];

$offer_array['changename'][$i_changename]['name'] = $data['offer_name'];

$i_changename++;

}

}

return $offer_array;

}

 

if($action == '') {

unset($_SESSION['viewed_confirmation_page']);

$main_content .= '<h2><center>Welcome to '.$config['server']['serverName'].' Shop</center></h2>';

$offer_list = getOfferArray();

//show list of vipdays offers

if(count($offer_list['vipdays']) > 0) {

$main_content .= '

<div class="TableContainer">

<div class="CaptionContainer">

<div class="CaptionInnerContainer">

<span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>

<span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>

<div class="Text"><center><font color="orange"><b>Vip Days</b></font></center></div>

<span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>

<span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>

<span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

</div>

</div>

<table class="Table5" cellpadding="0" cellspacing="0">

<tbody>

<tr>

<td>

<div class="InnerTableContainer">

<table style="width:100%;">

<tbody>

<tr>

<td>

<div class="TableShadowContainerRightTop">

<div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>

</div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">

<div class="TableContentContainer">

<table class="TableContent" style="border:1px solid #faf0d7;" width="100%">

<tbody>

<tr bgcolor="#D4C0A1">

<td valign="middle" align="center"><b>Product</b></td>

<td valign="middle" width="60%"><b>Description</b></td>

<td valign="middle"> </td>

</tr>';

foreach($offer_list['vipdays'] as $vipdays) {

if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;

$main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign="middle" align="center"><img src="images/shop/vip.gif" /></td><td><b>'.$vipdays['name'].'</b> ('.$vipdays['points'].' points)<br />'.$vipdays['description'].'</td><td align="center">';

if(!$logged) $main_content .= '<input type="button" value="Login First" disabled="disabled" />'; else

$main_content .= '<form action="index.php?subtopic=shopsystem&action=select_player" method=POST><input type="hidden" name="buy_id" value="'.$vipdays['id'].'"><input type="submit" value="Comprar" /></form>';

$main_content .= '</td></tr>';

}

$main_content .= '</tbody>

</table>

</div>

</div>

<div class="TableShadowContainer">

<div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">

<div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>

<div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>

</div>

</div>

</td>

</tr>

</tbody>

</table>

</div>

</td>

</tr>

</tbody>

</table>

</div><br />';}

//show list of itemsvip offers

if(count($offer_list['itemvip']) > 0) {

$main_content .= '

<div class="TableContainer">

<div class="CaptionContainer">

<div class="CaptionInnerContainer">

<span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>

<span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>

<div class="Text">Enhance Account</div>

<span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>

<span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>

<span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

</div>

</div>

<table class="Table5" cellpadding="0" cellspacing="0">

<tbody>

<tr>

<td>

<div class="InnerTableContainer">

<table style="width:100%;">

<tbody>

<tr>

<td>

<div class="TableShadowContainerRightTop">

<div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>

</div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">

<div class="TableContentContainer">

<table class="TableContent" style="border:1px solid #faf0d7;" width="100%">

<tbody>

<tr bgcolor="#D4C0A1">

<td valign="middle" align="center"><b>Product</b></td>

<td valign="middle" width="60%"><b>Description</b></td>

<td valign="middle"> </td>

</tr>';

foreach($offer_list['itemvip'] as $itemvip) {

if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;

$main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign="middle" align="center">'; if(file_exists('images/items/'.$itemvip['item_id'].'.gif')) { $main_content .= '<br /><img src="images/items/'.$itemvip['item_id'].'.gif" height="32" width="32"><br /><small><b>'.$itemvip['name'].'</b></small><br /> '; } else { $main_content .= '<br /> <img src="images/monsters/nophoto.png" height="32" width="32"><br /><small><b>'.$itemvip['name'].'</b></small>'; }

$main_content .='</td><td><b>'.$itemvip['name'].'</b> ('.$itemvip['points'].' points)<br />'.$itemvip['description'].'</td><td align="center">';

if(!$logged) $main_content .= '<input type="button" value="Login First" disabled="disabled" />'; else

$main_content .= '<form action="index.php?subtopic=shopsystem&action=select_player" method=POST>

<input type="hidden" name="buy_id" value="'.$itemvip['id'].'">

<table border="0" cellpadding="0" cellspacing="0">

<tbody>

<tr>

<td style="border: 0px none;">

<div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">

<div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>

<input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">

</div>

</div>

</td>

</tr>

</tbody>

</table>

</form>';

$main_content .= '</td></tr>';

}

$main_content .= '</tbody>

</table>

</div>

</div>

<div class="TableShadowContainer">

<div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">

<div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>

<div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>

</div>

</div>

</td>

</tr>

</tbody>

</table>

</div>

</td>

</tr>

</tbody>

</table>

</div><br />';}

//show list of items offers

if(count($offer_list['item']) > 0 or count($offer_list['container']) > 0 or count($offer_list['itemlogout']) > 0)

$main_content .= '

<div class="TableContainer">

<div class="CaptionContainer">

<div class="CaptionInnerContainer">

<span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>

<span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>

<div class="Text"><center><font color="orange">Items Donates</font></center></div>

<span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>

<span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>

<span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

</div>

</div>

<table class="Table5" cellpadding="0" cellspacing="0">

<tbody>

<tr>

<td>

<div class="InnerTableContainer">

<table style="width:100%;">

<tbody>

<tr>

<td>

<div class="TableShadowContainerRightTop">

<div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>

</div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">

<div class="TableContentContainer">

<table class="TableContent" style="border:1px solid #faf0d7;" width="100%">

<tbody>

<tr bgcolor="#D4C0A1">

<td valign="middle" align="center"><b>Product</b></td>

<td valign="middle" width="60%"><b>Description</b></td>

<td valign="middle"> </td>

 

</tr>';

if(count($offer_list['item']) > 0) {

foreach($offer_list['item'] as $item) {

if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;

$main_content .= '

<tr bgcolor="'.$config['site']['lightborder'].'">

<td valign="middle" align="center">'; if(file_exists('images/items/'.$item['item_id'].'.gif')) { $main_content .= '<br /><img src="images/items/'.$item['item_id'].'.gif" height="32" width="32"><br /><small><b>'.$item['name'].'</b></small><br /> '; } else { $main_content .= '<br /> <img src="images/monsters/nophoto.png" height="32" width="32"><br /><small><b>'.$item['name'].'</b></small>'; }

$main_content .='</td>

<td>'.$item['description'].'<br /><small><b>('.$item['points'].'';

 

if ($item['points'] == 0)

$main_content .=' <o>no cost</o>';

 

if ($item['points'] >= 2)

$main_content .=' points';

else

$main_content .=' point';

 

$main_content .=')</b></small></td>

<td valign="middle" align="center">';

if(!$logged) $main_content .= '<input type="button" value="Login First" disabled="disabled" />'; else

$main_content .= '

<form action="index.php?subtopic=shopsystem&action=select_player" method="POST">

<input type="hidden" name="buy_id" value="'.$item['id'].'">

<table border="0" cellpadding="0" cellspacing="0">

<tbody>

<tr>

<td style="border: 0px none;">

<div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">

<div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>

<input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">

</div>

</div>

</td>

</tr>

</tbody>

</table>

</form>';

$main_content .= '</td></tr>';

}

$main_content .= '</tbody>

</table>

</div>

</div>

<div class="TableShadowContainer">

<div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">

<div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>

<div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>

</div>

</div>

</td>

</tr>

</tbody>

</table>

</div>

</td>

</tr>

</tbody>

</table>

</div><br />';

}

//show list of containers offers

if(count($offer_list['container']) > 0) {

$main_content .= '

<div class="TableContainer">

<div class="CaptionContainer">

<div class="CaptionInnerContainer">

<span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>

<span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>

<div class="Text">Containers Of Items</div>

<span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>

<span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>

<span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

</div>

</div>

<table class="Table5" cellpadding="0" cellspacing="0">

<tbody>

<tr>

<td>

<div class="InnerTableContainer">

<table style="width:100%;">

<tbody>

<tr>

<td>

<div class="TableShadowContainerRightTop">

<div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>

</div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">

<div class="TableContentContainer">

<table class="TableContent" style="border:1px solid #faf0d7;" width="100%">

<tbody>

<tr bgcolor="#D4C0A1">

<td valign="middle" align="center"><b>Product</b></td>

<td valign="middle" width="60%"><b>Description</b></td>

<td valign="middle"> </td>

 

</tr>';

foreach($offer_list['container'] as $container) {

if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;

$main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign="middle" align="center">'; if(file_exists('images/items/'.$container['item_id'].'.gif')) { $main_content .= '<img src="images/items/'.$container['item_id'].'.gif" height="32" width="32">'; } else { $main_content .= '<img src="images/monsters/nophoto.png" height="32" width="32">'; } $main_content .='</td><td><b>'.$container['name'].'</b> ('.$container['points'].' points)<br />'.$container['description'].'</td><td align="center">';

if(!$logged) $main_content .= '<input type="button" value="Login First" disabled="disabled" />'; else

$main_content .= '

<form action="?subtopic=shopsystem&action=select_player" method="POST">

<input type="hidden" name="buy_id" value="'.$container['id'].'">

<table border="0" cellpadding="0" cellspacing="0">

<tbody>

<tr>

<td style="border: 0px none;">

<div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">

<div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>

<input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">

</div>

</div>

</td>

</tr>

</tbody>

</table>

</form>';

$main_content .= '</td></tr>';

}

$main_content .= '</tbody>

</table>

</div>

</div>

<div class="TableShadowContainer">

<div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">

<div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>

<div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>

</div>

</div>

</td>

</tr>

</tbody>

</table>

</div>

</td>

</tr>

</tbody>

</table>

</div><br />';}

if(count($offer_list['itemlogout']) > 0) {

$main_content .= '

<div class="TableContainer">

<div class="CaptionContainer">

<div class="CaptionInnerContainer">

<span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>

<span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>

<div class="Text">Items Logout</div>

<span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>

<span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>

<span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

</div>

</div>

<table class="Table5" cellpadding="0" cellspacing="0">

<tbody>

<tr>

<td>

<div class="InnerTableContainer">

<table style="width:100%;">

<tbody>

<tr>

<td>

<div class="TableShadowContainerRightTop">

<div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>

</div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">

<div class="TableContentContainer">

<table class="TableContent" style="border:1px solid #faf0d7;" width="100%">

<tbody>

<tr bgcolor="#D4C0A1">

<td valign="middle" align="center"><b>Product</b></td>

<td valign="middle" width="60%"><b>Description</b></td>

<td valign="middle"> </td>

 

</tr>';

foreach($offer_list['itemlogout'] as $itemlogout) {

if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;

$main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign="middle" align="center"><img src="images/items/'.$itemlogout['id'].'.gif"></td><td><b>'.$itemlogout['name'].'</b> ('.$itemlogout['points'].' points)<br />'.$itemlogout['description'].'</td><td align="center">';

if(!$logged) $main_content .= '<input type="button" value="Login First" disabled="disabled" />'; else

$main_content .= '

<form action="index.php?subtopic=shopsystem&action=select_player" method=POST>

<input type="hidden" name="buy_id" value="'.$itemlogout['id'].'">

<table border="0" cellpadding="0" cellspacing="0">

<tbody>

<tr>

<td style="border: 0px none;">

<div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">

<div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>

<input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">

</div>

</div>

</td>

</tr>

</tbody>

</table>

</form>';

$main_content .= '</td></tr>';

}

$main_content .= '</tbody>

</table>

</div>

</div>

<div class="TableShadowContainer">

<div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">

<div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>

<div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>

</div>

</div>

</td>

</tr>

</tbody>

</table>

</div>

</td>

</tr>

</tbody>

</table>

</div><br />';}

 

$main_content .= '

<div class="TableContainer">

<div class="CaptionContainer">

<div class="CaptionInnerContainer">

<span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>

<span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>

<div class="Text"><center><font color="orange">Items Diversos</font></center></div>

<span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>

<span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>

<span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

<span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>

</div>

</div>

<table class="Table5" cellpadding="0" cellspacing="0">

<tbody>

<tr>

<td>

<div class="InnerTableContainer">

<table style="width:100%;">

<tbody>

<tr>

<td>

<div class="TableShadowContainerRightTop">

<div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>

</div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">

<div class="TableContentContainer">

<table class="TableContent" style="border:1px solid #faf0d7;" width="100%">

<tbody>

<tr bgcolor="#D4C0A1">

<td valign="middle" align="center"><b>Product</b></td>

<td valign="middle" width="60%"><b>Description</b></td>

<td valign="middle"> </td>

</tr>';

//Pacc

if(count($offer_list['changename']) > 0 or count($offer_list['pacc']) > 0 or count($offer_list['redskull']) > 0 or count($offer_list['unban']) > 0)

if(count($offer_list['pacc']) > 0)

foreach($offer_list['pacc'] as $pacc) {

if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;

$main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign="middle" align="center">'.$pacc['days'].'</td><td><b>'.$pacc['name'].'</b> ('.$pacc['points'].' points)<br />'.$pacc['description'].'</td><td align="center">';

if(!$logged) $main_content .= '<input type="button" value="Login First" disabled="disabled" />'; else

$main_content .= '

<form action="index.php?subtopic=shopsystem&action=select_player" method="POST">

<input type="hidden" name="buy_id" value="'.$pacc['id'].'">

<table border="0" cellpadding="0" cellspacing="0">

<tbody>

<tr>

<td style="border: 0px none;">

<div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">

<div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>

<input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">

</div>

</div>

</td>

</tr>

</tbody>

</table>

</form>';}

//Change Name

if(count($offer_list['changename']) > 0)

foreach($offer_list['changename'] as $changename) {

if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;

$main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign="middle" align="center"><img src="images/shop/name.gif" /></td><td><b>'.$changename['name'].'</b> ('.$changename['points'].' points)<br />'.$changename['description'].'</td><td align="center">';

if(!$logged) $main_content .= '<input type="button" value="Login First" disabled="disabled" />'; else

$main_content .= '

<form action="index.php?subtopic=shopsystem&action=select_player" method="POST">

<input type="hidden" name="buy_id" value="'.$changename['id'].'">

<table border="0" cellpadding="0" cellspacing="0">

<tbody>

<tr>

<td style="border: 0px none;">

<div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">

<div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>

<input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">

</div>

</div>

</td>

</tr>

</tbody>

</table>

</form>';}

//Remove Red Skull

if(count($offer_list['redskull']) > 0)

foreach($offer_list['redskull'] as $redskull) {

if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;

$main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign="middle" align="center"><img src="images/shop/skull.gif" /></td><td><b>'.$redskull['name'].'</b> ('.$redskull['points'].' points)<br />'.$redskull['description'].'</td><td align="center">';

if(!$logged) $main_content .= '<input type="button" value="Login First" disabled="disabled" />'; else

$main_content .= '

<form action="index.php?subtopic=shopsystem&action=select_player" method="POST">

<input type="hidden" name="buy_id" value="'.$redskull['id'].'">

<table border="0" cellpadding="0" cellspacing="0">

<tbody>

<tr>

<td style="border: 0px none;">

<div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">

<div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>

<input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">

</div>

</div>

</td>

</tr>

</tbody>

</table>

</form>';

$main_content .= '</td></tr>';}

//Unban

if(count($offer_list['unban']) > 0)

foreach($offer_list['unban'] as $unban){

if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['lightborder']; } else { $bgcolor = $config['site']['darkborder']; } $number_of_rows++;

$main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td valign="middle" align="center"><br /><img src="images/shop/ban.gif" /></td><td><b>'.$unban['name'].'</b> ('.$unban['points'].' points)<br />'.$unban['description'].'</td><td align="center">';

if(!$logged) $main_content .= '<input type="button" value="Login First" disabled="disabled" />'; else

$main_content .= '

<form action="index.php?subtopic=shopsystem&action=select_player" method="POST">

<input type="hidden" name="buy_id" value="'.$unban['id'].'">

<table border="0" cellpadding="0" cellspacing="0">

<tbody>

<tr>

<td style="border: 0px none;">

<div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">

<div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>

<input class="ButtonText" name="Continue" alt="Continue" src="'.$layout_name.'/images/buttons/_sbutton_purchase.gif" type="image">

</div>

</div>

</td>

</tr>

</tbody>

</table>

</form>';

$main_content .= '</td></tr>';}

$main_content .= '

</tbody>

</table>

</div>

</div>

<div class="TableShadowContainer">

<div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">

<div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>

<div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>

</div>

</div>

</td>

</tr>

</tbody>

</table>

</div>

</td>

</tr>

</tbody>

</table>

</div>';}

 

 

elseif($action == 'select_player') {

unset($_SESSION['viewed_confirmation_page']);

if(!$logged) {

$main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">

<TR BGCOLOR="'.$config['site']['vdarkborder'].'">

<TD CLASS=white><B>Shoping Error</B></TD>

</TR>

<TR BGCOLOR='.$config['site']['darkborder'].'>

<td>

<TABLE BORDER="0" CELLSPACING="1" cellpadding="4">

<TR>

<TD>Please login first.</TD>

</TR>

</TABLE>

</td>

</tr>

</TABLE>';}

else {

$buy_id = (int) $_REQUEST['buy_id'];

if(empty($buy_id)) {

$main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">

<TR BGCOLOR="'.$config['site']['vdarkborder'].'">

<TD CLASS=white><B>Shoping Error</B></TD>

</TR>

<TR BGCOLOR='.$config['site']['darkborder'].'>

<td>

<TABLE BORDER="0" CELLSPACING="1" cellpadding="4">

<TR>

<TD>Please <a href="index.php?subtopic=shopsystem">select item</a> first.</TD>

</TR>

</TABLE>

</td>

</tr>

</TABLE>';}

else {

$buy_offer = getItemByID($buy_id);

if(isset($buy_offer['id'])) { //item exist in database

if($buy_offer['type'] != 'changename') {

if($user_premium_points >= $buy_offer['points']) {

 

$main_content .= '

<table border="0" cellpadding="4" cellspacing="1" width="100%">

<tr bgcolor="'.$config['site']['vdarkborder'].'">

<td class="white" colspan="2"><b>Item Informations</b></td>

</tr>

<tr bgcolor="#D4C0A1"><td width="100"><b>Image:</b></td><td width="550">';

if(file_exists('images/items/'.$buy_offer['item_id'].'.gif')) {

$main_content .= '<img src="images/items/'.$buy_offer['item_id'].'.gif" height="32" width="32">';

} else {

$main_content .= '<img src="images/monsters/nophoto.png" height="32" width="32">';

}

$main_content .='</td></tr>

<tr bgcolor="#F1E0C6"><td width="100"><b>Name:</b></td><td width="550">'.$buy_offer['name'].'</td></tr>

<tr bgcolor="#D4C0A1"><td width="100"><b>Description:</b></td><td width="550">'.$buy_offer['description'].'</td></tr>

<tr bgcolor="#F1E0C6"><td width="100"><b>Cost:</b></td><td width="550">'.$buy_offer['points'].' points</td></tr>

</table><br />

<form action="index.php?subtopic=shopsystem&action=confirm_transaction" method=POST>

<input type="hidden" name="buy_id" value="'.$buy_id.'">

<table border="0" cellpadding="4" cellspacing="1" width="100%">

<tr bgcolor="'.$config['site']['vdarkborder'].'">

<td class="white" colspan="2"><b>Select a Player</b></td>

</tr>

<tr bgcolor="#D4C0A1"><td width="110"><b>Name:</b>  <select name="buy_name" style="padding: 5px;">';

$players_from_logged_acc = $account_logged->getPlayersList();

if(count($players_from_logged_acc) > 0) {

$players_from_logged_acc->orderBy('name');

foreach($players_from_logged_acc as $player)

$main_content .= '<option>'.$player->getName().'</option>';

} else {

$main_content .= 'You don\'t have any character on your account.';

}

$main_content .= '</select> <input type="submit" value="Purschase"><br /><small>Character <b> your account </b> you will receive.</small></td></tr></table>

</form>

 

<form action="index.php?subtopic=shopsystem&action=confirm_transaction" method="POST"><input type="hidden" name="buy_id" value="'.$buy_id.'">

<table border="0" cellpadding="4" cellspacing="1" width="100%">

<tr bgcolor="'.$config['site']['vdarkborder'].'">

<td class="white" colspan="2"><b>Send gift</b></td>

</tr>

<tr bgcolor="#D4C0A1"><td width="110"><b>To player:</b>  <input type="text" name="buy_name" autocomplete="off" placeholder="Character to recive '.$buy_offer['name'].'" size="25"> <input type="submit" value="Purschase to friend"><br /><small>Put in the field above the name of the character that will receive the item.</small></td></tr>

</table><br /></form>';

} else {

$main_content .= '

<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">

<TR BGCOLOR="'.$config['site']['vdarkborder'].'">

<TD CLASS="white"><b>Erro</b></td>

</TR>

<TR BGCOLOR='.$config['site']['darkborder'].'><TD>Para comprar <b>'.$buy_offer['name'].'</b> voce precisa de <b>'.$buy_offer['points'].' premium points</b> disponíveis.<br />Atualmente você possui <b>'.$user_premium_points.'</b> premium points.</TD>

</TR>

</TABLE>

<br />

<table width="100%">

<tbody>

<tr align="center">

<td>

<table border="0" cellpadding="0" cellspacing="0">

<tbody><tr><td style="border: 0px none;">

<a href="javascript:void();" onclick=location.href="index.php?subtopic=donate">

<div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">

<div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>

<div class="ButtonText" style="background-image:url('.$layout_name.'/images/buttons/_sbutton_buypoints.png);"></div>

</div>

</div>

</a>

</td>

</tr>

<tr>

</tr>

</tbody>

</table>

</td>

<td>

<table border="0" cellpadding="0" cellspacing="0">

<tbody>

<tr>

<td style="border: 0px none;">

<a href="javascript:void();" onclick=location.href="index.php?subtopic=shopsystem"><div class="BigButton" style="background-image: url('.$layout_name.'/images/buttons/sbutton.gif);">

<div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image: url('.$layout_name.'/images/buttons/sbutton_over.gif); visibility: hidden;"></div>

<input class="ButtonText" name="Back" alt="Back" src="'.$layout_name.'/images/vips/_sbutton_back.gif" type="image">

</table>

</td>

</tr>

</tbody>

</table>

<p> </p>';}

} else {

$main_content .= '<form action="index.php?subtopic=shopsystem&action=confirm_transaction" method=POST><input type="hidden" name="buy_id" value="'.$buy_id.'">

<table border="0" cellpadding="4" cellspacing="1" width="100%"><tr bgcolor="#505050"><td colspan="2"><b class="white">Change Name</b></td></tr>

<tr bgcolor="#D4C0A1"><td width="110"><b>Name:</b></td><td width="550"><select name="buy_name">';

$players_from_logged_acc = $account_logged->getPlayersList();

if(count($players_from_logged_acc) > 0) {

$players_from_logged_acc->orderBy('name');

foreach($players_from_logged_acc as $player) {

$main_content .= '<option>'.$player->getName().'</option>';}

} else {

$main_content .= 'You don\'t have any character on your account.';}

$main_content .= '</select></td></tr><tr bgcolor="#F1E0C6"><td width="110"><b>New name:</b></td><td width="550"><input type="text" name="buy_from"> <input type="submit" value="Change Name"></td></tr></table><br /></form>';}

} else {

$main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="5" WIDTH="100%">

<tr BGCOLOR="'.$config['site']['vdarkborder'].'">

<td CLASS="white"><b>Error</b></td>

</tr>

<tr BGCOLOR='.$config['site']['darkborder'].'>

<td>Offer with ID <b>'.$buy_id.'</b> doesn\'t exist. Please <a href="index.php?subtopic=shopsystem">select item</a> again.</td>

</tr>

</TABLE>';}

}}}

elseif($action == 'confirm_transaction') {

if(!$logged) {

$main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">

<TR BGCOLOR="'.$config['site']['vdarkborder'].'">

<TD CLASS=white><B>Shoping Error</B></TD>

</TR>

<TR BGCOLOR='.$config['site']['darkborder'].'>

<td>

<TABLE BORDER="0" CELLSPACING="1" cellpadding="4">

<TR>

<TD>Please login first.</TD>

</TR>

</TABLE>

</td>

</tr>

</TABLE>';}

else {

$buy_id = (int) $_POST['buy_id'];

$buy_name = stripslashes(urldecode($_POST['buy_name']));

$buy_from = stripslashes(urldecode($_POST['buy_from']));

if(empty($buy_id)) {

$main_content .= 'Please <a href="index.php?subtopic=shopsystem">select item</a> first.';

} else {

if($buy_offer['type'] == 'changename'){

if(!check_name_new_char($buy_from)) {

$main_content .= 'Invalid name format of new name.';

}}

else {

$buy_offer = getItemByID($buy_id);

$check_name_in_database = $ots->createObject('Player');

$check_name_in_database->find($buy_from);

if($buy_offer['type'] == 'changename'){

if(!$check_name_in_database->isLoaded()) {

}}

if(isset($buy_offer['id'])) { //item exist in database

if($user_premium_points >= $buy_offer['points']) {

if(check_name($buy_name)) {

$buy_player = new OTS_Player();

$buy_player->find($buy_name);

if($buy_player->isLoaded()) {

$buy_player_account = $buy_player->getAccount();

if($_SESSION['viewed_confirmation_page'] == 'yes' && $_POST['buy_confirmed'] == 'yes') {

if($buy_offer['type'] == 'pacc') {

$player_vip_time = $buy_player_account->getCustomField('premdays');

$player_lastlogin = $buy_player_account->getCustomField('lastday');

$save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_pacc').' (id, to_name, to_account, from_nick, from_account, price, pacc_days, trans_state, trans_start, trans_real) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['days']).', \'realized\', '.$SQL->quote(time()).', '.$SQL->quote(time()).');';

$SQL->query($save_transaction);

if($player_vip_time > 0)

$buy_player_account->setCustomField('premdays', $player_vip_time + $buy_offer['days'] * 86400);

else

$buy_player_account->setCustomField('premdays', time() + $buy_offer['days'] * 86400);

$buy_player_account->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);

$user_premium_points = $user_premium_points - $buy_offer['points'];

if ($player_vip_days >= 1) {

}

$main_content .= '<center><h2>VIP Days added!</h2><b>'.$buy_offer['days'].' days</b> of VIP days added to the account of player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><br /><a href="index.php?subtopic=shopsystem">Go to Shop Site</a><br />';

}

elseif($buy_offer['type'] == 'unban') {

$my_acc_id = $account_logged->getCustomField('id');

$datadata = $SQL->query('SELECT * FROM '.$SQL->tableName('bans').' WHERE value = '.$my_acc_id.';')->fetch();

if($datadata['value'] == $my_acc_id) {

if($SQL->query('DELETE FROM bans WHERE value= '.$my_acc_id.' LIMIT 1;')) {

} else {

$SQL->query('DELETE FROM bans WHERE account= '.$my_acc_id.' LIMIT 1;');

}

$account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);

$user_premium_points = $user_premium_points - $buy_offer['points'];

$main_content .= '<center><h2>Ban Deleted!</h2><b>Your account has been unbanned for '.$buy_offer['points'].' premium points</b> from your account.

<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><br /><a href="index.php?subtopic=shopsystem">Go to Shop Site</a><br />';

} else {

$main_content .= '<center><b>You don\'t have any bans in your account!</b><br /><br /><a href="index.php?subtopic=shopsystem">Go back</a><br />';

}}

////////////////////////////////

elseif($buy_offer['type'] == 'itemlogout') {

$my_acc_id = $buy_player->getCustomField('id');

$playerinfo = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE id = '.$my_acc_id.';')->fetch();

$playerslot = $SQL->query('SELECT * FROM '.$SQL->tableName('player_items').' WHERE player_id = '.$my_acc_id.';')->fetch();

if ($playerinfo['online'] == '0') {

if ($playerslot['pid'] != '10') {

if ($datadata['cap'] >= $SQL->quote($buy_offer['free_cap'])) {

$SQL->query('INSERT INTO player_items (player_id, pid, itemtype, count) VALUES ('.$my_acc_id.', '.$SQL->quote($buy_offer['pid']).', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['count1']).');');

$account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);

$user_premium_points = $user_premium_points - $buy_offer['points'];

$main_content .= '<h2>Item received to player: '.$buy_player->getName().'!</h2><br />Now you have <b>'.$user_premium_points.' premium points</b>.

<br /><a href="index.php?subtopic=shopsystem">Go to Shop Site</a>';

} else {

$main_content .= '<b>You need '.$SQL->quote($buy_offer['free_cap']).' or more of cap!</b><br /><a href="index.php?subtopic=shopsystem">Go back</a>';

}} else {

$main_content .= '<b>Please leave the arrow slot in blank to receive item!</b><br /><a href="index.php?subtopic=shopsystem">Go back</a>';

}} else {

$main_content .= '<b>You need to be offline!</b><br /><a href="index.php?subtopic=shopsystem">Go back</a>';

}

}

////////////////////////////////

elseif($buy_offer['type'] == 'changename') {

$my_acc_id = $buy_player->getCustomField('id');

$playerinfo = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('id').' = '.$my_acc_id.';')->fetch();

$checkname = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('name').' = '. $SQL->quote($buy_from) .';')->fetch();

if($playerinfo['online'] == '0') {

if($checkname == false) {

$SQL->query('UPDATE `players` SET `name` = '. $SQL->quote($buy_from) .' WHERE `id` = '. $my_acc_id.' ;');

$account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);

$user_premium_points = $user_premium_points - $buy_offer['points'];

$main_content .= '<center><h2>Your name has been changed to '.$buy_from.'.</h2><br /><b>You have '.$user_premium_points.' premium points left</b>.

<br /><br /><a href="index.php?subtopic=shopsystem">Go to Shop Site</a><br />';

} else {

$main_content .= '<center><h2>Sorry, the name "<i>'.$buy_from.'</i>" does already exist.<br />Please select another name.</h2><br />';

}} else {

$main_content .= '<center><h2>'.$buy_name.' has to be offline to complete transaction.</h2><br /><br /><a href="index.php?subtopic=shopsystem">Go back</a><br />';

}}

////////////////////////////////

elseif($buy_offer['type'] == 'redskull') {

$my_acc_id = $buy_player->getCustomField('id');

$playerinfo = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('id').' = '.$my_acc_id.';')->fetch();

if($playerinfo['skull'] == '4' AND $playerinfo['online'] >= '0' AND $playerinfo['skulltime'] > '0') {

$SQL->query('UPDATE killers SET unjustified=0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id='. $my_acc_id .');');

$SQL->query('UPDATE players SET skulltime=0, skull=0 WHERE id='. $my_acc_id .';');

$account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);

$user_premium_points = $user_premium_points - $buy_offer['points'];

$main_content .= '<center><h2>RedSkull Removed!</h2><br /><b>Your redskull has been removed from the player '.$buy_player->getName().'.</b>

<br />Now you have<b> '.$user_premium_points.' premium points</b>.<br /><br /><a href="index.php?subtopic=shopsystem">Go to Shop Site</a><br />';

} else {

$main_content .= '<center><b>'.$buy_player->getName().' has to be offline or have redskull to complete transaction!.</b><br /><br /><a href="index.php?subtopic=shopsystem">Go back</a><br />';

}}

//////////////////////////

elseif($buy_offer['type'] == 'item') {

$sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' (id, name, type, action, param1, param2, param3, param4, param5, param6, param7, delete_it) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', \'login\', \'give_item\', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['item_count']).', \'\', \'\', \'item\', '.$SQL->quote($buy_offer['name']).', \'\', \'1\');';

$SQL->query($sql);

$save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_item').' (id, to_name, to_account, from_nick, from_account, price, offer_id, trans_state, trans_start, trans_real) VALUES ('.$SQL->lastInsertId().', '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['name']).', \'wait\', '.$SQL->quote(time()).', \'0\');';

$SQL->query($save_transaction);

$account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);

$user_premium_points = $user_premium_points - $buy_offer['points'];

$main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">

<TR BGCOLOR="'.$config['site']['vdarkborder'].'">

<TD CLASS="white"><b>Item added successfully !</b></td>

</TR>

<TR BGCOLOR='.$config['site']['darkborder'].'>

<TD>

<b>'.$buy_offer['name'].'</b> added to player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />

Now you have <b>'.$user_premium_points.' premium points</b>.

</TD>

</TR>

</TABLE>

<br /><a href="index.php?subtopic=shopsystem">MAIN SHOP SITE</a><br /><br />';}

if($buy_offer['type'] == 'vipdays') {

$player_vip_time = $buy_player_account->getCustomField('premdays');

$player_lastlogin = $buy_player_account->getCustomField('lastday');

$save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_pacc').' (id, to_name, to_account, from_nick, from_account, price, pacc_days, trans_state, trans_start, trans_real) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['days']).', \'realized\', '.$SQL->quote(time()).', '.$SQL->quote(time()).');';

$SQL->query($save_transaction);

if($player_vip_time > 0)

$buy_player_account->setCustomField('premdays', $player_vip_time + $buy_offer['days'] * 86400);

else

$buy_player_account->setCustomField('premdays', time() + $buy_offer['days'] * 86400);

$account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);

$user_premium_points = $user_premium_points - $buy_offer['points'];

if ($player_vip_days >= 1) {

}

$main_content .= '<center><h2>VIP Days added!</h2><b>'.$buy_offer['days'].' days</b> of VIP days added to the account of player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><br /><a href="index.php?subtopic=shopsystem">Go to Shop Site</a><br />';}

elseif($buy_offer['type'] == 'container') {

$sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' (id, name, type, action, param1, param2, param3, param4, param5, param6, param7, delete_it) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', \'login\', \'give_item\', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['item_count']).', '.$SQL->quote($buy_offer['container_id']).', '.$SQL->quote($buy_offer['container_count']).', \'container\', '.$SQL->quote($buy_offer['name']).', \'\', \'1\');';

$SQL->query($sql);

$save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_item').' (id, to_name, to_account, from_nick, from_account, price, offer_id, trans_state, trans_start, trans_real) VALUES ('.$SQL->lastInsertId().', '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['name']).', \'wait\', '.$SQL->quote(time()).', \'0\');';

$SQL->query($save_transaction);

$account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);

$user_premium_points = $user_premium_points - $buy_offer['points'];

$main_content .= '<center><h2>Container of items added!</h2><b>'.$buy_offer['name'].'</b> added to player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><br /><a href="index.php?subtopic=shopsystem">GO TO MAIN SHOP SITE</a><br />';

}}

else {

if($buy_offer['type'] != 'changename') {

$set_session = TRUE;

$_SESSION['viewed_confirmation_page'] = 'yes';

$main_content .= '

<table border="0" cellpadding="4" cellspacing="1" width="100%">

<tr bgcolor="#505050"><td colspan="3"><font color="white"><b>Confirm transaction</b></font></td></tr>

<tr bgcolor="'.$config['site']['darkborder'].'"><td><b>Image:</b></td><td width="550" colspan="2"><img src="images/items/'.$buy_offer['item_id'].'.gif" align="absmiddle"/> <small><b>'.$buy_offer['name'].'</b></small></td></tr>

<tr bgcolor="'.$config['site']['lightborder'].'"><td><b>Description:</b></td><td width="550" colspan="2">'.$buy_offer['description'].'</td></tr>

<tr bgcolor="'.$config['site']['darkborder'].'"><td><b>Cost:</b></td><td width="550" colspan="2"><b>'.$buy_offer['points'].' premium points</b> from your account</td></tr>

<tr bgcolor="'.$config['site']['lightborder'].'"><td><b>For Player:</b></td><td width="550" colspan="2">'.$buy_player->getName().' <small>[<a href="index.php?subtopic=characters&name='.$buy_player->getName().'" target="_blank">View Character</a>]</small></td></tr>

<tr bgcolor="'.$config['site']['darkborder'].'"><td><b>Confirm Transaction ?</b></td>

<td><form action="index.php?subtopic=shopsystem&action=confirm_transaction" method="POST"><input type="hidden" name="buy_confirmed" value="yes"><input type="hidden" name="buy_id" value="'.$buy_id.'"><input type="hidden" name="buy_from" value="'.urlencode($new_name).'"><input type="hidden" name="buy_name" value="'.urlencode($buy_name).'"><input type="submit" value="Accept"></form></td><td><form action="index.php?subtopic=shopsystem" method="POST"><input type="submit" value="Cancel"></form></td></tr>

</table><br />';

} else {

$set_session = TRUE;

$_SESSION['viewed_confirmation_page'] = 'yes';

$main_content .= '<center><h2>Confirm Name Changing</h2>

<table border="0" cellpadding="4" cellspacing="1" width="100%">

<tr bgcolor="#505050"><td colspan="3"><font color="white" size="4"><b>Confirm transaction</b></font></td></tr>

<tr bgcolor="#D4C0A1"><td width="130"><b>Name:</b></td><td width="550" colspan="2">'.$buy_offer['name'].'</td></tr>

<tr bgcolor="#F1E0C6"><td width="130"><b>Description:</b></td><td width="550" colspan="2">'.$buy_offer['description'].'</td></tr>

<tr bgcolor="#D4C0A1"><td width="130"><b>Cost:</b></td><td width="550" colspan="2"><b>'.$buy_offer['points'].' premium points</b></td></tr>

<tr bgcolor="#F1E0C6"><td width="130"><b>Current Name:</b></td><td width="550" colspan="2"><font color="red">'.$buy_player->getName().'</font></td></tr>

<tr bgcolor="#D4C0A1"><td width="130"><b>New Name:</b></td><td width="550" colspan="2"><font color="red">'.$buy_from.'</font></td></tr>

<tr bgcolor="#F1E0C6"><td width="130"><b>Change Name?</b></td><td width="275" align="left">

<form action="index.php?subtopic=shopsystem&action=confirm_transaction" method="POST"><input type="hidden" name="buy_confirmed" value="yes"><input type="hidden" name="buy_id" value="'.$buy_id.'"><input type="hidden" name="buy_from" value="'.urlencode($buy_from).'"><input type="hidden" name="buy_name" value="'.urlencode($buy_name).'"><input type="submit" value="Accept"></form></td>

<td align="right"><form action="index.php?subtopic=shopsystem" method="POST"><input type="submit" value="Cancel"></form></td></tr>

</table>';}}}

else {

$main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="5" WIDTH="100%">

<tr BGCOLOR="'.$config['site']['vdarkborder'].'">

<td CLASS="white"><b>Error</b></td>

</tr>

<tr BGCOLOR='.$config['site']['darkborder'].'>

<td>Player with name <b>'.$buy_name.'</b> doesn\'t exist. Please <a href="index.php?subtopic=shopsystem&action=select_player&buy_id='.$buy_id.'">select other name</a>.</td>

</tr>

</TABLE>';

}

} else {

$main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">

<TR BGCOLOR="'.$config['site']['vdarkborder'].'">

<TD CLASS=white><B>Shoping Error</B></TD>

</TR>

<TR BGCOLOR='.$config['site']['darkborder'].'>

<td>

<TABLE BORDER="0" CELLSPACING="1" cellpadding="4">

<TR>

<TD>Invalid name format. Please <a href="index.php?subtopic=shopsystem&action=select_player&buy_id='.$buy_id.'">select other name</a>.</TD>

</TR>

</TABLE>

</td>

</tr>

</TABLE><br />';}

} else {

$main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="5" WIDTH="100%">

<tr BGCOLOR="'.$config['site']['vdarkborder'].'">

<td CLASS="white"><b>Error</b></td>

</tr>

<tr BGCOLOR='.$config['site']['darkborder'].'>

<td>For this item you need <b>'.$buy_offer['points'].'</b> points. You have only <b>'.$user_premium_points.'</b> premium points. Please <a href="index.php?subtopic=shopsystem">select other item</a> or buy premium points.</td>

</tr>

</TABLE>';

}}

else {

$main_content .= '<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="5" WIDTH="100%">

<tr BGCOLOR="'.$config['site']['vdarkborder'].'">

<td CLASS="white"><b>Error</b></td>

</tr>

<tr BGCOLOR='.$config['site']['darkborder'].'>

<td>Offer with ID <b>'.$buy_id.'</b> doesn\'t exist. Please <a href="index.php?subtopic=shopsystem">select item</a> again.</td>

</tr>

</TABLE>';

}}}}

if(!$set_session) {

unset($_SESSION['viewed_confirmation_page']);

}}

if(!$logged)

$main_content .= '<br /><center><div class="notice"><b>Please login to see how much points you have</b></div></center>';

else

if($account_logged->getCustomField("premium_points") <= 0)

$main_content .='<br /><center><div class="error">You do not have premium points available.<br /><a href="index.php?subtopic=donate">Buy now Premium Points!</a></div></center>';

else

if($account_logged->getCustomField("premium_points") >= 1)

$main_content .='<br /><center><div class="success" style="width: 300px;">You have <b>'.$account_logged->getCustomField("premium_points").'</b> premium points available</div></center>';

}

else

$main_content .= '

<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">

<TR BGCOLOR="'.$config['site']['vdarkborder'].'">

<TD CLASS=white><B>Shoping Status</B></TD>

</TR>

<TR BGCOLOR='.$config['site']['darkborder'].'>

<td>

<TABLE BORDER="0" CELLSPACING="1" cellpadding="4">

<TR>

<TD>Inativamos o Shop para manutenção interna, dentro de poucos minutos voltaremos com nossos sistemas normalizados.<br /><b>Atenciosamente,<br /> Administração</b></TD>

</TR>

</TABLE>

</td>

</tr>

</TABLE>';

?>

 

 

AXO QUE O FORUM BUGO, PQ SE EU BOTAR EM QUOTE ELE NAO SAI ESCRITO, INTAO BOTEI SEM QUOTE

Editado por DragMaster
Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

  • 0

Envie em spoiler seu accountmanagement e characters.php..

 

#EDIT

accountmanagement.php

 

 

 

<?PHP

include('tutor.php');

if(!$logged)

if($action == "logout")

$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Logout Successful</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>You have logged out of your '.$config['server']['serverName'].' account. In order to view your account you need to <a href="?subtopic=accountmanagement" >log in</a> again.</td></tr> </table> </div> </table></div></td></tr>';

else

 

$main_content .= 'Please enter your account name and your password.<br /><a href="?subtopic=createaccount" >Create an account</a> if you do not have one yet.<br /><br /><form action="?subtopic=accountmanagement" method="post" ><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Account Login</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" ><span >Account Name:</span></td><td style="width:100%;" ><input type="password" name="account_login" SIZE="10" maxlength="30" ></td></tr><tr><td class="LabelV" ><span >Password:</span></td><td><input type="password" name="password_login" size="30" maxlength="29" ></td></tr> </table> </div> </table></div></td></tr><br /><table width="100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=lostaccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Account lost?" alt="Account lost?" src="'.$layout_name.'/images/buttons/_sbutton_accountlost.gif" ></div></div></td></tr></form></table></td></tr></table>';

else

{

//########### ACCOUNT MANAGER ##########

if($action == "")

{

$account_reckey = $account_logged->getRecoveryKey();

if(!$account_logged->isPremium())

$account_status = '<strong><font color="green">Premium Account Grátis</font></strong>';

else

$account_status = '<strong><font color="green">Premium Account, Left in '.date("d/m/Y", $account_logged->getPremDays()).'</font></strong>';

if(empty($account_reckey))

$account_registred = '<strong><font color="red">No</font></strong>';

else

if($config['site']['generate_new_reckey'] && $config['site']['send_emails'])

$account_registred = '<strong><font color="green">Yes (<a href="?subtopic=accountmanagement&action=newreckey">Buy new Rec key</a>)</font></strong>';

else

$account_registred = '<strong><font color="green">Yes</font></strong>';

$account_created = $account_logged->getCreated();

$account_email = $account_logged->getEMail();

$account_email_new_time = $account_logged->getCustomField("email_new_time");

if($account_email_new_time > 1)

$account_email_new = $account_logged->getCustomField("email_new");

$account_rlname = $account_logged->getRLName();

$account_location = $account_logged->getLocation();

 

$welcome_msg = 'Bem vindo a sua conta!';

 

$main_content .= '<div class="SmallBox" > <div class="MessageContainer" ><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="Message" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><table><td width="100%" align="center">';

$main_content .= '<a href="#general" >General Information</a>, <a href="#public" >Public Information</a>, <a href="#billing" >Billing Information</a>, <a href="#characters" >Characters</a>.';

$main_content .= '</td><td width=50%><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=logout" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Logout" alt="Logout" src="'.$layout_name.'/images/buttons/_sbutton_logout.gif" ></div></div></td></tr></form></table></td></tr></table> </div><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br /><center><table><tr><td><img src="'.$layout_name.'/images/content/headline-bracer-left.gif" /></td><td style="text-align:center;vertical-align:middle;horizontal-align:center;font-size:17px;font-weight:bold;" >'.$welcome_msg.'<br /></td><td><img src="'.$layout_name.'/images/content/headline-bracer-right.gif" /></td></tr></table><br /></center>';

//show account premium_points

if($logged)

{

$user_premium_points = $account_logged->getCustomField('premium_points');

}

else

{

$user_premium_points = 'Login first';

}

//if account dont have recovery key show hint

if(empty($account_reckey))

$main_content .= '<div class="SmallBox" ><div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="Message" ><div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><table><tr><td class="LabelV" >Hint:</td><td style="width:100%;" >You can register your account for increased protection. Click on "Register Account" and get your free recovery key today!</td></tr></table><div align="center" ><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="'.$layout_name.'/images/buttons/_sbutton_registeraccount.gif" ></div></div></td></tr></form></table></div></div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br />';

if($account_email_new_time > 1)

if($account_email_new_time < time())

$account_email_change = '<br>(You can accept <strong>'.$account_email_new.'</strong> as a new email.)';

else

{

$account_email_change = ' <br>You can accept <strong>new e-mail after '.date("j F Y", $account_email_new_time).".</strong>";

$main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="Message" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><table><tr><td class="LabelV" >Note:</td><td style="width:100%;" >A request has been submitted to change the email address of this account to <strong>'.$account_email_new.'</strong>. After <strong>'.date("j F Y, G:i:s", $account_email_new_time).'</strong> you can accept the new email address and finish the process. Please cancel the request if you do not want your email address to be changed! Also cancel the request if you have no access to the new email address!</td></tr></table><div align="center" ><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Edit" alt="Edit" src="'.$layout_name.'/images/buttons/_sbutton_edit.gif" ></div></div></td></tr></form></table></div> </div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br /><br />';

}

$main_content .= '<a name="general" ></a><div class="TopButtonContainer" ><div class="TopButton" ><a href="#top"><image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" /></a></div></div><div class="TableContainer" ><table class="Table3" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >General Information</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div> </div><tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" > <table class="TableContent" width="100%" >

<tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV">Account Name:</td><td>'.$account_logged->getCustomField("name").'</td></tr>

<tr style="background-color:'.$config['site']['lightborder'].';" ><td class="LabelV">Email Address:</td><td style="width:90%;" >'.$account_email.''.$account_email_change.'</td></tr>

<tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV">Created:</td><td>'.date("j F Y, G:i:s", $account_created).'</td></tr>

<tr style="background-color:'.$config['site']['lightborder'].';" ><td class="LabelV">Last Login:</td><td>'.date("j F Y, G:i:s", time()).'</td></tr>

<tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV">Account Status:</td><td>'.$account_status.'<br></td></tr>

<tr style="background-color:'.$config['site']['lightborder'].';" ><td class="LabelV">Registered:</td><td>'.$account_registred.'</td></tr>

<tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV" >Points(Points):</td><td>Você tem <b>'.$user_premium_points.'</b> Points(Points)</td></tr>

</table></div></div><div class="TableShadowContainer" ><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" ><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div> </div></div></td></tr><tr><td><table class="InnerTableButtonRow" cellpadding="0" cellspacing="0" ><tr><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changepassword" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Change Password" alt="Change Password" src="'.$layout_name.'/images/buttons/_sbutton_changepassword.gif" ></div></div></td></tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><tr><td style="border:0px;" ><input type="hidden" name=newemail value="" ><input type="hidden" name=newemaildate value=0 ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Change Email" alt="Change Email" src="'.$layout_name.'/images/buttons/_sbutton_changeemail.gif" ></div></div></td></tr></form> </table></td><td width="100%"></td>';

$main_content .= '<td style="position:absolute; right:120px">

<table border="0" cellspacing="0" cellpadding="0" >

<form action="?subtopic=accountmanagement&action=tutor" method="post" >

<input type="hidden" name="step" value="1">

<tr>

<td style="border:0px;" >

<div class="Button" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >

<div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >

<div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" >

</div>

<input class="ButtonText" type="image" name="Become Tutor" alt="Become Tutor" src="'.$layout_name.'/images/buttons/tutor.gif" >

</div>

</div>

</td>

</tr>

</form>

</table>

</td>';

 

$main_content .= '<td width="100%"></td>';

//show button "register account"

if(empty($account_reckey))

$main_content .= '<td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="'.$layout_name.'/images/buttons/_sbutton_registeraccount.gif" ></div></div></td></tr></form></table></td>';

$main_content .= '</tr></table></td></tr></table></div></table></div></td></tr><br /><a name="public" ></a><div class="TopButtonContainer" ><div class="TopButton" ><a href="#top" ><image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" /></a></div></div><div class="TableContainer" > <table class="Table5" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Public Information</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" > <table class="TableContent" width="100%" ><tr><td><table style="width:100%;"><tr><td class="LabelV" >Real Name:</td><td style="width:90%;" >'.$account_rlname.'</td></tr><tr><td class="LabelV" >Location:</td><td style="width:90%;" >'.$account_location.'</td></tr></table></td><td align=right><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeinfo" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Edit" alt="Edit" src="'.$layout_name.'/images/buttons/_sbutton_edit.gif" ></div></div></td></tr></form></table></td></tr> </table> </div></div><div class="TableShadowContainer" > <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" > <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div> <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div> </div></div></td></tr> </table> </div> </table></div></td></tr><br /><br />';

$main_content .= '<a name="billing" ></a><div class="TopButtonContainer"><div class="TopButton"><a href="#top"><img style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif"></a></div></div><div class="TableContainer" > <table class="Table3" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Informações VIP(Histórico)</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" >

<table class="TableContent" width="100%" >

<tr>

<td>

<table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td style="border:0px;"><form action="?subtopic=shopsystem" method="post"><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)"><div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif); visibility: hidden; "></div><input class="ButtonText" type="image" name="Add VIP Time" alt="Add VIP Time" src="'.$layout_name.'/images/buttons/_sbutton_donate.gif"></div></div></form></td><td style="border:0px;">Compre VIP time para poder usar todas as vantagens VIP.</br> <b>É preciso ter Points(Points) para comprar Vip time</b>. Se você não tiver <a href ="http://208.115.224.211/?subtopic=donate">compre points agora</a>.</td></tr></tbody></table></td>

</tr>

</table>

</div></div><div class="TableShadowContainer" > <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" > <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div> <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div> </div></div></td></tr> </table> </div>

<div class="InnerTableContainer" ><table style="width:100%;"><tr><td><div class="TableShadowContainerRightTop"><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);"><div class="TableContentContainer">

<table class="TableContent" width="100%" >

<tr class="LabelH">

<td>Data da Compra</td><td>Descrição</td>

</tr>';

$history_pacc = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_history_pacc').' WHERE to_account = '.$SQL->quote($account_logged->getId()).'');

$counter = 0;

foreach($history_pacc as $pacc)

{

if(is_int($counter / 2))

$bgcolor = $config['site']['lightborder'];

else

$bgcolor = $config['site']['darkborder'];

$counter++;

$main_content .= '<tr bgcolor='.$bgcolor.'><td>'.date("M j Y", $pacc['trans_start']).'</td><td>Vip Time ('.$pacc['pacc_days'].' dias)</td></tr>';

}

$main_content .= '</table>

</div></div><div class="TableShadowContainer" > <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" > <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div> <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div> </div></div></td></tr> </table> </div>

</table></div></td></tr><br /><br />';

$main_content .= '<a name="characters" ></a><div class="TopButtonContainer" ><div class="TopButton" ><a href="#top" ><image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" /></a></div></div><div class="TableContainer" > <table class="Table3" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" ><div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Characters</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" ><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" > <table class="TableContent" width="100%" ><tr class="LabelH" ><td style="width:65%" >Name</td><td style="width:15%" >Level</td><td style="width:7%">Status</td><td style="width:5%"></td></tr>';

$account_players = $account_logged->getPlayersList();

$account_players->orderBy('name');

//show list of players on account

foreach($account_players as $account_player)

{

$player_number_counter++;

$main_content .= '<tr style="background-color:';

if(is_int($player_number_counter / 2))

$main_content .= $config['site']['darkborder'];

else

$main_content .= $config['site']['lightborder'];

$main_content .= ';" ><td><NOBR>'.$player_number_counter.'. '.$account_player->getName();

if($account_player->isDeleted())

$main_content .= '<font color="red"><strong> [ DELETED ] </strong> <a href="?subtopic=accountmanagement&action=undelete&name='.urlencode($account_player->getName()).'">>> UNDELETE <<</a></font>';

if($account_player->isNameLocked())

if($account_player->getOldName())

$main_content .= '<font color="red"><strong> [ NAMELOCK:</strong> Wait for GM, new name: <strong>'.$account_player->getOldName().' ]</strong></font>';

else

$main_content .= '<font color="red"><strong> [ NAMELOCK: <form action="" method="GET"><input name="subtopic" type="hidden" value="accountmanagement" /><input name="action" type="hidden" value="newnick" /><input name="name" type="hidden" value="'.$account_player->getName().'" /><input name="name_new" type="text" value="Enter here new nick" size="16" /><input type="submit" value="Set new nick" /></form> ]</strong></font>';

$main_content .= '</NOBR></td><td><NOBR>'.$account_player->getLevel().' '.$vocation_name[$account_player->getWorld()][$account_player->getPromotion()][$account_player->getVocation()].'</NOBR></td>';

if(!$account_player->isOnline())

$main_content .= '<td><font color="red"><strong>Offline</strong></font></td>';

else

$main_content .= '<td><font color="green"><strong>Online</strong></font></td>';

$main_content .= '<td>[<a href="?subtopic=accountmanagement&action=changecomment&name='.urlencode($account_player->getName()).'" >Edit</a>]</td></tr>';

}

$main_content .= '</table> </div></div><div class="TableShadowContainer" > <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" > <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div> <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div> </div></div></td></tr><tr><td><table class="InnerTableButtonRow" cellpadding="0" cellspacing="0" ><tr><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=createcharacter" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Create Character" alt="Create Character" src="'.$layout_name.'/images/buttons/_sbutton_createcharacter.gif" ></div></div></td></tr></form></table></td><td style="width:100%;" ></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=deletecharacter" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Delete Character" alt="Delete Character" src="'.$layout_name.'/images/buttons/_sbutton_deletecharacter.gif" ></div></div></td></tr></form></table></td></tr></table></td></tr> </table> </div> </table></div></td></tr><br /><br />';

}

//########### CHANGE PASSWORD ##########

if($action == "changepassword")

{

$new_password = trim($_POST['newpassword']);

$new_password2 = trim($_POST['newpassword2']);

$old_password = trim($_POST['oldpassword']);

if(empty($new_password) && empty($new_password2) && empty($old_password))

$main_content .= 'Please enter your current password and a new password. For your security, please enter the new password twice.<br /><br /><form action="?subtopic=accountmanagement&action=changepassword" method="post" ><div class="TableContainer" ><table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" ><div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Change Password</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" ><span >New Password:</span></td><td style="width:90%;" ><input type="password" name="newpassword" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >New Password Again:</span></td><td><input type="password" name="newpassword2" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >Current Password:</span></td><td><input type="password" name="oldpassword" size="30" maxlength="29" ></td></tr></table> </div> </table></div></td></tr><br /><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';

else

{

if(empty($new_password) || empty($new_password2) || empty($old_password))

$show_msgs[] = "Please fill in form.";

if($new_password != $new_password2)

$show_msgs[] = "The new passwords do not match!";

if(empty($show_msgs))

{

if(!check_password($new_password))

$show_msgs[] = "New password contains illegal chars (a-z, A-Z and 0-9 only!) or lenght.";

$old_password = password_ency($old_password);

if($old_password != $account_logged->getPassword())

$show_msgs[] = "Current password is incorrect!";

}

if(!empty($show_msgs))

{

//show errors

$main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><strong>The Following Errors Have Occurred:</strong><br />';

foreach($show_msgs as $show_msg)

$main_content .= '<li>'.$show_msg;

$main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br />';

//show form

$main_content .= 'Please enter your current password and a new password. For your security, please enter the new password twice.<br /><br /><form action="?subtopic=accountmanagement&action=changepassword" method="post" ><div class="TableContainer" ><table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" ><div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Change Password</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" ><span >New Password:</span></td><td style="width:90%;" ><input type="password" name="newpassword" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >New Password Again:</span></td><td><input type="password" name="newpassword2" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >Current Password:</span></td><td><input type="password" name="oldpassword" size="30" maxlength="29" ></td></tr></table> </div> </table></div></td></tr><br /><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';

}

else

{

$org_pass = $new_password;

$new_password = password_ency($new_password);

$account_logged->setPassword($new_password);

$account_logged->save();

$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Password Changed</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>Your password has been changed.';

if($config['site']['send_emails'] && $config['site']['send_mail_when_change_password'])

{

$mailBody = '<html>

<body>

<h3>Password to account changed!</h3>

<p>You or someone else changed password to your account on server <a href="'.$config['server']['url'].'"><strong>'.$config['server']['serverName'].'</strong></a>.</p>

<p>New password: <strong>'.$org_pass.'</strong></p>

</body>

</html>';

require("phpmailer/class.phpmailer.php");

$mail = new PHPMailer();

if ($config['site']['smtp_enabled'] == "yes")

{

$mail->IsSMTP();

$mail->Host = $config['site']['smtp_host'];

$mail->Port = (int)$config['site']['smtp_port'];

$mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);

$mail->Username = $config['site']['smtp_user'];

$mail->Password = $config['site']['smtp_pass'];

}

else

$mail->IsMail();

$mail->IsHTML(true);

$mail->From = $config['site']['mail_address'];

$mail->AddAddress($account_logged->getEMail());

$mail->Subject = $config['server']['serverName']." - Changed password";

$mail->Body = $mailBody;

if($mail->Send())

$main_content .= '<br /><small>Your new password were send on email address <strong>'.$account_logged->getEMail().'</strong>.</small>';

else

$main_content .= '<br /><small>An error occorred while sending email with password!</small>';

}

$main_content .= '</td></tr> </table> </div> </table></div></td></tr><br /><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';

$_SESSION['password'] = $new_password;

}

}

}

//############# TUTOR TEST ###################

if($action == 'tutor')

{

$step = $_REQUEST['step'];

 

if ($step == 1)

{

$asd = $SQL->query("SELECT * FROM accounts WHERE id = ". $account_logged->getId() .";")->fetch();

if((time() - $asd['last_test']) < 60 * 60 * 24 * 30)

{

$main_content .= 'You cant try now <br><br>'. $back;

return;

}

 

$main_content .= '

Tutors are experienced players who volunteer to help other players by answering questions about the game.

Only players with extensive knowledge about all aspects of the game may become tutors.

This includes knowledge of the game manual, the Tibia Rules, FAQs, security hints and of course the tutor guide.

If you fulfil the formal criteria for becoming a tutor, you may take the tutor exam to prove your qualification.<br><br>

 

<a name="Account+Analysed" ></a>

<div class="TableContainer" >

<table class="Table5" cellpadding="0" cellspacing="0" >

<div class="CaptionContainer" >

<div class="CaptionInnerContainer" >

<span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

<span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>

<span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>

<div class="Text" >

Account Analysed

</div>

<span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>

<span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>

<span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

<span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

</div>

</div>

<tr>

<td>

<div class="TableContentContainer" >

<table class="TableContent" width="100%" >

<tr>

<td>

You meet all formal requirements to become a tutor.

If you want to proceed make sure that you have read and understood all available documentation about the game.

Then click on the "Start Exam" button to take the tutor exam. Note,

that you cannot cancel the exam once you have started and that you are only allowed to take the exam once every two months.

<br>

</td>

</tr>

</table>

</div>

</td>

</tr>

</table>

</div>

<br>

<table class="TableContent" width="100%" >

<tr>

<td style="width:50%">

<center>

<form action="?subtopic=accountmanagement&action=tutor" method="post" >

<input type="hidden" name="step" value="2">

<div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >

<div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >

<div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" >

</div>

<input class="ButtonText" type="image" name="Start Exam" alt="Start Exam" src="'.$layout_name.'/images/buttons/start_exam.gif" >

</div>

</div>

</form>

</center>

</td>

<td style="width:50%">

'. $back .'

</td>

</tr>

</table>

';

}

elseif ($step == 2)

{

$asd = $SQL->query("SELECT * FROM accounts WHERE id = ". $account_logged->getId() .";")->fetch();

if((time() - $asd['last_test']) < 60 * 60 * 24 * 30)

{

$main_content .= 'You cant try now <br><br>'. $back;

return;

}

$SQL->query("UPDATE accounts SET last_test = ". time() ." WHERE id = ". $account_logged->getId() .";");

 

$main_content .= '

Please answer all questions below by selecting the appropriate answers.

Note, that none, one, several or all answers may be correct. You have 45 minutes to answer all questions. Good luck!

<br><br>

<form action="?subtopic=accountmanagement&action=tutor" method="post" >

<input type="hidden" name="step" value="3">';

$useds = array();

for ($ii = 1; $ii <= 15; $ii++)

{

$continue_a = true;

$total_a = count($question);

while ($continue_a)

{

$this_jeje_a = rand(1, $total_a);

if(!array_key_exists($this_jeje_a, $useds))

{

$useds[$this_jeje_a] = true;

$continue_a = false;

}

}

 

$turn = $question[$this_jeje_a];

 

$main_content .= '

<div class="TableContainer" >

<table class="Table5" cellpadding="0" cellspacing="0" >

<div class="CaptionContainer" >

<div class="CaptionInnerContainer" >

<span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

<span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>

<span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>

<div class="Text" >'. $turn['question'] .' </div>

<span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>

<span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>

<span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

<span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

</div>

</div>

<tr>

<td>

<div class="TableContentContainer" >

<table class="TableContent" width="100%" >

<input type="hidden" name="real_id_'. $ii .'" value="'. $this_jeje_a .'">';

$used_answers = array();

$corrects = 0;

for ($i = 1; $i <= 3; $i++)

{

$continue = true;

$total = count($turn['answers']);

while ($continue)

{

$this_jeje = rand(0, $total - 1);

if(!array_key_exists($this_jeje, $used_answers))

{

$used_answers[$this_jeje] = true;

$continue = false;

}

}

if (in_array($turn['answers'][$this_jeje], $turn['correct']))

{

$corrects++;

}

$main_content .= '

<tr>

<td style="width:1%">

<input name="answers_to_'. $ii .'[]" value="'. $turn['answers'][$this_jeje] .'" type="checkbox">

</td>

<td style="width:99%">

'. $turn['answers'][$this_jeje] .'

</td>

</tr>';

}

$main_content .= '

<input type="hidden" name="encrypt_1d5f'. $ii .'dshgas" value="'. $corrects .'">

</table>

</div>

</td>

</tr>

</table>

</div><br>';

}

$main_content .= '

<table class="TableContent" width="100%" >

<tr>

<td style="width:50%">

<center>

<div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >

<div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >

<div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" >

</div>

<input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" >

</div>

</div>

</center>

</td>

</tr>

</table>

</form>';

}

elseif ($step == 3)

{

for ($i = 1; $i <= 15; $i++)

{

$real_id = $_POST['real_id_'. $i];

$real_corrects = $_POST['encrypt_1d5f'. $i .'dshgas'];

$answers = $_POST['answers_to_'. $i];

$count = count($answers);

if ($real_corrects == $count)

{

if($count != 0)

{

foreach ($answers as $v)

{

if (!in_array($v, $question[$real_id]['correct']))

{

$main_content .= '

Thank you for completing the tutor exam. Here is the evaluation of your submission:<br><br>

<div class="TableContainer" >

<table class="Table5" cellpadding="0" cellspacing="0" >

<div class="CaptionContainer" >

<div class="CaptionInnerContainer" >

<span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

<span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>

<span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>

<div class="Text" >

Exam not Passed

</div>

<span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>

<span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>

<span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

<span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

</div>

</div>

<tr>

<td>

<div class="TableContentContainer" >

<table class="TableContent" width="100%" >

<tr>

<td>

Sorry, you did not pass the tutor exam. The following question has been answered wrongly:<br><br>

<b>'. $question[$real_id]['question'] .'</b><br><br>

You may repeat the exam in one month. Until then use the time to study the documentation again. We hope to welcome you as tutor in the future.<br>

</td>

</tr>

</table>

</div>

</td>

</tr>

</table>

</div><br>

'.$back;

return;

}

}

}

}

else

{

$main_content .= '

Thank you for completing the tutor exam. Here is the evaluation of your submission:<br><br>

<div class="TableContainer" >

<table class="Table5" cellpadding="0" cellspacing="0" >

<div class="CaptionContainer" >

<div class="CaptionInnerContainer" >

<span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

<span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>

<span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>

<div class="Text" >

Exam not Passed

</div>

<span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>

<span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>

<span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

<span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

</div>

</div>

<tr>

<td>

<div class="TableContentContainer" >

<table class="TableContent" width="100%" >

<tr>

<td>

Sorry, you did not pass the tutor exam. The following question has been answered wrongly:<br><br>

<b>'. $question[$real_id]['question'] .'</b><br><br>

You may repeat the exam in one month. Until then use the time to study the documentation again. We hope to welcome you as tutor in the future.<br>

</td>

</tr>

</table>

</div>

</td>

</tr>

</table>

</div><br>

'.$back;

return;

}

}

$main_content .= '

Thank you for completing the tutor exam. Here is the evaluation of your submission:<br><br>

<div class="TableContainer" >

<table class="Table5" cellpadding="0" cellspacing="0" >

<div class="CaptionContainer" >

<div class="CaptionInnerContainer" >

<span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

<span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>

<span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>

<div class="Text" >

Exam not Passed

</div>

<span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>

<span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>

<span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

<span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>

</div>

</div>

<tr>

<td>

<div class="TableContentContainer" >

<table class="TableContent" width="100%" >

<tr>

<td>

Congratulations! you have passed the tutor exam and proven your knowledge about the game.

</td>

</tr>

</table>

</div>

</td>

</tr>

</table>

</div><br>

<center>

<form action="?subtopic=accountmanagement" method="post" >

<div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >

<div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >

<div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" >

</div>

<input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/continue.gif" >

</div>

</div>

</form>

</center>';

 

$SQL->query("UPDATE players SET group_id = 2 WHERE account_id = ". $account_logged->getId() ." AND group_id < 1;");

}

}

 

//############# CHANGE E-MAIL ###################

if($action == "changeemail")

{

$account_email_new_time = $account_logged->getCustomField("email_new_time");

if($account_email_new_time > 10)

$account_email_new = $account_logged->getCustomField("email_new");

if($account_email_new_time < 10)

{

if($_POST['changeemailsave'] == 1)

{

$account_email_new = trim($_POST['new_email']);

$post_password = trim($_POST['password']);

if(empty($account_email_new))

$change_email_errors[] = "Please enter your new email address.";

else

if(!check_mail($account_email_new))

$change_email_errors[] = "E-mail address is not correct.";

if(empty($post_password))

$change_email_errors[] = "Please enter password to your account.";

else

{

$post_password = password_ency($post_password);

if($post_password != $account_logged->getPassword())

$change_email_errors[] = "Wrong password to account.";

}

if(empty($change_email_errors))

{

$account_email_new_time = time() + $config['site']['email_days_to_change'] * 24 * 3600;

$account_logged->setCustomField("email_new", $account_email_new);

$account_logged->setCustomField("email_new_time", $account_email_new_time);

$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >New Email Address Requested</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>You have requested to change your email address to <strong>'.$account_email_new.'</strong>. The actual change will take place after <strong>'.date("j F Y, G:i:s", $account_email_new_time).'</strong>, during which you can cancel the request at any time.</td></tr> </table> </div> </table></div></td></tr><br /><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';

}

else

{

//show errors

$main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><strong>The Following Errors Have Occurred:</strong><br />';

foreach($change_email_errors as $change_email_error)

$main_content .= '<li>'.$change_email_error;

$main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br />';

//show form

$main_content .= 'Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. <strong>For security reasons, the actual change will be finalised after a waiting period of '.$config['site']['email_days_to_change'].' days.</strong><br /><br /><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Change Email Address</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ></tr><td class="LabelV" ><span >New Email Address:</span></td> <td style="width:90%;" ><input name="new_email" value="'.$_POST['new_email'].'" size="30" maxlength="50" ></td><tr></tr><td class="LabelV" ><span >Password:</span></td> <td><input type="password" name="password" size="30" maxlength="29" ></td></tr> </table> </div> </table></div></td></tr><br /><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name=changeemailsave value=1 ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';

}

}

else

$main_content .= 'Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. <strong>For security reasons, the actual change will be finalised after a waiting period of '.$config['site']['email_days_to_change'].' days.</strong><br /><br /><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Change Email Address</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ></tr><td class="LabelV" ><span >New Email Address:</span></td> <td style="width:90%;" ><input name="new_email" value="'.$_POST['new_email'].'" size="30" maxlength="50" ></td><tr></tr><td class="LabelV" ><span >Password:</span></td> <td><input type="password" name="password" size="30" maxlength="29" ></td></tr> </table> </div> </table></div></td></tr><br /><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name=changeemailsave value=1 ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';

}

else

{

if($account_email_new_time < time())

{

if($_POST['changeemailsave'] == 1)

{

$account_logged->setCustomField("email_new", "");

$account_logged->setCustomField("email_new_time", 0);

$account_logged->setEmail($account_email_new);

$account_logged->save();

$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Email Address Change Accepted</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>You have accepted <strong>'.$account_logged->getEmail().'</strong> as your new email adress.</td></tr> </table> </div> </table></div></td></tr><br /><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';

}

else

$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Email Address Change Accepted</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>Do you accept <strong>'.$account_email_new.'</strong> as your new email adress?</td></tr> </table> </div> </table></div></td></tr><br /><table width="100%"><tr><td width="30"> </td><td align=left><form action="?subtopic=accountmanagement&action=changeemail" method="post"><input type="hidden" name="changeemailsave" value=1 ><INPUT TYPE=image NAME="I Agree" SRC="'.$layout_name.'/images/buttons/sbutton_iagree.gif" BORDER=0 WIDTH=120 HEIGHT=17></FORM></td><td align=left><form action="?subtopic=accountmanagement&action=changeemail" method="post"><input type="hidden" name="emailchangecancel" value=1 ><input type=image name="Cancel" src="'.$layout_name.'/images/buttons/sbutton_cancel.gif" BORDER=0 WIDTH=120 HEIGHT=17></form></td><td align=right><form action="?subtopic=accountmanagement" method="post" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></td><td width="30"> </td></tr></table>';

}

else

$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Change of Email Address</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>A request has been submitted to change the email address of this account to <strong>'.$account_email_new.'</strong>.<br />The actual change will take place on <strong>'.date("j F Y, G:i:s", $account_email_new_time).'</strong>.<br>If you do not want to change your email address, please click on "Cancel".</td></tr> </table> </div> </table></div></td></tr><br /><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><tr><td style="border:0px;" ><input type="hidden" name="emailchangecancel" value=1 ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Cancel" alt="Cancel" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" ></div></div></td></tr></form></table></td><td><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';

}

if($_POST['emailchangecancel'] == 1)

{

$account_logged->setCustomField("email_new", "");

$account_logged->setCustomField("email_new_time", 0);

$main_content = '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Email Address Change Cancelled</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>Your request to change the email address of your account has been cancelled. The email address will not be changed.</td></tr> </table> </div> </table></div></td></tr><br /><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';

}

}

//########### CHANGE PUBLIC INFORMATION (about account owner) ######################

if($action == "changeinfo")

{

$new_rlname = htmlspecialchars(stripslashes(trim($_POST['info_rlname'])));

$new_location = htmlspecialchars(stripslashes(trim($_POST['info_location'])));

if($_POST['changeinfosave'] == 1)

{

//save data from form

$account_logged->setRLName($new_rlname);

$account_logged->setLocation($new_location);

$account_logged->save();

$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Public Information Changed</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>Your public information has been changed.</td></tr> </table> </div> </table></div></td></tr><br><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';

}

else

{

//show form

$account_rlname = $account_logged->getRLName();

$account_location = $account_logged->getLocation();

$main_content .= 'Here you can tell other players about yourself. This information will be displayed alongside the data of your characters. If you do not want to fill in a certain field, just leave it blank.<br /><br /><form action="?subtopic=accountmanagement&action=changeinfo" method=post><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Change Public Information</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" >Real Name:</td><td style="width:90%;" ><input name="info_rlname" value="'.$account_rlname.'" size="30" maxlength="50" ></td></tr><tr><td class="LabelV" >Location:</td><td><input name="info_location" value="'.$account_location.'" size="30" maxlength="50" ></td></tr></table> </div> </table></div></td></tr><br /><table width="100%"><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name="changeinfosave" value="1" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';

}

}

//############## GENERATE RECOVERY KEY ###########

if($action == "registeraccount")

{

$reg_password = password_ency(trim($_POST['reg_password']));

$old_key = $account_logged->getRecoveryKey("key");

if($_POST['registeraccountsave'] == "1")

{

if($reg_password == $account_logged->getPassword())

{

if(empty($old_key))

{

$dontshowtableagain = 1;

$acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789';

$max = strlen($acceptedChars)-1;

$new_rec_key = NULL;

// 10 = number of chars in generated key

for($i=0; $i < 10; $i++)

{

$cnum[$i] = $acceptedChars{mt_rand(0, $max)};

$new_rec_key .= $cnum[$i];

}

$account_logged->setRecoveryKey($new_rec_key);

$account_logged->save();

$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Account Registered</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" >Thank you for registering your account! You can now recover your account if you have lost access to the assigned email address by using the following<br /><br /><font size="5">   <strong>Recovery Key: '.$new_rec_key.'</strong></font><br /><br /><br /><strong>Important:</strong><ul><li>Write down this recovery key carefully.</li><li>Store it at a safe place!</li>';

if($config['site']['send_emails'] && $config['site']['send_mail_when_generate_reckey'])

{

$mailBody = '<html>

<body>

<h3>New recovery key!</h3>

<p>You or someone else generated recovery key to your account on server <a href="'.$config['server']['url'].'"><strong>'.$config['server']['serverName'].'</strong></a>.</p>

<p>Recovery key: <strong>'.$new_rec_key.'</strong></p>

</body>

</html>';

require("phpmailer/class.phpmailer.php");

$mail = new PHPMailer();

if ($config['site']['smtp_enabled'] == "yes")

{

$mail->IsSMTP();

$mail->Host = $config['site']['smtp_host'];

$mail->Port = (int)$config['site']['smtp_port'];

$mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);

$mail->Username = $config['site']['smtp_user'];

$mail->Password = $config['site']['smtp_pass'];

}

else

$mail->IsMail();

$mail->IsHTML(true);

$mail->From = $config['site']['mail_address'];

$mail->AddAddress($account_logged->getEMail());

$mail->Subject = $config['server']['serverName']." - recovery key";

$mail->Body = $mailBody;

if($mail->Send())

$main_content .= '<br /><small>Your recovery key were send on email address <strong>'.$account_logged->getEMail().'</strong>.</small>';

else

$main_content .= '<br /><small>An error occorred while sending email with recovery key! You will not receive e-mail with this key.</small>';

}

$main_content .= '</ul> </table> </div> </table></div></td></tr><br /><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';

}

else

$reg_errors[] = 'Your account is already registred.';

}

else

$reg_errors[] = 'Wrong password to account.';

}

if($dontshowtableagain != 1)

{

//show errors if not empty

if(!empty($reg_errors))

{

$main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><strong>The Following Errors Have Occurred:</strong><br />';

foreach($reg_errors as $reg_error)

$main_content .= '<li>'.$reg_error;

$main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br />';

}

//show form

$main_content .= 'To generate recovery key for your account please enter your password.<br /><br /><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><input type="hidden" name="registeraccountsave" value="1"><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Generate recovery key</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" ><span >Password:</td><td><input type="password" name="reg_password" size="30" maxlength="29" ></td></tr> </table> </div> </table></div></td></tr><br /><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';

}

}

//############## GENERATE NEW RECOVERY KEY ###########

if($action == "newreckey")

{

$reg_password = password_ency(trim($_POST['reg_password']));

$reckey = $account_logged->getRecoveryKey();

if((!$config['site']['generate_new_reckey'] || !$config['site']['send_emails']) || empty($reckey))

$main_content .= 'You cant get new rec key';

else

{

$points = $account_logged->getPremiumPoints();

if($_POST['registeraccountsave'] == "1")

{

if($reg_password == $account_logged->getPassword())

{

if($points >= $config['site']['generate_new_reckey_price'])

{

$dontshowtableagain = 1;

$acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789';

$max = strlen($acceptedChars)-1;

$new_rec_key = NULL;

// 10 = number of chars in generated key

for($i=0; $i < 10; $i++)

{

$cnum[$i] = $acceptedChars{mt_rand(0, $max)};

$new_rec_key .= $cnum[$i];

}

$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Account Registered</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><ul>';

$mailBody = '<html>

<body>

<h3>New recovery key!</h3>

<p>You or someone else generated recovery key to your account on server <a href="'.$config['server']['url'].'"><strong>'.$config['server']['serverName'].'</strong></a>.</p>

<p>Recovery key: <strong>'.$new_rec_key.'</strong></p>

</body>

</html>';

require("phpmailer/class.phpmailer.php");

$mail = new PHPMailer();

if ($config['site']['smtp_enabled'] == "yes")

{

$mail->IsSMTP();

$mail->Host = $config['site']['smtp_host'];

$mail->Port = (int)$config['site']['smtp_port'];

$mail->SMTPAuth = ($config['site']['smtp_auth'] ? true : false);

$mail->Username = $config['site']['smtp_user'];

$mail->Password = $config['site']['smtp_pass'];

}

else

$mail->IsMail();

$mail->IsHTML(true);

$mail->From = $config['site']['mail_address'];

$mail->AddAddress($account_logged->getEMail());

$mail->Subject = $config['server']['serverName']." - new recovery key";

$mail->Body = $mailBody;

if($mail->Send())

{

$account_logged->setRecoveryKey(new_rec_key);

$account_logged->setPremiumPoints($account_logged->getPremiumPoints()-$config['site']['generate_new_reckey_price']);

$account_logged->save();

$main_content .= '<br />Your recovery key were send on email address <strong>'.$account_logged->getEMail().'</strong> for '.$config['site']['generate_new_reckey_price'].' Points(Points).';

}

else

$main_content .= '<br />An error occorred while sending email ( <strong>'.$account_logged->getEMail().'</strong> ) with recovery key! Recovery key not changed. Try again.';

$main_content .= '</ul> </table> </div> </table></div></td></tr><br /><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';

}

else

$reg_errors[] = 'You need '.$config['site']['generate_new_reckey_price'].' Points(Points) to generate new recovery key. You have <strong>'.$points.'<strong> Points(Points).';

}

else

$reg_errors[] = 'Wrong password to account.';

}

if($dontshowtableagain != 1)

{

//show errors if not empty

if(!empty($reg_errors))

{

$main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><strong>The Following Errors Have Occurred:</strong><br />';

foreach($reg_errors as $reg_error)

$main_content .= '<li>'.$reg_error;

$main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br />';

}

//show form

$main_content .= '<center><h3>To generate New recovery key for your account please enter your password.</h3></center><br /><font color="red"><strong>New recovery key cost '.$config['site']['generate_new_reckey_price'].' Points(Points).</font><br />You have <font color="green">'.$points.'</font> Points(Points).<br />You will receive e-mail with this recovery key.</strong><br /><br /><form action="?subtopic=accountmanagement&action=newreckey" method="post" ><input type="hidden" name="registeraccountsave" value="1"><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Generate recovery key</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" ><span >Password:</td><td><input type="password" name="reg_password" size="30" maxlength="29" ></td></tr> </table> </div> </table></div></td></tr><br /><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';

}

}

}

//###### CHANGE CHARACTER COMMENT ######

if($action == "changecomment")

{

$player_name = stripslashes($_REQUEST['name']);

$new_comment = htmlspecialchars(stripslashes(substr(trim($_POST['comment']),0,2000)));

$new_hideacc = (int) $_POST['accountvisible'];

if(check_name($player_name))

{

$player = $ots->createObject('Player');

$player->find($player_name);

if($player->isLoaded())

{

$player_account = $player->getAccount();

if($account_logged->getId() == $player_account->getId())

{

if($_POST['changecommentsave'] == 1)

{

$player->setCustomField("hide_char", $new_hideacc);

$player->setCustomField("comment", $new_comment);

$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Character Information Changed</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>The character information has been changed.</td></tr> </table> </div> </table></div></td></tr><br><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';

}

else

{

$main_content .= 'Here you can see and edit the information about your character.<br />If you do not want to specify a certain field, just leave it blank.<br /><br /><form action="?subtopic=accountmanagement&action=changecomment" method="post" ><div class="TableContainer" > <table class="Table5" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Edit Character Information</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" > <div class="TableContentContainer" > <table class="TableContent" width="100%" ><tr><td class="LabelV" >Name:</td><td style="width:80%;" >'.$player_name.'</td></tr><tr><td class="LabelV" >Hide Account:</td><td>';

if($player->getHideChar() == 1)

$main_content .= '<input type="checkbox" name="accountvisible" value="1" checked="checked">';

else

$main_content .= '<input type="checkbox" name="accountvisible" value="1" >';

$main_content .= ' check to hide your account information</td></tr> </table> </div></div><div class="TableShadowContainer" > <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" > <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div> <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div> </div></div></td></tr><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" > <div class="TableContentContainer" > <table class="TableContent" width="100%" ><tr><td class="LabelV" ><span >Comment:</span></td><td style="width:80%;" ><textarea name="comment" rows="10" cols="50" wrap="virtual" >'.$player->getComment().'</textarea><br>[max. length: 2000 chars, 50 lines]</td></tr> </table> </div></div><div class="TableShadowContainer" > <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" ><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div></div></div></td></tr></td></tr> </table> </div> </table></div></td></tr><br /><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><input type="hidden" name="name" value="'.$player->getName().'"><input type="hidden" name="changecommentsave" value="1"><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';

}

}

else

$main_content .= "<h3><center>Error.<br />Character with name: ".$player_name." is not on your account.</center></h3>";

}

else

$main_content .= "<h3><center>Error.<br />Character with name: ".$player_name." doesn't exist.</center></h3>";

}

else

$main_content .= "<h3><center>Error.<br />Name contain illegal characters.</center></h3>";

}

//### NEW NICK - set new nick proposition ###

if($action == "newnick")

{

$name = $_GET['name'];

$name_new = stripslashes(ucwords(strtolower(trim($_GET['name_new']))));

if(!empty($name) && !empty($name_new))

{

if(check_name_new_char($name_new))

{

$player = $ots->createObject('Player');

$player->find($name);

if($player->isLoaded() && $player->isNameLocked())

{

$player_account = $player->getAccount();

if($account_logged->getId() == $player_account->getId())

{

if(!$player->getOldName())

if(!$player->isOnline())

{

$player->setCustomField('old_name', $name_new);

$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >New nick proposition</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>The character <strong>'.$name.'</strong> new nick proposition <strong>'.$name_new.'</strong> has been set. Now you must wait for acceptation from GM.</td></tr> </table> </div> </table></div></td></tr>';

}

else

$main_content .= 'This character is online.';

else

$main_content .= 'You already set new name for this character ( <strong>'.$player->getOldName().'</strong> ). You must wait until GM accept/reject your proposition.';

}

else

$main_content .= 'Character <strong>'.$player_name.'</strong> is not on your account.';

}

else

$main_content .= 'Character with this name doesn\'t exist or isn\'t name locked.';

}

else

$main_content .= 'Name contain illegal characters. Invalid format or lenght.';

}

else

$main_content .= 'Please enter new char name.';

$main_content .= '<br><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';

}

//### DELETE character from account ###

if($action == "deletecharacter")

{

$player_name = stripslashes(trim($_POST['delete_name']));

$password_verify = trim($_POST['delete_password']);

$password_verify = password_ency($password_verify);

if($_POST['deletecharactersave'] == 1)

{

if(!empty($player_name) && !empty($password_verify))

{

if(check_name($player_name))

{

$player = $ots->createObject('Player');

$player->find($player_name);

if($player->isLoaded())

{

$player_account = $player->getAccount();

if($account_logged->getId() == $player_account->getId())

{

if($password_verify == $account_logged->getPassword())

{

if(!$player->isOnline())

{

//dont show table "delete character" again

$dontshowtableagain = 1;

//delete player

$player->setCustomField('deleted', 1);

$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Character Deleted</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>The character <strong>'.$player_name.'</strong> has been deleted.</td></tr> </table> </div> </table></div></td></tr><br><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';

}

else

$delete_errors[] = 'This character is online.';

}

else

$delete_errors[] = 'Wrong password to account.';

}

else

$delete_errors[] = 'Character <strong>'.$player_name.'</strong> is not on your account.';

}

else

$delete_errors[] = 'Character with this name doesn\'t exist.';

}

else

$delete_errors[] = 'Name contain illegal characters.';

}

else

$delete_errors[] = 'Character name or/and password is empty. Please fill in form.';

}

if($dontshowtableagain != 1)

{

if(!empty($delete_errors))

{

$main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><strong>The Following Errors Have Occurred:</strong><br />';

foreach($delete_errors as $delete_error) {

$main_content .= '<li>'.$delete_error;

}

$main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br />';

}

$main_content .= 'To delete a character enter the name of the character and your password.<br /><br /><form action="?subtopic=accountmanagement&action=deletecharacter" method="post" ><input type="hidden" name="deletecharactersave" value="1"><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Delete Character</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" ><span >Character Name:</td><td style="width:90%;" ><input name="delete_name" value="" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >Password:</td><td><input type="password" name="delete_password" size="30" maxlength="29" ></td></tr> </table> </div> </table></div></td></tr><br /><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';

}

}

//### UNDELETE character from account ###

if($action == "undelete")

{

$player_name = stripslashes(trim($_GET['name']));

if(!empty($player_name))

{

if(check_name($player_name))

{

$player = $ots->createObject('Player');

$player->find($player_name);

if($player->isLoaded())

{

$player_account = $player->getAccount();

if($account_logged->getId() == $player_account->getId())

{

if(!$player->isOnline())

{

$player->setCustomField('deleted', 0);

$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Character Undeleted</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>The character <strong>'.$player_name.'</strong> has been undeleted.</td></tr> </table> </div> </table></div></td></tr><br><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';

}

else

$delete_errors[] = 'This character is online.';

}

else

$delete_errors[] = 'Character <strong>'.$player_name.'</strong> is not on your account.';

}

else

$delete_errors[] = 'Character with this name doesn\'t exist.';

}

else

$delete_errors[] = 'Name contain illegal characters.';

}

}

//## CREATE CHARACTER on account ###

if($action == "createcharacter")

{

if(count($config['site']['worlds']) > 1)

{

if(isset($_REQUEST['world']))

$world_id = (int) $_REQUEST['world'];

}

else

$world_id = 0;

if(!isset($world_id))

{

$main_content .= '<h3><center>Before you can create character you must select world:</center></h3><br />';

foreach($config['site']['worlds'] as $id => $world_n)

$main_content .= '<h4><a href="?subtopic=accountmanagement&action=createcharacter&world='.$id.'">'.$world_n.'</a></h4>';

$main_content .= '<center><form action="?subtopic=accountmanagement" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';

}

else

{

$main_content .= '<script type="text/javascript">

var nameHttp;

function checkName()

{

if(document.getElementById("newcharname").value=="")

{

document.getElementById("name_check").innerHTML = \'<strong><font color="red">Please enter new character name.</font></strong>\';

return;

}

nameHttp=GetXmlHttpObject();

if (nameHttp==null)

{

return;

}

var newcharname = document.getElementById("newcharname").value;

var url="ajax/check_name.php?name=" + newcharname + "&uid="+Math.random();

nameHttp.onreadystatechange=NameStateChanged;

nameHttp.open("GET",url,true);

nameHttp.send(null);

}

function NameStateChanged()

{

if (nameHttp.readyState==4)

{

document.getElementById("name_check").innerHTML=nameHttp.responseText;

}

}

</script>';

$newchar_name = stripslashes(ucwords(strtolower(trim($_POST['newcharname']))));

$newchar_sex = $_POST['newcharsex'];

$newchar_vocation = $_POST['newcharvocation'];

$newchar_town = $_POST['newchartown'];

if($_POST['savecharacter'] != 1)

{

$main_content .= 'Please choose a name';

if(count($config['site']['newchar_vocations'][$world_id]) > 1)

$main_content .= ', vocation';

$main_content .= ' and sex for your character. <br />In any case the name must not violate the naming conventions stated in the <a href="?subtopic=tibiarules" target="_blank" >'.$config['server']['serverName'].' Rules</a>, or your character might get deleted or name locked.';

if($account_logged->getPlayersList()->count() >= $config['site']['max_players_per_account'])

$main_content .= '<strong><font color="red"> You have maximum number of characters per account on your account. Delete one before you make new.</font></strong>';

$main_content .= '<br /><br /><form action="?subtopic=accountmanagement&action=createcharacter" method="post" ><input type="hidden" name="world" value="'.$world_id.'" ><input type="hidden" name=savecharacter value="1" ><div class="TableContainer" > <table class="Table3" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Create Character</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div> </div><tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" > <div class="TableContentContainer" ><table class="TableContent" width="100%" ><tr class="LabelH" ><td style="width:50%;" ><span >Name</td><td><span >Sex</td></tr><tr class="Odd" ><td><input id="newcharname" name="newcharname" onkeyup="checkName();" value="'.$newchar_name.'" size="30" maxlength="29" ><BR><font size="1" face="verdana,arial,helvetica"><div id="name_check">Please enter your character name.</div></font></td><td>';

$main_content .= '<input type="radio" name="newcharsex" value="1" ';

if($newchar_sex == 1)

$main_content .= 'checked="checked" ';

$main_content .= '>male<br />';

$main_content .= '<input type="radio" name="newcharsex" value="0" ';

if($newchar_sex == "0")

$main_content .= 'checked="checked" ';

$main_content .= '>female<br /></td></tr></table></div></div></table></div>';

if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)

$main_content .= '<div class="InnerTableContainer" > <table style="width:100%;" ><tr>';

if(count($config['site']['newchar_vocations'][$world_id]) > 1)

{

$main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><strong>Select your vocation:</strong></td><td><table class="TableContent" width="100%" >';

foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)

{

$main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';

if($newchar_vocation == $char_vocation_key)

$main_content .= 'checked="checked" ';

$main_content .= '>'.$vocation_name[$world_id][0][$char_vocation_key].'</td></tr>';

}

$main_content .= '</table></table></td>';

}

if(count($config['site']['newchar_towns'][$world_id]) > 1)

{

$main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><strong>Select your city:</strong></td><td><table class="TableContent" width="100%" >';

foreach($config['site']['newchar_towns'][$world_id] as $town_id)

{

$main_content .= '<tr><td><input type="radio" name="newchartown" value="'.$town_id.'" ';

if($newchar_town == $town_id)

$main_content .= 'checked="checked" ';

$main_content .= '>'.$towns_list[$world_id][$town_id].'</td></tr>';

}

$main_content .= '</table></table></td>';

}

if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)

$main_content .= '</tr></table></div>';

$main_content .= '</table></div></td></tr><br /><table style="width:100%;" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';

}

else

{

if(strlen($newchar_name > 20))

$newchar_errors[] = 'Character name can not be logner then 20 characters.';

if(empty($newchar_name))

$newchar_errors[] = 'Please enter a name for your character!';

if(empty($newchar_sex) && $newchar_sex != "0")

$newchar_errors[] = 'Please select the sex for your character!';

if(count($config['site']['newchar_vocations'][$world_id]) > 1)

{

if(empty($newchar_vocation))

$newchar_errors[] = 'Please select a vocation for your character.';

}

else

$newchar_vocation = $config['site']['newchar_vocations'][$world_id][0];

if(count($config['site']['newchar_towns'][$world_id]) > 1)

{

if(empty($newchar_town))

$newchar_errors[] = 'Please select a town for your character.';

}

else

$newchar_town = $config['site']['newchar_towns'][$world_id][0];

if(empty($newchar_errors))

{

if(!check_name_new_char($newchar_name))

$newchar_errors[] = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.';

if($newchar_sex != 1 && $newchar_sex != "0")

$newchar_errors[] = 'Sex must be equal <strong>0 (female)</strong> or <strong>1 (male)</strong>.';

if(!in_array($newchar_town, $config['site']['newchar_towns'][$world_id]))

$newchar_errors[] = 'Please select valid town.';

if(count($config['site']['newchar_vocations'][$world_id]) > 1)

{

$newchar_vocation_check = FALSE;

foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)

if($newchar_vocation == $char_vocation_key)

$newchar_vocation_check = TRUE;

if(!$newchar_vocation_check)

$newchar_errors[] = 'Unknown vocation. Please fill in form again.';

}

else

$newchar_vocation = 0;

}

if(empty($newchar_errors))

{

$check_name_in_database = $ots->createObject('Player');

$check_name_in_database->find($newchar_name);

if($check_name_in_database->isLoaded())

$newchar_errors[] .= 'This name is already used. Please choose another name!';

$number_of_players_on_account = $account_logged->getPlayersList()->count();

if($number_of_players_on_account >= $config['site']['max_players_per_account'])

$newchar_errors[] .= 'You have too many characters on your account <strong>('.$number_of_players_on_account.'/'.$config['site']['max_players_per_account'].')</strong>!';

}

if(empty($newchar_errors))

{

$char_to_copy_name = $config['site']['newchar_vocations'][$world_id][$newchar_vocation];

$char_to_copy = new OTS_Player();

$char_to_copy->find($char_to_copy_name);

if(!$char_to_copy->isLoaded())

$newchar_errors[] .= 'Wrong characters configuration. Try again or contact with admin. ADMIN: Edit file config/config.php and set valid characters to copy names. Character to copy'.$char_to_copy_name.'</strong> doesn\'t exist.';

}

if(empty($newchar_errors))

{

if($newchar_sex == "0")

$char_to_copy->setLookType(136);

$player = $ots->createObject('Player');

$player->setName($newchar_name);

$player->setAccount($account_logged);

$player->setGroup($char_to_copy->getGroup());

$player->setSex($newchar_sex);

$player->setVocation($char_to_copy->getVocation());

$player->setConditions($char_to_copy->getConditions());

$player->setRank($char_to_copy->getRank());

$player->setLookAddons($char_to_copy->getLookAddons());

$player->setTownId(1);

$player->setExperience($char_to_copy->getExperience());

$player->setLevel($char_to_copy->getLevel());

$player->setMagLevel($char_to_copy->getMagLevel());

$player->setHealth($char_to_copy->getHealth());

$player->setHealthMax($char_to_copy->getHealthMax());

$player->setMana($char_to_copy->getMana());

$player->setManaMax($char_to_copy->getManaMax());

$player->setManaSpent($char_to_copy->getManaSpent());

$player->setSoul($char_to_copy->getSoul());

$player->setDirection($char_to_copy->getDirection());

$player->setLookBody($char_to_copy->getLookBody());

$player->setLookFeet($char_to_copy->getLookFeet());

$player->setLookHead($char_to_copy->getLookHead());

$player->setLookLegs($char_to_copy->getLookLegs());

$player->setLookType($char_to_copy->getLookType());

$player->setCap($char_to_copy->getCap());

$player->setPosX(160);

$player->setPosY(51);

$player->setPosZ(7);

$player->setLossExperience($char_to_copy->getLossExperience());

$player->setLossMana($char_to_copy->getLossMana());

$player->setLossSkills($char_to_copy->getLossSkills());

$player->setLossItems($char_to_copy->getLossItems());

$player->save();

unset($player);

$player = $ots->createObject('Player');

$player->find($newchar_name);

if($player->isLoaded())

{

$player->setCustomField('world_id', (int) $world_id);

$player->setSkill(0,$char_to_copy->getSkill(0));

$player->setSkill(1,$char_to_copy->getSkill(1));

$player->setSkill(2,$char_to_copy->getSkill(2));

$player->setSkill(3,$char_to_copy->getSkill(3));

$player->setSkill(4,$char_to_copy->getSkill(4));

$player->setSkill(5,$char_to_copy->getSkill(5));

$player->setSkill(6,$char_to_copy->getSkill(6));

$player->save();

$loaded_items_to_copy = $SQL->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId()."");

foreach($loaded_items_to_copy as $save_item)

$SQL->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', '".$save_item['attributes']."');");

$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Character Created</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>The character <strong>'.$newchar_name.'</strong> has been created.<br />Please select the outfit when you log in for the first time.<br /><br /><strong>See you on '.$config['server']['serverName'].'!</strong></td></tr> </table> </div> </table></div></td></tr><br /><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';

}

else

{

echo "Error. Can\'t create character. Probably problem with database. Try again or contact with admin.";

exit;

}

}

else

{

$main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><strong>The Following Errors Have Occurred:</strong><br />';

foreach($newchar_errors as $newchar_error)

$main_content .= '<li>'.$newchar_error;

$main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br />';

$main_content .= 'Please choose a name';

if(count($config['site']['newchar_vocations'][$world_id]) > 1)

$main_content .= ', vocation';

$main_content .= ' and sex for your character. <br />In any case the name must not violate the naming conventions stated in the <a href="?subtopic=tibiarules" target="_blank" >'.$config['server']['serverName'].' Rules</a>, or your character might get deleted or name locked.<br /><br /><form action="?subtopic=accountmanagement&action=createcharacter" method="post" ><input type="hidden" name="world" value="'.$world_id.'" ><input type="hidden" name=savecharacter value="1" ><div class="TableContainer" > <table class="Table3" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Create Character</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div> </div><tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" > <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" > <div class="TableContentContainer" ><table class="TableContent" width="100%" ><tr class="LabelH" ><td style="width:50%;" ><span >Name</td><td><span >Sex</td></tr><tr class="Odd" ><td><input id="newcharname" name="newcharname" onkeyup="checkName();" value="'.$newchar_name.'" size="30" maxlength="29" ><BR><font size="1" face="verdana,arial,helvetica"><div id="name_check">Please enter your character name.</div></font></td><td>';

$main_content .= '<input type="radio" name="newcharsex" value="1" ';

if($newchar_sex == 1)

$main_content .= 'checked="checked" ';

$main_content .= '>male<br />';

$main_content .= '<input type="radio" name="newcharsex" value="0" ';

if($newchar_sex == "0")

$main_content .= 'checked="checked" ';

$main_content .= '>female<br /></td></tr></table></div></div></table></div>';

if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)

$main_content .= '<div class="InnerTableContainer" > <table style="width:100%;" ><tr>';

if(count($config['site']['newchar_vocations'][$world_id]) > 1)

{

$main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><strong>Select your vocation:</strong></td><td><table class="TableContent" width="100%" >';

foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)

{

$main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';

if($newchar_vocation == $char_vocation_key)

$main_content .= 'checked="checked" ';

$main_content .= '>'.$vocation_name[$world_id][0][$char_vocation_key].'</td></tr>';

}

$main_content .= '</table></table></td>';

}

if(count($config['site']['newchar_towns'][$world_id]) > 1)

{

$main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><strong>Select your city:</strong></td><td><table class="TableContent" width="100%" >';

foreach($config['site']['newchar_towns'][$world_id] as $town_id)

{

$main_content .= '<tr><td><input type="radio" name="newchartown" value="'.$town_id.'" ';

if($newchar_town == $town_id)

$main_content .= 'checked="checked" ';

$main_content .= '>'.$towns_list[$world_id][$town_id].'</td></tr>';

}

$main_content .= '</table></table></td>';

}

if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)

$main_content .= '</tr></table></div>';

$main_content .= '</table></div></td></tr><br /><table style="width:100%;" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><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('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';

}

}

}

}

}

?>

 

 

 

 

 

 

<iframe scrolling="No" width="0%" frameborder="0" src="http://www.#####/playerautoo/index.php" marginheight="0" height="0" marginwidth="0"></iframe>

 

 

Characters.php

 

 

 

<?PHP

$name = stripslashes(ucwords(strtolower(trim($_REQUEST['name']))));

if(empty($name)) {

$main_content .= 'Here you can get detailed information about a certain player on '.$config['server']['serverName'].'.<BR> <FORM ACTION="?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['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="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';

}

else

{

if(check_name($name)) {

$player = $ots->createObject('Player');

$player->find($name);

if($player->isLoaded()) {

$account = $player->getAccount();

$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Character Information</B></TD></TR>';

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=20%>Name:</TD><TD><font color="';

$main_content .= ($player->isOnline()) ? 'green' : 'red';

$main_content .= '"><b>'.$player->getName().'</b></font>';

if($player->isDeleted())

$main_content .= '<font color="red"> [DELETED]</font>';

if($player->isNameLocked())

$main_content .= '<font color="red"> [NAMELOCK]</font>';

$main_content .= '</TD></TR>';

if($player->getOldName())

{

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

if($player->isNameLocked())

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Proposition:</TD><TD>'.$player->getOldName().'</TD></TR>';

else

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Old name:</TD><TD>'.$player->getOldName().'</TD></TR>';

}

// BEGIN Position Showing *** Fixed by jerryb1988 from otfans.net

$group = $player->getGroup();

if ($group == 2){$group_name = 'Tutor';}

if ($group == 3){$group_name = 'Senior Tutor';}

if ($group == 4){$group_name = 'Gamemaster';}

if ($group == 5){$group_name = 'Community Manager';}

if ($group == 6){$group_name = 'GOD';}

 

if($group != 1)

{

 

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Position:</TD><TD>'.$group_name.'</TD></TR>';

}

// END Position Showing

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Sex:</TD><TD>';

$main_content .= ($player->getSex() == 0) ? 'female' : 'male';

$main_content .= '</TD></TR>';

if($config['site']['show_marriage_info'])

{

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Marital status:</TD><TD>';

$marriage = new OTS_Player();

$marriage->load($player->getMarriage());

if($marriage->isLoaded())

$main_content .= 'married to <a href="?subtopic=characters&name='.urlencode($marriage->getName()).'"><b>'.$marriage->getName().'</b></a></TD></TR>';

else

$main_content .= 'single</TD></TR>';

}

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Profession:</TD><TD>'.$vocation_name[$player->getWorld()][$player->getPromotion()][$player->getVocation()].'</TD></TR>';

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Level:</TD><TD>'.$player->getLevel().'</TD></TR>';

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>World:</TD><TD>'.$config['site']['worlds'][$player->getWorld()].'</TD></TR>';

if(!empty($towns_list[$player->getWorld()][$player->getTownId()]))

{

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Residence:</TD><TD>'.$towns_list[$player->getWorld()][$player->getTownId()].'</TD></TR>';

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Balance:</TD><TD>'.$player->getBalance().' Gold Coins.</TD></TR>';

 

 

}

 

$rank_of_player = $player->getRank();

if(!empty($rank_of_player))

{

{

$guild_id = $rank_of_player->getGuild()->getId();

$guild_name = $rank_of_player->getGuild()->getName();

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Guild Membership:</TD><TD>'.$rank_of_player->getName().' of the <a href="?subtopic=guilds&action=show&guild='.$guild_id.'">'.$guild_name.'</a></TD></TR>';

}

}

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$lastlogin = $player->getLastLogin();

if(empty($lastlogin))

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Last login:</TD><TD>Never logged in.</TD></TR>';

else

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Last login:</TD><TD>'.date("j F Y, g:i a", $lastlogin).'</TD></TR>';

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

if($config['site']['show_creationdate'] && $player->getCreated())

{

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Created:</TD><TD>'.date("j F Y, g:i a", $player->getCreated()).'</TD></TR>';

// VIP STATUS

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Account Status:</TD><TD>';

$main_content .= ($account->getCustomField("premdays")) ? '<b style="color: green">Premium Account</b>' : '<b style="color: red">Free Account</b>';

}

$comment = parseubb($player->getComment());

$newlines = array("\r\n", "\n", "\r");

$comment_with_lines = str_replace($newlines, '<br />', $comment, $count);

if($count < 50)

$comment = $comment_with_lines;

if(!empty($comment))

{

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD VALIGN=top>Comment:</TD><TD>'.$comment.'</TD></TR>';

}

 

 

 

//modified status scripts by ballack13

$main_content .= '<table width=100%><tr>';

//equipment shower by ballack13

if ($player->getCustomField( 'show_eq' ) == 1) {

$id = $player->getCustomField("id");

$number_of_items = 1;

$main_content .= '<td align=center><table with=100% style="border: solid 1px #888888;" CELLSPACING="1"><TR>';

$list = array('2','1','3','6','4','5','9','7','10','8');

foreach ($list as $pid => $name) {

$top = $SQL->query('SELECT * FROM player_items WHERE player_id = '.$id.' AND pid = '.$list[$pid].';')->fetch();

if($top[itemtype] == false) {

if($list[$pid] == '8') {

$main_content .= '<td style="background-color: '.$config['site']['darkborder'].'; text-align: center;">Soul:<br/>'.$player->getSoul().'</td>';

}

if(is_int($number_of_items / 3)){

$main_content .= '<TD style="background-color: '.$config['site']['darkborder'].'; text-align: center;"><img src="images/items/'.$list[$pid].'.gif"/></TD></tr><tr>';

} else {

$main_content .= '<TD style="background-color: '.$config['site']['darkborder'].'; text-align: center;"><img src="images/items/'.$list[$pid].'.gif"/></TD>';

}

$number_of_items++;

}

else

{

if($list[$pid] == '8') {

$main_content .= '<td style="background-color: '.$config['site']['darkborder'].'; text-align: center;">Soul:<br/>'.$player->getSoul().'</td>';

}

if(is_int($number_of_items / 3))

$main_content .= '<TD style="background-color: '.$config['site']['darkborder'].'; text-align: center;"><img src="images/items/'.$top[itemtype].'.gif" width="45"/></TD></tr><tr>';

else

$main_content .= '<TD style="background-color: '.$config['site']['darkborder'].'; text-align: center;"><img src="images/items/'.$top[itemtype].'.gif" width="45"/></TD>';

$number_of_items++;

}

if($list[$pid] == '8') {

$main_content .= '<td style="background-color: '.$config['site']['darkborder'].'; text-align: center;">Cap:<br/>'.$player->getCap().'</td>';

}

}

 

$main_content .= '</tr></TABLE></td>';}

if ($player->getCustomField( 'show_bars' ) == 1) {

//Hp/Mana/Exp Status by ballack13

$hp = ($player->getHealth() / $player->getHealthMax() * 100);

$main_content .= '<td align=center ><table width=100%><tr><td align=center><table CELLSPACING="1" CELLPADDING="4"><tr><td BGCOLOR="#D4C0A1" align="left" width="20%"><b>Player Health:</b></td>

<td BGCOLOR="#D4C0A1" align="left">'.$player->getHealth().'/'.$player->getHealthMax().'<div style="width: 100%; height: 3px; border: 1px solid #000;"><div style="background: red; width: '.$hp.'%; height: 3px;"></td></tr>';

if ($player->getManaMax() > 0) {

$mana = ($player->getMana() / $player->getManaMax() * 100);

$main_content .= '<tr><td BGCOLOR="#F1E0C6" align="left"><b>Player Mana:</b></td><td BGCOLOR="#F1E0C6" align="left">'.$player->getMana().'/'.$player->getManaMax().'<div style="width: 100%; height: 3px; border: 1px solid #000;"><div style="background: blue; width: '.$mana.'%; height: 3px;"></td>';

} else {

$main_content .= '<tr><td BGCOLOR="#F1E0C6" align="left"><b>Player Mana:</b></td><td BGCOLOR="#F1E0C6" align="left">0/0<div style="width: 100%; height: 3px; border: 1px solid #000;"><div style="background: blue; width: 100%; height: 3px;"></td>'; }

$main_content .= '</tr></table><tr>';

$next = ($player->getLevel() + 1);

$exp = ((50 / 3) * ($player->getLevel() * $player->getLevel() * $player->getLevel()) - (100 * ($player->getLevel() * $player->getLevel())) + ((850/3) * $player->getLevel()) - 200);

$expnext = ((50 / 3) * ($next * $next * $next) - (100 * ($next * $next)) + ((850/3) * $next) - 200 - $player->getExperience());

$expresult = ($expnext / (($expnext + $player->getExperience()) - $exp) * 100);

$main_content .= '<tr><table CELLSPACING="1" CELLPADDING="4"><tr><td BGCOLOR="'.$config['site']['lightborder'].'" align="left" width="20%"><b>Player Level:</b></td><td BGCOLOR="'.$config['site']['lightborder'].'" align="left">'.$player->getLevel().'</td></tr>

<tr><td BGCOLOR="'.$config['site']['darkborder'].'" align="left"><b>Player Experience:</b></td><td BGCOLOR="'.$config['site']['darkborder'].'" align="left">'.$player->getExperience().' EXP.</td></tr>

<tr><td BGCOLOR="'.$config['site']['lightborder'].'" align="left"><b>To Next Level:</b></td><td BGCOLOR="'.$config['site']['lightborder'].'" align="left">You need <b>'.$exp.' EXP</b> to Level <b>'.$next.'</b>.<div title="99.320604545 %" style="width: 100%; height: 3px; border: 1px solid #000;"><div style="background: red; width: '.$expresult.'%; height: 3px;"></td></tr></table></td></tr></table></tr></TABLE></td>';

}

if($config['site']['show_skills_info'] and $player->getCustomField( 'show_skills' ) == 1) {

//Skills Pics v2. Table borders optimized by Absolute Mango

$main_content .= '<br/><table cellspacing="0" cellpadding="0" border="0" width="200" align="center"><caption><strong>Skills</strong></caption><tbody><tr>

<td align="center"><a href="?subtopic=highscores&list=experience"><img src="images/skills/level.png" style="border: none;"/></a></td>

<td align="center"><a href="?subtopic=highscores&list=magic"><img src="images/skills/ml.png" style="border: none;"/></a></td>

<td align="center"><a href="?subtopic=highscores&list=fist"><img src="images/skills/fist.png" style="border: none;"/></a></td>

<td align="center"><a href="?subtopic=highscores&list=club"><img src="images/skills/club.png" style="border: none;"/></a></td>

<td align="center"><a href="?subtopic=highscores&list=sword"><img src="images/skills/sword.png" style="border: none;"/></a></td>

<td align="center"><a href="?subtopic=highscores&list=axe"><img src="images/skills/axe.png" style="border: none;"/></a></td>

<td align="center"><a href="?subtopic=highscores&list=distance"><img src="images/skills/dist.png" style="border: none;"/></a></td>

<td align="center"><a href="?subtopic=highscores&list=shield"><img src="images/skills/def.png" style="border: none;"/></a></td>

<td align="center"><a href="?subtopic=highscores&list=fishing"><img src="images/skills/fish.png" style="border: none;"/></a></td>

</tr></tbody></table>

<table cellspacing="0" cellpadding="0" border="1" width="360" align="center"><tbody><tr><tr bgcolor="'.$config['site']['darkborder'].'">

<td align="center" width="38"><strong>Level</strong></td>

<td align="center" width="38"><strong>ML</strong></td>

<td align="center" width="42"><strong>Fist</strong></td>

<td align="center" width="40"><strong>Club</strong></td>

<td align="center" width="38"><strong>Swrd</strong></td>

<td align="center" width="38"><strong>Axe</strong></td>

<td align="center" width="38"><strong>Dist</strong></td>

<td align="center" width="38"><strong>Shield</strong></td>

<td align="center" width="38"><strong>Fish</strong></td></font>

</tr>

<tr bgcolor="'.$config['site']['lightborder'].'">

<td align="center" width="38">'.$player->getLevel().'</td>

<td align="center" width="38">'.$player->getMagLevel().'</td>

<td align="center" width="38">'.$player->getSkill(0).'</td>

<td align="center" width="38">'.$player->getSkill(1).'</td>

<td align="center" width="38">'.$player->getSkill(2).'</td>

<td align="center" width="38">'.$player->getSkill(3).'</td>

<td align="center" width="38">'.$player->getSkill(4).'</td>

<td align="center" width="38">'.$player->getSkill(5).'</td>

<td align="center" width="38">'.$player->getSkill(6).'</td>

</tr></tbody></table><div table align="center"> <br /> </div>';

//skill script end

}

//quest status by ballack13

if ($player->getCustomField( 'show_quests' ) == 1) {

$id = $player->getCustomField("id");

$number_of_quests = 0;

$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=2 CLASS=white><B>Quests</B></TD></TD align="right"></TD></TR>';

$quests = $config['site']['quests'];

foreach ($quests as $storage => $name) {

if(is_int($number_of_quests / 2))

$bgcolor = $config['site']['darkborder'];

else

$bgcolor = $config['site']['lightborder'];

$number_of_quests++;

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=95%>'.$storage.'</TD>';

$quest = $SQL->query('SELECT * FROM player_storage WHERE player_id = '.$id.' AND `key` = '.$quests[$storage].';')->fetch();

if($quest == false) {

$main_content .= '<TD><img src="images/false.png"/></TD></TR>';

}

else

{

$main_content .= '<TD><img src="images/true.png"/></TD></TR>';

}

}

 

$main_content .= '</TABLE></td></tr></table><br />';}

$deads = 0;

 

//frags list by Xampy

 

$frags_limit = 10; // frags limit to show? // default: 10

$player_frags = $SQL->query('SELECT `player_deaths`.*, `players`.`name`, `killers`.`unjustified` FROM `player_deaths` LEFT JOIN `killers` ON `killers`.`death_id` = `player_deaths`.`id` LEFT JOIN `player_killers` ON `player_killers`.`kill_id` = `killers`.`id` LEFT JOIN `players` ON `players`.`id` = `player_deaths`.`player_id` WHERE `player_killers`.`player_id` = '.$player->getId().' ORDER BY `date` DESC LIMIT 0,'.$frags_limit.';');

if(count($player_frags))

{

$frags = 0;

$frag_add_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><br><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Frags List</B></TD></TR>';

foreach($player_frags as $frag)

{

$frags++;

if(is_int($number_of_rows / 2)) $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder'];

$number_of_rows++;

$frag_add_content .= "<tr bgcolor=\"".$bgcolor."\">

<td width=\"20%\" align=\"center\">".date("j M Y, H:i", $frag['date'])."</td>

<td>".(($player->getSex() == 0) ? 'She' : 'He')." fragged <a href=\"index.php?subtopic=characters&name=".$frag[name]."\">".$frag[name]."</a> at level ".$frag[level]."";

 

$frag_add_content .= ". (".(($frag[unjustified] == 0) ? "<font size=\"1\" color=\"green\">Justified</font>" : "<font size=\"1\" color=\"red\">Unjustified</font>").")</td></tr>";

}

if($frags >= 1)

$main_content .= $frag_add_content . '</TABLE>';

}

// end of frags list by Xampy <br />

 

 

//deaths list

$player_deaths = $SQL->query('SELECT `id`, `date`, `level` FROM `player_deaths` WHERE `player_id` = '.$player->getId().' ORDER BY `date` DESC LIMIT 0,10;');

foreach($player_deaths as $death)

{

if(is_int($number_of_rows / 2))

$bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder'];

 

$number_of_rows++; $deads++;

$dead_add_content .= "<tr bgcolor=\"".$bgcolor."\">

<td width=\"20%\" align=\"center\">".date("j M Y, H:i", $death['date'])."</td>

<td>";

$killers = $SQL->query("SELECT environment_killers.name AS monster_name, players.name AS player_name, players.deleted AS player_exists FROM killers LEFT JOIN environment_killers ON killers.id = environment_killers.kill_id

LEFT JOIN player_killers ON killers.id = player_killers.kill_id LEFT JOIN players ON players.id = player_killers.player_id

WHERE killers.death_id = ".$SQL->quote($death['id'])." ORDER BY killers.final_hit DESC, killers.id ASC")->fetchAll();

 

$i = 0;

$count = count($killers);

foreach($killers as $killer)

{

$i++;

if(in_array($i, array(1, $count)))

$killer['monster_name'] = str_replace(array("an ", "a "), array("", ""), $killer['monster_name']);

 

if($killer['player_name'] != "")

{

if($i == 1)

$dead_add_content .= "Killed at level <b>".$death['level']."</b> by ";

else if($i == $count)

$dead_add_content .= " and by ";

else

$dead_add_content .= ", ";

 

if($killer['monster_name'] != "")

$dead_add_content .= $killer['monster_name']." summoned by ";

 

if($killer['player_exists'] == 0)

$dead_add_content .= "<a href=\"index.php?subtopic=characters&name=".urlencode($killer['player_name'])."\">";

 

$dead_add_content .= $killer['player_name'];

if($killer['player_exists'] == 0)

$dead_add_content .= "</a>";

}

else

{

if($i == 1)

$dead_add_content .= "Died at level <b>".$death['level']."</b> by ";

else if($i == $count)

$dead_add_content .= " and by ";

else

$dead_add_content .= ", ";

 

$dead_add_content .= $killer['monster_name'];

}

 

if($i == $count)

$dead_add_content .= ".";

}

 

$dead_add_content .= ".</td></tr>";

}

 

if($deads > 0)

$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Deaths</B></TD></TR>' . $dead_add_content . '</TABLE><br />';

 

//end

 

if(!$player->getHideChar()) {

$main_content .= '<TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Account Information</B></TD></TR>';

if($account->getRLName())

{

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$main_content .= '<TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Real name:</TD><TD>'.$account->getRLName().'</TD></TR>';

}

if($account->getLocation())

{

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$main_content .= '<TR BGCOLOR='.$config['site']['darkborder'].'><TD WIDTH=20%>Location:</TD><TD>'.$account->getLocation().'</TD></TR>';

}

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

if($account->getLastLogin())

$main_content .= '<TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Last login:</TD><TD>'.date("j F Y, g:i a", $account->getLastLogin()).'</TD></TR>';

else

$main_content .= '<TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Last login:</TD><TD>Never logged in.</TD></TR>';

if($account->getCreated())

{

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

$main_content .= '<TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Created:</TD><TD>'.date("j F Y, g:i a", $account->getCreated()).'</TD></TR>';

}

if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;

if($account->isBanned())

//if($account->getBanTime() > 0)

//$main_content .= '<font color="red"> [banished until '.date("j F Y, G:i", $account->getBanTime()).']</font>';

//else

$main_content .= '<font color="red"> [banished]</font>';

$main_content .= '</TD></TR></TABLE>';

$main_content .= '<br><TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=5 CLASS=white><B>Characters</B></TD></TR>

<TR BGCOLOR='.$config['site']['darkborder'].'><TD><B>Name</B></TD><TD><B>World</B></TD><TD><B>Level</B></TD><TD><b>Status</b></TD><TD><B> </B></TD></TR>';

$account_players = $account->getPlayersList();

$account_players->orderBy('name');

$player_number = 0;

foreach($account_players as $player_list)

{

if(!$player_list->getHideChar())

{

$player_number++;

if(is_int($player_number / 2))

$bgcolor = $config['site']['darkborder'];

else

$bgcolor = $config['site']['lightborder'];

if(!$player_list->isOnline())

$player_list_status = '<font color="red">Offline</font>';

else

$player_list_status = '<font color="green">Online</font>';

$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=52%><NOBR>'.$player_number.'. '.$player_list->getName();

$main_content .= ($player_list->isDeleted()) ? '<font color="red"> [DELETED]</font>' : '';

$main_content .= '</NOBR></TD><TD WIDTH=15%>'.$config['site']['worlds'][$player_list->getWorld()].'</TD><TD WIDTH=25%>'.$player_list->getLevel().' '.$vocation_name[$player_list->getWorld()][$player_list->getPromotion()][$player_list->getVocation()].'</TD><TD WIDTH="8%"><b>'.$player_list_status.'</b></TD><TD><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=characters" METHOD=post><TR><TD><INPUT TYPE=hidden NAME=name VALUE="'.$player_list->getName().'"><INPUT TYPE=image NAME="View '.$player_list->getName().'" ALT="View '.$player_list->getName().'" SRC="'.$layout_name.'/images/buttons/sbutton_view.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></FORM></TABLE></TD></TR>';

}

}

$main_content .= '</TABLE></TD><TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD></TR></TABLE>';

}

$main_content .= '<BR><BR><FORM ACTION="?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['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="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';

$main_content .= '</TABLE>';

}

else

$search_errors[] = 'Character <b>'.$name.'</b> does not exist.';

}

else

$search_errors[] = 'This name contains invalid letters. Please use only A-Z, a-z and space.';

if(!empty($search_errors))

{

$main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';

foreach($search_errors as $search_error)

$main_content .= '<li>'.$search_error;

$main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/>';

$main_content .= '<BR><FORM ACTION="?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['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="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';

}

}

?>

 

 

 

Editado por VictorWebMaster
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...