Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
691
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 162.14 KB | None | 0 0
  1. <?php
  2. date_default_timezone_set('America/Araguaina');
  3. if(!defined('INITIALIZED'))
  4.     exit;
  5.    
  6. if(!$logged)
  7.     if($action == "logout")
  8.         $main_content .= '
  9.             <div class="TableContainer" >  
  10.                 <table class="Table1" cellpadding="0" cellspacing="0" >    
  11.                     <div class="CaptionContainer" >      
  12.                         <div class="CaptionInnerContainer" >        
  13.                             <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        
  14.                             <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        
  15.                             <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        
  16.                             <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        
  17.                             <div class="Text" >Logout Successful</div>        
  18.                             <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        
  19.                             <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        
  20.                             <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        
  21.                             <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      
  22.                         </div>    
  23.                     </div>    
  24.                     <tr>      
  25.                         <td>        
  26.                             <div class="InnerTableContainer" >          
  27.                                 <table style="width:100%;" >
  28.                                     <tr>
  29.                                         <td>You have logged out of your '.htmlspecialchars($config['server']['serverName']).' account. In order to view your account you need to <a href="?subtopic=accountmanagement" >log in</a> again.</td>
  30.                                     </tr>          
  31.                                 </table>        
  32.                             </div>
  33.                         </td>
  34.                     </tr>  
  35.                 </table>
  36.             </div>';
  37.     else
  38.     {
  39.         $passB = '<span>Password:</span>';
  40.         $logB = '<span>Account Name:</span>';
  41.         if(isset($isTryingToLogin))
  42.         {
  43.             $main_content .= '
  44.                 <div class="SmallBox" >
  45.                     <div class="MessageContainer" >
  46.                         <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  47.                         <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  48.                         <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  49.                         <div class="ErrorMessage" >
  50.                             <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  51.                             <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  52.                             <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div>
  53.                             <b>The Following Errors Have Occurred:</b><br/>';
  54.             switch(Visitor::getLoginState())
  55.             {
  56.                 case Visitor::LOGINSTATE_NO_ACCOUNT:
  57.                     $main_content .= 'Account with that name doesn\'t exist.<br/>';
  58.                     $logB = '<span style="color:red;">Account Name:</span>';
  59.                     break;
  60.                 case Visitor::LOGINSTATE_WRONG_PASSWORD:
  61.                     $main_content .= 'Wrong password to account.<br/>';
  62.                     $passB = '<span style="color:red;">Password:</span>';
  63.                     break;
  64.             }
  65.                 $main_content .= '
  66.                     </div>
  67.                         <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  68.                         <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  69.                         <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" />
  70.                     </div>
  71.                 </div>
  72.             </div><br/>';
  73.         }
  74.         $main_content .= '
  75.             <form action="?subtopic=accountmanagement" method="post" style="margin: 0px; padding: 0px;">
  76.                 <div class="TableContainer" >
  77.                     <table class="Table4" cellpadding="0" cellspacing="0" >
  78.                         <div class="CaptionContainer" >
  79.                             <div class="CaptionInnerContainer" >
  80.                                 <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  81.                                 <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  82.                                 <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  83.                                 <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  84.                                 <div class="Text" >Account Login</div>
  85.                                 <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  86.                                 <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  87.                                 <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  88.                                 <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  89.                             </div>
  90.                         </div>
  91.                         <tr>
  92.                             <td>
  93.                                 <div class="InnerTableContainer" >
  94.                                     <table style="width:100%;" >
  95.                                         <tr>
  96.                                             <td>
  97.                                                 <div class="TableShadowContainerRightTop" >
  98.                                                     <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  99.                                                 </div>
  100.                                                 <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >
  101.                                                     <div class="TableContentContainer" >
  102.                                                         <table class="TableContent" width="100%"  style="border:1px solid #faf0d7;" >
  103.                                                             <tr>
  104.                                                                 <td>
  105.                                                                     <table style="float: left; width: 370px;" cellpadding="0" cellspacing="0" >
  106.                                                                         <tr>
  107.                                                                             <td class="LabelV120" ><span>'.$logB.'</span></td>
  108.                                                                             <td><input type="password" name="account_login" size="35" maxlength="30" ></td>
  109.                                                                         </tr>
  110.                                                                         <tr>
  111.                                                                             <td class="LabelV120" ><span>'.$passB.'</span></td>
  112.                                                                             <td><input type="password" name="password_login" size="35" maxlength="29" ></td>
  113.                                                                         </tr>
  114.                                                                     </table>
  115.                                                                     <div style="float: right; font-size: 1px;" >
  116.                                                                         <input type="hidden" name="page" value="overview" >
  117.                                                                             <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>
  118.                                                                                     <input class="ButtonText" type="image" name="Login" alt="Login" src="'.$layout_name.'/images/buttons/_sbutton_login.gif" >
  119.                                                                                 </div>
  120.                                                                             </div>
  121.                                                                         </form>
  122.                                                                         <div style="width: 2px; height: 2px;" ></div>
  123.                                                                         <form action="/?subtopic=lostaccount" method="post" style="padding:0px;margin:0px;" >
  124.                                                                             <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>
  125.                                                                                     <input class="ButtonText" type="image" name="Account lost?" alt="Account lost?" src="'.$layout_name.'/images/buttons/_sbutton_accountlost.gif" >
  126.                                                                                 </div>
  127.                                                                             </div>
  128.                                                                         </form>
  129.                                                                     </div>
  130.                                                                 </td>
  131.                                                             </tr>
  132.                                                         </table>
  133.                                                     </div>
  134.                                                 </div>
  135.                                                 <div class="TableShadowContainer" >
  136.                                                     <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
  137.                                                         <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>
  138.                                                         <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>
  139.                                                     </div>
  140.                                                 </div>
  141.                                             </td>
  142.                                         </tr>
  143.                                     </table>
  144.                                 </div>
  145.                             </table>
  146.                         </div>
  147.                     </td>
  148.                 </tr>
  149.                 <br/>
  150.                 <center>
  151.                     <h1>New to '.$config['server']['serverName'].'?</h1>
  152.                 </center>
  153.                 <div class="TableContainer" >
  154.                     <table class="Table4" cellpadding="0" cellspacing="0" >
  155.                         <div class="CaptionContainer" >
  156.                             <div class="CaptionInnerContainer" >
  157.                                 <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  158.                                 <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  159.                                 <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  160.                                 <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>                          
  161.                                 <div class="Text" >New Player</div>
  162.                                 <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  163.                                 <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  164.                                 <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  165.                                 <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  166.                             </div>
  167.                         </div>
  168.                         <tr>
  169.                             <td>
  170.                                 <div class="InnerTableContainer" >
  171.                                     <table style="width:100%;" >
  172.                                         <tr>
  173.                                             <td>
  174.                                                 <div class="TableShadowContainerRightTop" >
  175.                                                     <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  176.                                                 </div>
  177.                                                 <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >
  178.                                                     <div class="TableContentContainer" >
  179.                                                         <table class="TableContent" width="100%"  style="border:1px solid #faf0d7;" >
  180.                                                             <tr>
  181.                                                                 <td >
  182.                                                                     <div style="float: right; margin-top: 20px;" >
  183.                                                                         <form class="MediumButtonForm" action="/?subtopic=createaccount" method="post" >
  184.                                                                             <div class="MediumButtonBackground" style="background-image:url('.$layout_name.'/images/buttons/mediumbutton.gif)" onMouseOver="MouseOverMediumButton(this);" onMouseOut="MouseOutMediumButton(this);" ><div class="MediumButtonOver" style="background-image:url('.$layout_name.'/images/buttons/mediumbutton-over.gif)" onMouseOver="MouseOverMediumButton(this);" onMouseOut="MouseOutMediumButton(this);" ></div>
  185.                                                                                 <input class="MediumButtonText" type="image" name="Create Account" alt="Create Account" src="'.$layout_name.'/images/buttons/mediumbutton_createaccount.png" />
  186.                                                                             </div>
  187.                                                                         </form>
  188.                                                                     </div>
  189.                                                                     <div id="LoginCreateAccountBox" >
  190.                                                                         <p><b>'.$config['server']['serverName'].'...</b></p>
  191.                                                                         <div style="margin-left: 10px;" >
  192.                                                                             <p>... where hardcore gaming meets fantasy.</p>
  193.                                                                             <p>... where friendships last a lifetime.</p>
  194.                                                                             <p>... unites adventurers since 1997!</p>
  195.                                                                         </div>
  196.                                                                     </div>
  197.                                                         </table>
  198.                                                     </div>
  199.                                                 </div>
  200.                                                 <div class="TableShadowContainer" >
  201.                                                     <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
  202.                                                         <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>
  203.                                                         <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>
  204.                                                     </div>
  205.                                                 </div>
  206.                                             </td>
  207.                                         </tr>
  208.                                     </table>
  209.                                 </div>
  210.                             </table>
  211.                         </div>
  212.                     </td>
  213.                 </tr>';
  214.     }
  215. else
  216. {
  217.     $account_id = $account_logged->getId();
  218.     if($account_id == 1) die("<body bgcolor=#000000><center><br><br><br><br><br><br><br><font color='red'><b>This account is blocked for this site.</b><br><br></font><a href='?subtopic=accountmanagement&action=logout'><img src='images/block.png' width=300></a></center></body>");
  219.     //Here start our new accountmanagement ;D
  220.     if($action == "")
  221.     {
  222.         if($account_logged->getCustomField('vip_time') > 0)
  223.             $account_statusOver = '
  224.                 <span class="green">
  225.                     <span class="BigBoldText">VIP Account</span>
  226.                 </span>';
  227.         else
  228.             $account_statusOver = '
  229.                 <span class="red">
  230.                     <span class="BigBoldText">Free Account</span>
  231.                 </span>';
  232.                
  233.         if($account_logged->getCustomField('vip_time') > 0)
  234.             $account_statusPic = '<img class="AccountStatusImage" src="'.$layout_name.'/images/account/account-status_green.gif" alt="free account">';
  235.         else
  236.             $account_statusPic = '<img class="AccountStatusImage" src="'.$layout_name.'/images/account/account-status_red.gif" alt="free account">';
  237.            
  238.         $main_content .= '
  239.             <center>
  240.                 <table>
  241.                     <tbody>
  242.                         <tr>
  243.                             <td><img src="'.$layout_name.'/images/content/headline-bracer-left.gif"></td>
  244.                             <td style="text-align:center;vertical-align:middle;horizontal-align:center;font-size:17px;font-weight:bold;">Welcome to your account '.$account_logged->getRLName().'!<br></td>
  245.                             <td><img src="'.$layout_name.'/images/content/headline-bracer-right.gif"></td>
  246.                         </tr>
  247.                     </tbody>
  248.                 </table>
  249.             </center>
  250.             <br>';
  251.         $main_content .= '
  252.             <div class="TableContainer">
  253.                 <div class="CaptionContainer">
  254.                     <div class="CaptionInnerContainer">
  255.                         <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  256.                         <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  257.                         <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  258.                         <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  259.                         <div class="Text">Account Status</div>
  260.                         <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  261.                         <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  262.                         <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  263.                         <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  264.                     </div>
  265.                 </div>
  266.                 <table class="Table5" cellpadding="0" cellspacing="0">
  267.                     <tbody>
  268.                         <tr>
  269.                             <td>
  270.                                 <div class="InnerTableContainer">
  271.                                     <table style="width:100%;">
  272.                                         <tbody>
  273.                                             <tr>
  274.                                                 <td>
  275.                                                     <div class="TableShadowContainerRightTop">
  276.                                                         <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  277.                                                     </div>
  278.                                                     <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  279.                                                         <div class="TableContentContainer">
  280.                                                             <table class="TableContent" width="100%" style="border:1px solid #faf0d7;">
  281.                                                                 <tbody>
  282.                                                                     <tr>
  283.                                                                         <td>'.$account_statusPic.'</td>
  284.                                                                         <td width="100%" valign="middle">
  285.                                                                             '.$account_statusOver.'';
  286.                                                                         $main_content .= '
  287.                                                                             <small><br>Your VIP time expires at <font style="text-transform:capitalize;">'.date('d/m/Y, H:i:s', $account_logged->getCustomField('vip_time')).'</font></small>';
  288.                                                                         $main_content .= '
  289.                                                                         </td>
  290.                                                                         <td>
  291.                                                                             <form action="?subtopic=accountmanagement&action=manage" method="post" style="padding:0px;margin:0px;">
  292.                                                                                 <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)">
  293.                                                                                     <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);">
  294.                                                                                         </div>
  295.                                                                                         <input class="ButtonText" type="image" name="Manage Account" alt="Manage Account" src="'.$layout_name.'/images/buttons/_sbutton_manageaccount.gif">
  296.                                                                                     </div>
  297.                                                                                 </div>
  298.                                                                             </form>
  299.                                                                             <div style="font-size:1px;height:4px;"></div>
  300.                                                                                 <form action="?subtopic=donate" method="post" style="padding:0px;margin:0px;">
  301.                                                                                     <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton_green.gif)">
  302.                                                                                         <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_green_over.gif);"></div>
  303.                                                                                             <input class="ButtonText" type="image" name="Get Premium" alt="Get Premium" src="'.$layout_name.'/images/buttons/_sbutton_getpremium.gif">
  304.                                                                                         </div>
  305.                                                                                     </div>
  306.                                                                                 </form>
  307.                                                                                 <div style="font-size:1px;height:4px;"></div>
  308.                                                                                 <form action="?subtopic=accountmanagement&action=logout" method="post" style="padding:0px;margin:0px;">
  309.                                                                                     <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton_red.gif)">
  310.                                                                                         <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_red_over.gif);"></div>
  311.                                                                                             <input class="ButtonText" type="image" name="Logout" alt="Logout" src="'.$layout_name.'/images/buttons/_sbutton_logout.gif">
  312.                                                                                         </div>
  313.                                                                                     </div>
  314.                                                                                 </form>
  315.                                                                             </td>
  316.                                                                         </tr>
  317.                                                                     </tbody>
  318.                                                                 </table>
  319.                                                             </div>
  320.                                                         </div>
  321.                                                         <div class="TableShadowContainer">
  322.                                                             <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">
  323.                                                             <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
  324.                                                             <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
  325.                                                         </div>
  326.                                                     </div>
  327.                                                 </td>
  328.                                             </tr>
  329.                                         </tbody>
  330.                                     </table>
  331.                                 </div>
  332.                             </td>
  333.                         </tr>
  334.                     </tbody>
  335.                 </table>
  336.             </div>
  337.             <br>';
  338.             //REGISTRAR
  339.             $account_reckey = $account_logged->getCustomField("key");
  340.             if(empty($account_reckey))
  341.             $main_content .= '
  342.                 <div class="SmallBox" >
  343.                     <div class="MessageContainer" >
  344.                         <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  345.                         <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  346.                         <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  347.                         <div class="Message" >
  348.                             <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  349.                             <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  350.                             <table class="HintBox" >
  351.                                 <tr>
  352.                                     <td>
  353.                                         <div class="BoxButtons" >
  354.                                             <form action="?subtopic=accountmanagement&action=registeraccount" method="post" style="padding:0px;margin:0px;" >
  355.                                                 <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  356.                                                     <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
  357.                                                         <div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  358.                                                         <input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="'.$layout_name.'/images/buttons/_sbutton_registeraccount.gif" >
  359.                                                     </div>
  360.                                                 </div>
  361.                                             </form>
  362.                                             <div style="font-size:1px;height:4px;" ></div>
  363.                                         </div>
  364.                                         <p><b>Your account is not registered!</b></p>
  365.                                         <p>You need to click here to register your account and receive your recovery key. Please take carefull your Recovery Key.</p>
  366.                                         <p>In case you have lost your Recovery Key, you can request the new recovery key for your account again.</p>
  367.                                     </td>
  368.                                 <tr>
  369.                             </table>
  370.                         </div>
  371.                         <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  372.                             <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  373.                             <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  374.                         </div>
  375.                     </div><br/>
  376.             ';
  377.             //CHARACTERS
  378.             $main_content .= '
  379.                 <div class="RowsWithOverEffect">
  380.                     <div class="TableContainer">
  381.                         <div class="CaptionContainer">
  382.                             <div class="CaptionInnerContainer">
  383.                                 <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  384.                                 <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  385.                                 <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  386.                                 <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  387.                                 <div class="Text">Characters</div>
  388.                                 <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></span>
  389.                                 <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);"></span>
  390.                                 <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  391.                                 <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></span>
  392.                             </div>
  393.                         </div>
  394.                         <table class="Table3" cellpadding="0" cellspacing="0">
  395.                             <tbody>
  396.                                 <tr>
  397.                                     <td>
  398.                                         <div class="InnerTableContainer">
  399.                                             <table style="width:100%;">
  400.                                                 <tbody>
  401.                                                     <tr>
  402.                                                         <td>
  403.                                                             <div class="TableShadowContainerRightTop">
  404.                                                                 <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
  405.                                                             </div>
  406.                                                             <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);">
  407.                                                                 <div class="TableContentContainer">
  408.                                                                     <table class="TableContent" width="100%" style="border:1px solid #faf0d7;">
  409.                                                                         <tbody>
  410.                                                                             <tr class="LabelH">
  411.                                                                                 <td></td>
  412.                                                                                 <td style="width:40%;">Name</td>
  413.                                                                                 <td style="width:120px!important;">World</td>
  414.                                                                                 <td style="width:90px!important;">Status</td>
  415.                                                                                 <td style="width:90px!important;">&nbsp;</td>
  416.                                                                             </tr>';
  417.                                                                            
  418.                                                                     $account_players = $account_logged->getPlayersList();
  419.                                                                     $acc_id = $account_logged->getId();
  420.                                                                     if($acc_id == 1) die("Está conta está BLOQUEADA.");
  421.                                                                     //show list of players on account
  422.                                                                     $var = 0;
  423.                                                                     foreach($account_players as $account_player)
  424.                                                                         {
  425.                                                                             $player_number_counter++;
  426.                                                                             if($var==0) {
  427.                                                                                     $preview = ' previewstate="0"';
  428.                                                                             } else {
  429.                                                                                     $preview = '';
  430.                                                                             }
  431.                                                                            
  432.                                                                             if($var==0) {
  433.                                                                                 $display = 'block';
  434.                                                                             } else {
  435.                                                                                 $display = 'none';
  436.                                                                             }
  437.                                                                            
  438.                                                                             if($var==0) {
  439.                                                                                 $displayNum = 'none';
  440.                                                                             } else {
  441.                                                                                 $displayNum = 'inline';
  442.                                                                             }
  443.                                                                            
  444.                                                                             if($var==0) {
  445.                                                                                 $displayBold = 'bold';
  446.                                                                             } else {
  447.                                                                                 $displayBold = 'normal';
  448.                                                                             }
  449.                                                                            
  450.                                                                             if($var==0) {
  451.                                                                                 $displayFont = '13';
  452.                                                                             } else {
  453.                                                                                 $displayFont = '10';
  454.                                                                             }
  455.                                                                            
  456.                                                                             $main_content .='
  457.                                                                             <tr id="CharacterRow_'.$player_number_counter.'"
  458.                                                                                 onmouseover="InRowWithOverEffect(&#39;CharacterRow_'.$player_number_counter.'&#39;,';
  459.                                                                                
  460.                                                                                 if(is_int($player_number_counter / 2))
  461.                                                                                     $main_content .= '&#39;#e7d1af&#39;';
  462.                                                                                 else
  463.                                                                                     $main_content .= '&#39;#ffedd1&#39;';
  464.                                                                                
  465.                                                                                
  466.                                                                                 $main_content .='
  467.                                                                                 );"
  468.                                                                                 onmouseout="OutRowWithOverEffect(&#39;CharacterRow_'.$player_number_counter.'&#39;,';
  469.                                                                                
  470.                                                                                 if(is_int($player_number_counter / 2))
  471.                                                                                     $main_content .= '&#39;#d5c0a1&#39;';
  472.                                                                                 else
  473.                                                                                     $main_content .= '&#39;#f1e0c6&#39;';                                                                              
  474.                                                                                
  475.                                                                                 $main_content .='
  476.                                                                                 );"
  477.                                                                                 onclick="FocusCharacter('.$player_number_counter.', &#39;'.urlencode($account_player->getName()).'&#39;, '.$config['site']['max_players_per_account'].');"
  478.                                                                                 class="Odd" style="font-weight: '.$displayBold.';';
  479.                                                                                
  480.                                                                                 if(is_int($player_number_counter / 2))
  481.                                                                                     $main_content .= 'background-color: #d5c0a1;">';
  482.                                                                                 else
  483.                                                                                     $main_content .= 'background-color: #f1e0c6;">';
  484.                                                                                
  485.                                                                                 $main_content .='
  486.                                                                                 <td style="width:40px;text-align:center;padding:2px;">
  487.                                                                                     <span id="CharacterNumberOf_'.$player_number_counter.'" style="display: '.$displayNum.';">'.$player_number_counter.'.</span>
  488.                                                                                     <span id="PlayButtonOf_'.$player_number_counter.'" style="display: '.$display.';">
  489.                                                                                         <span name="FlashClientPlayButton" id="FlashClientPlayButton" playlink="#" ' . $preview . '>';
  490.                                                                                        
  491.                                                                                         if($account_player->isDeleted())
  492.                                                                                             {
  493.                                                                                                 $main_content .= '<img style="border:0px;" src="'.$layout_name.'/images/account/play-not-button.gif">';
  494.                                                                                             } else {
  495.                                                                                                 $main_content .= '
  496.                                                                                                 <a href="#" >
  497.                                                                                                     <img style="border:0px;" onmouseover="InMiniButton(this, &#39;&#39;);" onmouseout="OutMiniButton(this, &#39;&#39;);" src="'.$layout_name.'/images/account/play-button.gif">
  498.                                                                                                 </a>';
  499.                                                                                             }
  500.                                                                                            
  501.                                                                                         $main_content .='
  502.                                                                                         </span>
  503.                                                                                     </span>
  504.                                                                                 </td>
  505.                                                                                 <td id="CharacterCell2_'.$player_number_counter.'">
  506.                                                                                     <span style="white-space:nowrap;vertical-align:middle;">
  507.                                                                                         <span id="CharacterNameOf_'.$player_number_counter.'" style="font-size: '.$displayFont.'pt;">'.htmlspecialchars($account_player->getName()).'</span><br>
  508.                                                                                         <span id="CharacterNameOf_'.$player_number_counter.'"><small>'.htmlspecialchars($vocation_name[$account_player->getPromotion()][$account_player->getVocation()]).' - Level '.$account_player->getLevel().'</small></span>
  509.                                                                                     </span>
  510.                                                                                 </td>
  511.                                                                                 <td id="CharacterCell2_'.$player_number_counter.'">
  512.                                                                                     <span style="white-space:nowrap;">'.htmlspecialchars($config['server']['serverName']).'</span>
  513.                                                                                 </td>
  514.                                                                                 <td id="CharacterCell3_'.$player_number_counter.'">';
  515.                                                                                     if(!$account_player->isOnline())
  516.                                                                                         $main_content .= '';
  517.                                                                                     else
  518.                                                                                         $main_content .= '<font color="#00CD00"><b>online</b></font>';
  519.                                                                                     if($account_player->isDeleted())
  520.                                                                                         {
  521.                                                                                             $main_content .= 'deleted';
  522.                                                                                         }
  523.                                                                                 $main_content .='
  524.                                                                                 </td>
  525.                                                                                 <td id="CharacterCell4_'.$player_number_counter.'" style="text-align:center;">
  526.                                                                                     <span id="CharacterOptionsOf_'.$player_number_counter.'" style="display: '.$display.';">
  527.                                                                                         <span style="font-weight:normal;">[<a href="?subtopic=accountmanagement&action=changecomment&name='.urlencode($account_player->getName()).'">Edit</a>]</span>';
  528.                                                                                         if($account_player->isDeleted())
  529.                                                                                         {
  530.                                                                                             $main_content .= '<br><span style="font-weight:normal;">[<a href="?subtopic=accountmanagement&action=undelete&name='.urlencode($account_player->getName()).'">Undelete</a>]</span>';
  531.                                                                                         } else {
  532.                                                                                             $main_content .= '<br><span style="font-weight:normal;">[<a href="?subtopic=accountmanagement&action=deletecharacter&name='.urlencode($account_player->getName()).'">Delete</a>]</span>';
  533.                                                                                         }
  534.                                                                                        
  535.                                                                                     $main_content .= '
  536.                                                                                     </span>
  537.                                                                                 </td>
  538.                                                                             </tr>';
  539.                                                                             $var++;
  540.                                                                         }                                                                      
  541.                                                                         $main_content .='
  542.                                                                         </tbody>
  543.                                                                     </table>
  544.                                                                 </div>
  545.                                                             </div>
  546.                                                             <div class="TableShadowContainer">
  547.                                                                 <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);">
  548.                                                                     <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
  549.                                                                     <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
  550.                                                                 </div>
  551.                                                             </div>
  552.                                                         </td>
  553.                                                     </tr>
  554.                                                     <tr>
  555.                                                         <td>
  556.                                                             <table class="InnerTableButtonRow" cellpadding="0" cellspacing="0">
  557.                                                                 <tbody>
  558.                                                                     <tr>
  559.                                                                         <td></td>
  560.                                                                         <td align="right" style="padding-right:7px;width:100%;">
  561.                                                                             <form action="?subtopic=accountmanagement&action=createcharacter" method="post" style="padding:0px;margin:0px;">
  562.                                                                                 <input type="hidden" name="selectedcharacter" value="Draz Mytos">
  563.                                                                                 <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)">
  564.                                                                                     <div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);"></div>
  565.                                                                                         <input class="ButtonText" type="image" name="Create Character" alt="Create Character" src="'.$layout_name.'/images/buttons/_sbutton_createcharacter.gif">
  566.                                                                                     </div>
  567.                                                                                 </div>
  568.                                                                             </form>
  569.                                                                         </td>
  570.                                                                     </tr>
  571.                                                                 </tbody>
  572.                                                             </table>
  573.                                                         </td>
  574.                                                     </tr>
  575.                                                 </tbody>
  576.                                             </table>
  577.                                         </div>
  578.                                     </td>
  579.                                 </tr>
  580.                             </tbody>
  581.                         </table>
  582.                     </div>
  583.                 </div>
  584.                 <br><br>';
  585.                 //MIGRATION TOOL ;D
  586.                 if($group_id_of_acc_logged >= $config['site']['access_admin_panel']){
  587.                 $main_content .= '
  588.                     <div class="SmallBox">
  589.                         <div class="MessageContainer">
  590.                             <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);"></div>
  591.                             <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  592.                             <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  593.                             <div class="Message">
  594.                                 <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></div>
  595.                                 <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></div>
  596.                                 <table class="HintBox">
  597.                                     <tbody>
  598.                                         <tr>
  599.                                             <td>
  600.                                                 <p><b>Admin Panel</b></p>
  601.                                                 <p>Click <a href="?subtopic=cpanel">here</a> to go your new <strong>Admin Panel</strong></p>
  602.                                             </td>
  603.                                         </tr>
  604.                                         <tr></tr>
  605.                                     </tbody>
  606.                                 </table>
  607.                             </div>
  608.                             <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);"></div>
  609.                             <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  610.                             <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  611.                         </div>
  612.                     </div>
  613.                     <br>';
  614.                 }else{
  615.                     $main_content .= '
  616.                     <div class="SmallBox">
  617.                         <div class="MessageContainer">
  618.                             <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);"></div>
  619.                             <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  620.                             <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  621.                             <div class="Message">
  622.                                 <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></div>
  623.                                 <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);"></div>
  624.                                 <table class="HintBox">
  625.                                     <tbody>
  626.                                         <tr>
  627.                                             <td>
  628.                                                 <p><b>New Account Management</b></p>
  629.                                                 <p>This is the main page of managing your account, here you will have the key to your account information displayed and updated, enjoy! </p>
  630.                                             </td>
  631.                                         </tr>
  632.                                         <tr></tr>
  633.                                     </tbody>
  634.                                 </table>
  635.                             </div>
  636.                             <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);"></div>
  637.                             <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  638.                             <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);"></div>
  639.                         </div>
  640.                     </div>
  641.                     <br>';
  642.                 }
  643.     }
  644.     //Here finish our new account management
  645.    
  646.     if($action == "manage")
  647.     {
  648.         $account_reckey = $account_logged->getCustomField("key");
  649.         $dataAtual = time();
  650.         $dataProxima = $account_logged->getCustomField('vip_time');
  651.         $data1 = $dataProxima - $dataAtual;
  652.         $dataCerta = $data1 / 86400;
  653.         if($account_logged->getCustomField('vip_time') > 0)
  654.             $account_status = '<b><font color="#00CD00">VIP Account, '. floor($dataCerta) .' days left</font></b>';
  655.         else
  656.             $account_status = '<b><font color="red">Free Account</font></b>';
  657.         if(empty($account_reckey))
  658.             $account_registred = '<b><font color="red">No</font></b>';
  659.         else
  660.             if($config['site']['generate_new_reckey'] && $config['site']['send_emails'])
  661.                 $account_registred = '<b><font color="green">Yes ( <a href="?subtopic=accountmanagement&action=newreckey"> Buy new Rec key </a> )</font></b>';
  662.             else
  663.                 $account_registred = '<b><font color="green">Yes</font></b>';
  664.                
  665.         $account_created = $account_logged->getCreateDate();
  666.         $account_email = $account_logged->getEMail();
  667.         $account_email_new_time = $account_logged->getCustomField("email_new_time");
  668.         if($account_email_new_time > 1)
  669.             $account_email_new = $account_logged->getCustomField("email_new");
  670.         $account_rlname = $account_logged->getRLName();
  671.         $account_location = $account_logged->getLocation();
  672.         $acc_id = $account_logged->getId();
  673.         if($acc_id == 1) die("Está conta está BLOQUEADA.");
  674.        
  675.         $main_content .= '
  676.             <div class="SmallBox" >
  677.                 <div class="MessageContainer" >
  678.                     <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  679.                     <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  680.                     <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  681.                     <div class="Message" >
  682.                         <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" />
  683.                     </div>
  684.                     <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  685.                     <table style="width:100%;" >
  686.                         <td style="width:100%;text-align:center;" >
  687.                             <nobr>[<a href="#General+Information" >General Information</a>]</nobr>
  688.                             <nobr>[<a href="#Registration" >Registration</a>]</nobr>
  689.                         </td>
  690.                         <td>
  691.                             <form action="?subtopic=donate" method="post" style="padding:0px;margin:0px;" >
  692.                                 <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton_green.gif)" >
  693.                                     <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_green_over.gif);" ></div>
  694.                                         <input class="ButtonText" type="image" name="Get Premium" alt="Get Premium" src="'.$layout_name.'/images/buttons/_sbutton_getpremium.gif" >
  695.                                     </div>
  696.                                 </div>
  697.                             </form>
  698.                             <div style="font-size:1px;height:4px;" ></div>
  699.                             <table border="0" cellspacing="0" cellpadding="0" >
  700.                                 <form action="?subtopic=accountmanagement" method="post" >
  701.                                     <tr>
  702.                                         <td style="border:0px;" >
  703.                                             <input type="hidden" name=page value=overview >
  704.                                             <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  705.                                                 <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  706.                                                     <input class="ButtonText" type="image" name="Overview" alt="Overview" src="'.$layout_name.'/images/buttons/_sbutton_overview.gif" >
  707.                                                 </div>
  708.                                             </div>
  709.                                         </td>
  710.                                     </tr>
  711.                                 </form>
  712.                             </table>
  713.                         </td>
  714.                     </tr>
  715.                 </table>
  716.             </div>
  717.             <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>
  718.             <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  719.             <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>
  720.         </div>
  721.     </div><br/>';
  722.         $main_content .= '
  723.             <a name="General+Information" ></a>
  724.             <div class="TopButtonContainer" >
  725.                 <div class="TopButton" >
  726.                     <a href="#top" >
  727.                         <image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" />
  728.                     </a>
  729.                 </div>
  730.             </div>
  731.             <div class="TableContainer" >
  732.                 <table class="Table3" cellpadding="0" cellspacing="0" >
  733.                     <div class="CaptionContainer" >
  734.                         <div class="CaptionInnerContainer" >
  735.                             <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  736.                             <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  737.                             <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  738.                             <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>              
  739.                             <div class="Text" >General Information</div>
  740.                             <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  741.                             <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  742.                             <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  743.                             <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  744.                         </div>
  745.                     </div>
  746.                     <tr>       
  747.                         <td>       
  748.                             <div class="InnerTableContainer" >
  749.                                 <table style="width:100%;" >
  750.                                     <tr>
  751.                                         <td>
  752.                                             <div class="TableShadowContainerRightTop" >
  753.                                                 <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  754.                                             </div>
  755.                                             <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >
  756.                                                 <div class="TableContentContainer" >
  757.                                                     <table class="TableContent" width="100%" >
  758.                                                         <tr style="background-color:#D4C0A1;" >
  759.                                                             <td class="LabelV" >Account Name:</td>
  760.                                                             <td style="width:90%;" >
  761.                                                                 <div style="position:relative;width:100%;" >
  762.                                                                     <span id="DisplayAccountID" >'.str_repeat('*', strlen(htmlspecialchars($account_logged->getName()))).'</span>
  763.                                                                     <span id="MaskedAccountID" style="visibility:hidden;display:none" >'.str_repeat('*', strlen(htmlspecialchars($account_logged->getName()))).'</span>
  764.                                                                     <span id="ReadableAccountID" style="visibility:hidden;display:none" >'.htmlspecialchars($account_logged->getName()).'</span>
  765.                                                                     <img id="ButtonAccountID" onMouseDown="ToggleMaskedText(\'AccountID\');" style="position:absolute;right:0px;top:2px;cursor:pointer;" src="'.$layout_name.'/images/general/show.gif" />
  766.                                                                 </div>
  767.                                                             </td>
  768.                                                         </tr>
  769.                                                         <tr style="background-color:#F1E0C6;" >
  770.                                                             <td class="LabelV" >Email Address:</td>
  771.                                                             <td style="width:90%;" >
  772.                                                                 <div style="position:relative;width:100%;" >
  773.                                                                     <span id="DisplayEMail" >'.str_repeat('*', strlen(htmlspecialchars($account_email))).'</span>
  774.                                                                     <span id="MaskedEMail" style="visibility:hidden;display:none" >'.str_repeat('*', strlen(htmlspecialchars($account_email))).'</span>
  775.                                                                     <span id="ReadableEMail" style="visibility:hidden;display:none" >'.htmlspecialchars($account_email).'</span>
  776.                                                                     <img id="ButtonEMail" onMouseDown="ToggleMaskedText(\'EMail\');" style="position:absolute;right:0px;top:2px;cursor:pointer;" src="'.$layout_name.'/images/general/show.gif" />
  777.                                                                 </div>
  778.                                                             </td>
  779.                                                         </tr>
  780.                                                         <tr style="background-color:#D4C0A1;" >
  781.                                                             <td class="LabelV" >Created:</td>
  782.                                                                 <td>'.date("M d Y, G:i:s", $account_created).'</td>
  783.                                                         </tr>
  784.                                                         <tr style="background-color:#F1E0C6;" >
  785.                                                             <td class="LabelV" >Last Login:</td>
  786.                                                             <td>'.date("M d Y, G:i:s", time()).'</td>
  787.                                                         </tr>
  788.                                                         <tr style="background-color:#D4C0A1;" >
  789.                                                             <td class="LabelV" >Account Status:</td>
  790.                                                             <td>'.$account_status;
  791.                                                             if($account_logged->getCustomField('vip_time') <= time()){
  792.                                                                
  793.                                                                 $main_content .= '<br/><font style="font-size:8pt">(VIP time expired at ' .date('d/m/Y, H:i:s', $account_logged->getCustomField('vip_time')). ')</font>';
  794.                                                             }else{
  795.                                                                 $main_content .= '<br/><font style="font-size:8pt">(VIP time expires at ' .date('d/m/Y, H:i:s', $account_logged->getCustomField('vip_time')). ')</font>';
  796.                                                             }
  797.                                                         $main_content .= '
  798.                                                             </td>
  799.                                                         </tr>
  800.                                                     </table>
  801.                                                 </div>
  802.                                             </div>
  803.                                             <div class="TableShadowContainer" >
  804.                                                 <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
  805.                                                     <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>
  806.                                                     <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>
  807.                                                 </div>
  808.                                             </div>
  809.                                         </td>
  810.                                     </tr>
  811.                                     <tr>
  812.                                         <td>
  813.                                             <table class="InnerTableButtonRow" cellpadding="0" cellspacing="0" >
  814.                                                 <tr>
  815.                                                     <td>
  816.                                                         <table border="0" cellspacing="0" cellpadding="0" >
  817.                                                             <form action="?subtopic=accountmanagement&action=changepassword" method="post" >
  818.                                                                 <tr>
  819.                                                                     <td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  820.                                                                             <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  821.                                                                                 <input class="ButtonText" type="image" name="Change Password" alt="Change Password" src="'.$layout_name.'/images/buttons/_sbutton_changepassword.gif" >
  822.                                                                             </div>
  823.                                                                         </div>
  824.                                                                     </td>
  825.                                                                 </tr>
  826.                                                             </form>
  827.                                                         </table>
  828.                                                     <td></td>
  829.                                                     <td>
  830.                                                         <table class="InnerTableButtonRow" cellpadding="0" cellspacing="0" >
  831.                                                             <form action="?subtopic=accountmanagement&action=changeemail" method="post" >
  832.                                                                 <tr>
  833.                                                                     <td style="border:0px;" ><input type="hidden" name=step value=changename >
  834.                                                                         <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  835.                                                                             <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  836.                                                                                 <input class="ButtonText" type="image" name="Change Email" alt="Rename Account" src="'.$layout_name.'/images/buttons/_sbutton_changeemail.gif" >
  837.                                                                             </div>
  838.                                                                         </div>
  839.                                                                     </td>
  840.                                                                 </tr>
  841.                                                             </form>
  842.                                                         </table>
  843.                                                     </td>                                          
  844.                                                 </tr>
  845.                                             </table>
  846.                                         </td>
  847.                                     </tr>
  848.                                 </table>
  849.                             </div>
  850.                         </table>
  851.                     </div>
  852.                 </td>
  853.             </tr><br/><br/>';
  854.         if($account_email_new_time > 1)
  855.             if($account_email_new_time < time())
  856.                 $account_email_change = '<br>(You can accept <b>'.htmlspecialchars($account_email_new).'</b> as a new email.)';
  857.             else
  858.             {
  859.                 $account_email_change = ' <br>You can accept <b>new e-mail after '.date("j F Y", $account_email_new_time).".</b>";
  860.                
  861.                 $main_content .= '
  862.                     <div class="SmallBox" >  
  863.                         <div class="MessageContainer" >    
  864.                             <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    
  865.                             <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    
  866.                             <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    
  867.                             <div class="Message" >      
  868.                                 <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      
  869.                                 <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>
  870.                                 <table>
  871.                                     <tr>
  872.                                         <td class="LabelV" >Note:</td>
  873.                                         <td style="width:100%;" >A request has been submitted to change the email address of this account to <b>'.htmlspecialchars($account_email_new).'</b>. After <b>'.date("j F Y, G:i:s", $account_email_new_time).'</b> 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>
  874.                                     </tr>
  875.                                 </table>
  876.                                 <div align="center" >
  877.                                     <table border="0" cellspacing="0" cellpadding="0" >
  878.                                         <form action="?subtopic=accountmanagement&action=changeemail" method="post" >
  879.                                             <tr>
  880.                                                 <td style="border:0px;" >
  881.                                                     <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  882.                                                         <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
  883.                                                             <div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  884.                                                             <input class="ButtonText" type="image" name="Edit" alt="Edit" src="'.$layout_name.'/images/buttons/_sbutton_edit.gif" >
  885.                                                         </div>
  886.                                                     </div>
  887.                                                 </td>
  888.                                             </tr>
  889.                                         </form>
  890.                                     </table>
  891.                                 </div>    
  892.                             </div>    
  893.                             <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    
  894.                             <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    
  895.                             <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  
  896.                         </div>
  897.                     </div>
  898.                 <br/><br/>';
  899.             }
  900.            
  901.         //REGISTRATION
  902.         $main_content .= '
  903.             <a name="Registration" ></a>
  904.             <div class="TopButtonContainer" >
  905.                 <div class="TopButton" >
  906.                     <a href="#top" >
  907.                         <image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" />
  908.                     </a>
  909.                 </div>
  910.             </div>
  911.             <div class="TableContainer" >  
  912.                 <table class="Table5" cellpadding="0" cellspacing="0" >    
  913.                     <div class="CaptionContainer" >      
  914.                         <div class="CaptionInnerContainer" >
  915.                             <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  916.                             <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  917.                             <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  918.                             <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  919.                             <div class="Text" >Registration</div>
  920.                             <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
  921.                             <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
  922.                             <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  923.                             <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
  924.                         </div>    
  925.                     </div>    
  926.                     <tr>      
  927.                         <td>        
  928.                             <div class="InnerTableContainer" >          
  929.                                 <table style="width:100%;" >
  930.                                     <tr>
  931.                                         <td>
  932.                                             <div class="TableShadowContainerRightTop" >  
  933.                                                 <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  934.                                             </div>
  935.                                             <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >
  936.                                                 <div class="TableContentContainer" >    
  937.                                                     <table class="TableContent" width="100%" >
  938.                                                         <tr>
  939.                                                             <td>
  940.                                                                 <table style="width:100%;">
  941.                                                                     <tr>
  942.                                                                         <td class="LabelV" >Real Name:</td>
  943.                                                                         <td style="width:90%;" >'.$account_rlname.'</td>
  944.                                                                     </tr>
  945.                                                                     <tr>
  946.                                                                         <td class="LabelV" >Location:</td>
  947.                                                                         <td style="width:90%;" >'.$account_location.'</td>
  948.                                                                     </tr>
  949.                                                                 </table>
  950.                                                             </td>
  951.                                                             <td align=right>
  952.                                                                 <table border="0" cellspacing="0" cellpadding="0" >
  953.                                                                     <form action="?subtopic=accountmanagement&action=changeinfo" method="post" >
  954.                                                                         <tr>
  955.                                                                             <td style="border:0px;" >
  956.                                                                                 <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  957.                                                                                     <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
  958.                                                                                         <div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  959.                                                                                         <input class="ButtonText" type="image" name="Edit" alt="Edit" src="'.$layout_name.'/images/buttons/_sbutton_edit.gif" >
  960.                                                                                     </div>
  961.                                                                                 </div>
  962.                                                                             </td>
  963.                                                                         </tr>
  964.                                                                     </form>
  965.                                                                 </table>
  966.                                                             </td>
  967.                                                         </tr>    
  968.                                                     </table>  
  969.                                                 </div>
  970.                                             </div>
  971.                                             <div class="TableShadowContainer" >  
  972.                                             <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >    
  973.                                                 <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>    
  974.                                                 <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>  
  975.                                             </div>
  976.                                         </div>
  977.                                     </td>
  978.                                 </tr>          
  979.                             </table>        
  980.                         </div>  
  981.                     </table>
  982.                 </div>
  983.             </td>
  984.         </tr><br/>';
  985.     }
  986. //########### CHANGE PASSWORD ##########
  987.     if($action == "changepassword") {
  988.         $new_password = trim($_POST['newpassword']);
  989.         $new_password2 = trim($_POST['newpassword2']);
  990.         $old_password = trim($_POST['oldpassword']);
  991.         if(empty($new_password) && empty($new_password2) && empty($old_password))
  992.         {
  993.             $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>';
  994.         }
  995.         else
  996.         {
  997.             if(empty($new_password) || empty($new_password2) || empty($old_password))
  998.             {
  999.                 $show_msgs[] = "Please fill in form.";
  1000.             }
  1001.             if($new_password != $new_password2)
  1002.             {
  1003.                 $show_msgs[] = "The new passwords do not match!";
  1004.             }
  1005.             if(empty($show_msgs))
  1006.             {
  1007.                 if(!check_password($new_password))
  1008.                 {
  1009.                     $show_msgs[] = "New password contains illegal chars (a-z, A-Z and 0-9 only!) or lenght.";
  1010.                 }
  1011.                 if(!$account_logged->isValidPassword($old_password))
  1012.                 {
  1013.                     $show_msgs[] = "Current password is incorrect!";
  1014.                 }
  1015.             }
  1016.             if(!empty($show_msgs))
  1017.             {
  1018.                 //show errors
  1019.                 $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/>';
  1020.                 foreach($show_msgs as $show_msg) {
  1021.                     $main_content .= '<li>'.$show_msg;
  1022.                 }
  1023.                 $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/>';
  1024.                 //show form
  1025.                 $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>';
  1026.             }
  1027.             else
  1028.             {
  1029.                 $org_pass = $new_password;
  1030.                 $account_logged->setPassword($new_password);
  1031.                 $account_logged->save();
  1032.                 $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.';
  1033.                 if($config['site']['send_emails'] && $config['site']['send_mail_when_change_password'])
  1034.                 {
  1035.                     $mailBody = '<html>
  1036.                     <body>
  1037.                     <h3>Password to account changed!</h3>
  1038.                     <p>You or someone else changed password to your account on server <a href="'.$config['server']['url'].'"><b>'.htmlspecialchars($config['server']['serverName']).'</b></a>.</p>
  1039.                     <p>New password: <b>'.htmlspecialchars($org_pass).'</b></p>
  1040.                     </body>
  1041.                     </html>';
  1042.                     $mail = new PHPMailer();
  1043.                     if ($config['site']['smtp_enabled'])
  1044.                     {
  1045.                         $mail->IsSMTP();
  1046.                         $mail->Host = $config['site']['smtp_host'];
  1047.                         $mail->Port = (int)$config['site']['smtp_port'];
  1048.                         $mail->SMTPAuth = $config['site']['smtp_auth'];
  1049.                         $mail->Username = $config['site']['smtp_user'];
  1050.                         $mail->Password = $config['site']['smtp_pass'];
  1051.                     }
  1052.                     else
  1053.                         $mail->IsMail();
  1054.                     $mail->IsHTML(true);
  1055.                     $mail->From = $config['site']['mail_address'];
  1056.                     $mail->AddAddress($account_logged->getEMail());
  1057.                     $mail->Subject = $config['server']['serverName']." - Changed password";
  1058.                     $mail->Body = $mailBody;
  1059.                     if($mail->Send())
  1060.                         $main_content .= '<br /><small>Your new password were send on email address <b>'.htmlspecialchars($account_logged->getEMail()).'</b>.</small>';
  1061.                     else
  1062.                         $main_content .= '<br /><small>An error occorred while sending email with password!</small>';
  1063.                 }
  1064.                 $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>';
  1065.                 $_SESSION['password'] = $new_password;
  1066.             }
  1067.         }
  1068.     }
  1069.  
  1070. //############# CHANGE E-MAIL ###################
  1071.     if($action == "changeemail")
  1072.     {
  1073.         $account_email_new_time = $account_logged->getCustomField("email_new_time");
  1074.         if($account_email_new_time > 10) {$account_email_new = $account_logged->getCustomField("email_new"); }
  1075.         if($account_email_new_time < 10)
  1076.         {
  1077.             if($_POST['changeemailsave'] == 1)
  1078.             {
  1079.                 $account_email_new = trim($_POST['new_email']);
  1080.                 $post_password = trim($_POST['password']);
  1081.                 if(empty($account_email_new))
  1082.                 {
  1083.                     $change_email_errors[] = "Please enter your new email address.";
  1084.                 }
  1085.                 else
  1086.                 {
  1087.                     if(!check_mail($account_email_new))
  1088.                     {
  1089.                         $change_email_errors[] = "E-mail address is not correct.";
  1090.                     }
  1091.                 }
  1092.                 if(empty($post_password))
  1093.                 {
  1094.                     $change_email_errors[] = "Please enter password to your account.";
  1095.                 }
  1096.                 else
  1097.                 {
  1098.                     if(!$account_logged->isValidPassword($post_password))
  1099.                     {
  1100.                         $change_email_errors[] = "Wrong password to account.";
  1101.                     }
  1102.                 }
  1103.                 if(empty($change_email_errors))
  1104.                 {
  1105.                     $account_email_new_time = time() + $config['site']['email_days_to_change'] * 24 * 3600;
  1106.                     $account_logged->set("email_new", $account_email_new);
  1107.                     $account_logged->set("email_new_time", $account_email_new_time);
  1108.                     $account_logged->save();
  1109.                     $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 <b>'.htmlspecialchars($account_email_new).'</b>. The actual change will take place after <b>'.date("j F Y, G:i:s", $account_email_new_time).'</b>, 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>';
  1110.                 }
  1111.                 else
  1112.                 {
  1113.                     //show errors
  1114.                     $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/>';
  1115.                     foreach($change_email_errors as $change_email_error)
  1116.                     {
  1117.                         $main_content .= '<li>'.$change_email_error.'</li>';
  1118.                     }
  1119.                     $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/>';
  1120.                     //show form
  1121.                     $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. <b>For security reasons, the actual change will be finalised after a waiting period of '.$config['site']['email_days_to_change'].' days.</b><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="'.htmlspecialchars($_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>';
  1122.                 }
  1123.             }
  1124.             else
  1125.             {
  1126.                 $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. <b>For security reasons, the actual change will be finalised after a waiting period of '.$config['site']['email_days_to_change'].' days.</b><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="'.htmlspecialchars($_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>';
  1127.             }
  1128.         }
  1129.         else
  1130.         {
  1131.             if($account_email_new_time < time())
  1132.             {
  1133.                 if($_POST['changeemailsave'] == 1)
  1134.                 {
  1135.                     $account_logged->set("email_new", "");
  1136.                     $account_logged->set("email_new_time", 0);
  1137.                     $account_logged->setEmail($account_email_new);
  1138.                     $account_logged->save();
  1139.                     $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 <b>'.htmlspecialchars($account_logged->getEmail()).'</b> 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>';
  1140.                 }
  1141.                 else
  1142.                 {
  1143.                     $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 <b>'.htmlspecialchars($account_email_new).'</b> as your new email adress?</td></tr>          </table>        </div>  </table></div></td></tr><br /><table width="100%"><tr><td width="30">&nbsp;</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">&nbsp;</td></tr></table>';
  1144.                 }
  1145.             }
  1146.             else
  1147.             {
  1148.                 $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 <b>'.htmlspecialchars($account_email_new).'</b>.<br/>The actual change will take place on <b>'.date("j F Y, G:i:s", $account_email_new_time).'</b>.<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>';
  1149.             }
  1150.         }
  1151.         if($_POST['emailchangecancel'] == 1)
  1152.         {
  1153.             $account_logged->set("email_new", "");
  1154.             $account_logged->set("email_new_time", 0);
  1155.             $account_logged->save();
  1156.             $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>';
  1157.         }
  1158.     }
  1159.    
  1160. //########### CHANGE PUBLIC INFORMATION (about account owner) ######################
  1161.     if($action == "changeinfo") {
  1162.         $new_rlname = htmlspecialchars(trim($_POST['info_rlname']));
  1163.         $new_location = htmlspecialchars(trim($_POST['info_location']));
  1164.         if($_POST['changeinfosave'] == 1) {
  1165.         //save data from form
  1166.             $account_logged->set("rlname", $new_rlname);
  1167.             $account_logged->set("location", $new_location);
  1168.             $account_logged->save();
  1169.             $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>';
  1170.         }
  1171.         else
  1172.         {
  1173.         //show form
  1174.             $account_rlname = $account_logged->getCustomField("rlname");
  1175.             $account_location = $account_logged->getCustomField("location");
  1176.             $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>';
  1177.         }
  1178.     }
  1179.  
  1180. //############## GENERATE RECOVERY KEY ###########
  1181.     if($action == "registeraccount")
  1182.     {
  1183.         $reg_password = trim($_POST['reg_password']);
  1184.         $old_key = $account_logged->getCustomField("key");
  1185.         if($_POST['registeraccountsave'] == "1")
  1186.         {
  1187.             if($account_logged->isValidPassword($reg_password))
  1188.             {
  1189.                 if(empty($old_key))
  1190.                 {
  1191.                     $dontshowtableagain = 1;
  1192.                     $acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789';
  1193.                     $max = strlen($acceptedChars)-1;
  1194.                     $new_rec_key = NULL;
  1195.                     // 10 = number of chars in generated key
  1196.                     for($i=0; $i < 10; $i++) {
  1197.                         $cnum[$i] = $acceptedChars{mt_rand(0, $max)};
  1198.                         $new_rec_key .= $cnum[$i];
  1199.                     }
  1200.                     $account_logged->set("key", $new_rec_key);
  1201.                     $account_logged->save();
  1202.                     $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">&nbsp;&nbsp;&nbsp;<b>Recovery Key: '.htmlspecialchars($new_rec_key).'</b></font><br/><br/><br/><b>Important:</b><ul><li>Write down this recovery key carefully.</li><li>Store it at a safe place!</li>';
  1203.                     if($config['site']['send_emails'] && $config['site']['send_mail_when_generate_reckey'])
  1204.                     {
  1205.                         $mailBody = '<html>
  1206.                         <body>
  1207.                         <h3>New recovery key!</h3>
  1208.                         <p>You or someone else generated recovery key to your account on server <a href="'.$config['server']['url'].'"><b>'.htmlspecialchars($config['server']['serverName']).'</b></a>.</p>
  1209.                         <p>Recovery key: <b>'.htmlspecialchars($new_rec_key).'</b></p>
  1210.                         </body>
  1211.                         </html>';
  1212.                         $mail = new PHPMailer();
  1213.                         if ($config['site']['smtp_enabled'])
  1214.                         {
  1215.                             $mail->IsSMTP();
  1216.                             $mail->Host = $config['site']['smtp_host'];
  1217.                             $mail->Port = (int)$config['site']['smtp_port'];
  1218.                             $mail->SMTPAuth = $config['site']['smtp_auth'];
  1219.                             $mail->Username = $config['site']['smtp_user'];
  1220.                             $mail->Password = $config['site']['smtp_pass'];
  1221.                         }
  1222.                         else
  1223.                             $mail->IsMail();
  1224.                         $mail->IsHTML(true);
  1225.                         $mail->From = $config['site']['mail_address'];
  1226.                         $mail->AddAddress($account_logged->getEMail());
  1227.                         $mail->Subject = $config['server']['serverName']." - recovery key";
  1228.                         $mail->Body = $mailBody;
  1229.                         if($mail->Send())
  1230.                             $main_content .= '<br /><small>Your recovery key were send on email address <b>'.htmlspecialchars($account_logged->getEMail()).'</b>.</small>';
  1231.                         else
  1232.                             $main_content .= '<br /><small>An error occorred while sending email with recovery key! You will not receive e-mail with this key.</small>';
  1233.                     }
  1234.                     $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>';
  1235.                 }
  1236.                 else
  1237.                     $reg_errors[] = 'Your account is already registred.';
  1238.             }
  1239.             else
  1240.                 $reg_errors[] = 'Wrong password to account.';
  1241.         }
  1242.         if($dontshowtableagain != 1)
  1243.         {
  1244.             //show errors if not empty
  1245.             if(!empty($reg_errors))
  1246.             {
  1247.                 $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/>';
  1248.                 foreach($reg_errors as $reg_error)
  1249.                     $main_content .= '<li>'.$reg_error;
  1250.                 $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/>';
  1251.             }
  1252.             //show form
  1253.             $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>';
  1254.         }
  1255.     }
  1256.  
  1257. //############## GENERATE NEW RECOVERY KEY ###########
  1258.     if($action == "newreckey")
  1259.     {
  1260.         $reg_password = trim($_POST['reg_password']);
  1261.         $reckey = $account_logged->getCustomField("key");
  1262.         if((!$config['site']['generate_new_reckey'] || !$config['site']['send_emails']) || empty($reckey))
  1263.             $main_content .= 'You cant get new rec key';
  1264.         else
  1265.         {
  1266.             $points = $account_logged->getCustomField('vip_time');
  1267.             if($_POST['registeraccountsave'] == "1")
  1268.             {
  1269.                 if($account_logged->isValidPassword($reg_password))
  1270.                 {
  1271.                     if($points >= $config['site']['generate_new_reckey_price'])
  1272.                     {
  1273.                             $dontshowtableagain = 1;
  1274.                             $acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789';
  1275.                             $max = strlen($acceptedChars)-1;
  1276.                             $new_rec_key = NULL;
  1277.                             // 10 = number of chars in generated key
  1278.                             for($i=0; $i < 10; $i++) {
  1279.                                 $cnum[$i] = $acceptedChars{mt_rand(0, $max)};
  1280.                                 $new_rec_key .= $cnum[$i];
  1281.                             }
  1282.                             $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>';
  1283.                                 $mailBody = '<html>
  1284.                                 <body>
  1285.                                 <h3>New recovery key!</h3>
  1286.                                 <p>You or someone else generated recovery key to your account on server <a href="'.$config['server']['url'].'"><b>'.htmlspecialchars($config['server']['serverName']).'</b></a>.</p>
  1287.                                 <p>Recovery key: <b>'.htmlspecialchars($new_rec_key).'</b></p>
  1288.                                 </body>
  1289.                                 </html>';
  1290.                                 $mail = new PHPMailer();
  1291.                                 if ($config['site']['smtp_enabled'])
  1292.                                 {
  1293.                                     $mail->IsSMTP();
  1294.                                     $mail->Host = $config['site']['smtp_host'];
  1295.                                     $mail->Port = (int)$config['site']['smtp_port'];
  1296.                                     $mail->SMTPAuth = $config['site']['smtp_auth'];
  1297.                                     $mail->Username = $config['site']['smtp_user'];
  1298.                                     $mail->Password = $config['site']['smtp_pass'];
  1299.                                 }
  1300.                                 else
  1301.                                     $mail->IsMail();
  1302.                                 $mail->IsHTML(true);
  1303.                                 $mail->From = $config['site']['mail_address'];
  1304.                                 $mail->AddAddress($account_logged->getEMail());
  1305.                                 $mail->Subject = $config['server']['serverName']." - new recovery key";
  1306.                                 $mail->Body = $mailBody;
  1307.                                 if($mail->Send())
  1308.                                 {
  1309.                                     $account_logged->set("key", $new_rec_key);
  1310.                                     $account_logged->set("vip_time", $account_logged->get("vip_time")-$config['site']['generate_new_reckey_price']);
  1311.                                     $account_logged->save();
  1312.                                     $main_content .= '<br />Your recovery key were send on email address <b>'.htmlspecialchars($account_logged->getEMail()).'</b> for '.$config['site']['generate_new_reckey_price'].' premium points.';
  1313.                                 }
  1314.                                 else
  1315.                                     $main_content .= '<br />An error occorred while sending email ( <b>'.htmlspecialchars($account_logged->getEMail()).'</b> ) with recovery key! Recovery key not changed. Try again.';
  1316.                             $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>';
  1317.                     }
  1318.                     else
  1319.                         $reg_errors[] = 'You need '.$config['site']['generate_new_reckey_price'].' premium points to generate new recovery key. You have <b>'.$points.'<b> premium points.';
  1320.                 }
  1321.                 else
  1322.                     $reg_errors[] = 'Wrong password to account.';
  1323.             }
  1324.             if($dontshowtableagain != 1)
  1325.             {
  1326.                 //show errors if not empty
  1327.                 if(!empty($reg_errors))
  1328.                 {
  1329.                     $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/>';
  1330.                     foreach($reg_errors as $reg_error)
  1331.                         $main_content .= '<li>'.$reg_error.'</li>';
  1332.                     $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/>';
  1333.                 }
  1334.                 //show form
  1335.                 $main_content .= 'To generate NEW recovery key for your account please enter your password.<br/><font color="red"><b>New recovery key cost '.$config['site']['generate_new_reckey_price'].' Premium Points.</font> You have '.$points.' premium points. You will receive e-mail with this recovery key.</b><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>';
  1336.             }
  1337.         }
  1338.     }
  1339.  
  1340.    
  1341.    
  1342. //###### CHANGE CHARACTER COMMENT ######
  1343.     if($action == "changecomment")
  1344.     {
  1345.         $player_name = $_REQUEST['name'];
  1346.         $signature = htmlspecialchars(substr(trim($_POST['signature']),0,2000));
  1347.         $new_comment = htmlspecialchars(substr(trim($_POST['comment']),0,2000));
  1348.         $new_hideacc = (int) $_POST['accountvisible'];
  1349.         if(check_name($player_name))
  1350.         {
  1351.             $player = new Player();
  1352.             $player->find($player_name);
  1353.             if($player->isLoaded())
  1354.             {
  1355.                 $player_account = $player->getAccount();
  1356.                 if($account_logged->getId() == $player_account->getId())
  1357.                 {
  1358.                     if($_POST['changecommentsave'] == 1)
  1359.                     {
  1360.                         $player->set("hide_char", $new_hideacc);
  1361.                         $player->set("comment", $new_comment);
  1362.                         $player->set("signature", $signature);
  1363.                         $player->save();
  1364.                         $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>';
  1365.                     }
  1366.                     else
  1367.                     {
  1368.                         $main_content .= '
  1369.                             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/>
  1370.                             <form action="?subtopic=accountmanagement&action=changecomment" method="post" >
  1371.                                 <div class="TableContainer" >  
  1372.                                     <table class="Table5" cellpadding="0" cellspacing="0" >    
  1373.                                         <div class="CaptionContainer" >      
  1374.                                             <div class="CaptionInnerContainer" >        
  1375.                                                 span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        
  1376.                                                 <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        
  1377.                                                 <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        
  1378.                                                 <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        
  1379.                                                 <div class="Text" >Edit Character Information</div>        
  1380.                                                 <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        
  1381.                                                 <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        
  1382.                                                 <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      
  1383.                                                 <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      
  1384.                                             </div>    
  1385.                                         </div>    
  1386.                                         <tr>      
  1387.                                             <td>        
  1388.                                                 <div class="InnerTableContainer" >          
  1389.                                                     <table style="width:100%;" >
  1390.                                                         <tr>
  1391.                                                             <td>
  1392.                                                                 <div class="TableShadowContainerRightTop" >  
  1393.                                                                     <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  1394.                                                                 </div>
  1395.                                                                 <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >  
  1396.                                                                     <div class="TableContentContainer" >    
  1397.                                                                         <table class="TableContent" width="100%" >
  1398.                                                                             <tr>
  1399.                                                                                 <td class="LabelV" >Name:</td>
  1400.                                                                                 <td style="width:80%;" >'.htmlspecialchars($player_name).'</td>
  1401.                                                                             </tr>
  1402.                                                                             <tr>
  1403.                                                                                 <td class="LabelV" >Hide Account:</td><td>';
  1404.                                                                         if($player->getCustomField("hide_char") == 1)
  1405.                                                                         {
  1406.                                                                             $main_content .= '
  1407.                                                                                 <input type="checkbox" name="accountvisible"  value="1" checked="checked">';
  1408.                                                                         }
  1409.                                                                         else
  1410.                                                                         {
  1411.                                                                             $main_content .= '
  1412.                                                                                 <input type="checkbox" name="accountvisible"  value="1" >';
  1413.                                                                         }
  1414.                                                                                 $main_content .= '
  1415.                                                                                     check to hide your account information
  1416.                                                                                 </td>
  1417.                                                                             </tr>    
  1418.                                                                         </table>  
  1419.                                                                     </div>
  1420.                                                                 </div>
  1421.                                                                 <div class="TableShadowContainer" >  
  1422.                                                                     <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >    
  1423.                                                                         <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>
  1424.                                                                 </div>
  1425.                                                             </td>
  1426.                                                         </tr>
  1427.                                                         <tr>
  1428.                                                             <td>
  1429.                                                                 <div class="TableShadowContainerRightTop" >  
  1430.                                                                     <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div>
  1431.                                                                 </div>
  1432.                                                                 <div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >  
  1433.                                                                     <div class="TableContentContainer" >    
  1434.                                                                         <table class="TableContent" width="100%" >
  1435.                                                                             <tr>
  1436.                                                                                 <td class="LabelV" ><span >Comment:</span></td>
  1437.                                                                                 <td style="width:80%;" >
  1438.                                                                                     <textarea name="comment" rows="10" cols="50" wrap="virtual" >'.$player->getCustomField("comment").'</textarea><br>
  1439.                                                                                 </td>
  1440.                                                                             </tr>
  1441.                                                                             <tr>
  1442.                                                                                 <td class="LabelV" style="white-space:normal;" ><span >Forum Signature:</span></td>
  1443.                                                                                 <td style="width:80%;" >
  1444.                                                                                     <textarea name="signature" rows="4" cols="50" wrap="virtual" >'.$player->getCustomField("signature").'</textarea>
  1445.                                                                                 </td>
  1446.                                                                             </tr>    
  1447.                                                                         </table>  
  1448.                                                                     </div>
  1449.                                                                 </div>
  1450.                                                                 <div class="TableShadowContainer" >  
  1451.                                                                     <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
  1452.                                                                         <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>
  1453.                                                                         <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>
  1454.                                                                     </div>
  1455.                                                                 </div>
  1456.                                                             </td>
  1457.                                                         </tr>
  1458.                                                     </td>
  1459.                                                 </tr>          
  1460.                                             </table>        
  1461.                                         </div>  
  1462.                                     </table>
  1463.                                 </div>
  1464.                             </td>
  1465.                         </tr><br/>
  1466.                         <table style="width:100%" >
  1467.                             <tr align="center" >
  1468.                                 <td>
  1469.                                     <table border="0" cellspacing="0" cellpadding="0" >
  1470.                                         <tr>
  1471.                                             <td style="border:0px;" >
  1472.                                                 <input type="hidden" name="name" value="'.htmlspecialchars($player->getName()).'">
  1473.                                                 <input type="hidden" name="changecommentsave" value="1">
  1474.                                                 <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>
  1475.                                                 <input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" >
  1476.                                             </div>
  1477.                                         </div>
  1478.                                     </td>
  1479.                                 <tr>
  1480.                             </form>
  1481.                         </table>
  1482.                     </td>
  1483.                     <td>
  1484.                         <table border="0" cellspacing="0" cellpadding="0" >
  1485.                             <form action="?subtopic=accountmanagement" method="post" >
  1486.                                 <tr>
  1487.                                     <td style="border:0px;" >
  1488.                                         <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>
  1489.                                         <input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div>
  1490.                                     </td>
  1491.                                 </tr>
  1492.                                
  1493.                             </form>
  1494.                         </table>
  1495.                     </td>
  1496.                 </tr>
  1497.             </table>';
  1498.                     }
  1499.                 }
  1500.                 else
  1501.                 {
  1502.                     $main_content .= "Error. Character <b>".htmlspecialchars($player_name)."</b> is not on your account.";
  1503.                 }
  1504.             }
  1505.             else
  1506.             {
  1507.                 $main_content .= "Error. Character with this name doesn't exist.";
  1508.             }
  1509.         }
  1510.         else
  1511.         {
  1512.             $main_content .= "Error. Name contain illegal characters.";
  1513.         }
  1514.     }
  1515.  
  1516. //### DELETE character from account ###
  1517.     if($action == "deletecharacter")
  1518.     {
  1519.         $player_name = trim($_POST['delete_name']);
  1520.         $password_verify = trim($_POST['delete_password']);
  1521.         if($_POST['deletecharactersave'] == 1)
  1522.         {
  1523.             if(!empty($player_name) && !empty($password_verify))
  1524.             {
  1525.                 if(check_name($player_name))
  1526.                 {
  1527.                     $player = new Player();
  1528.                     $player->find($player_name);
  1529.                     if($player->isLoaded())
  1530.                     {
  1531.                         $player_account = $player->getAccount();
  1532.                         if($account_logged->getId() == $player_account->getId())
  1533.                         {
  1534.                             if($account_logged->isValidPassword($password_verify))
  1535.                             {
  1536.                                 if(!$player->isOnline())
  1537.                                 {
  1538.                                     //dont show table "delete character" again
  1539.                                     $dontshowtableagain = 1;
  1540.                                     //delete player
  1541.                                     $player->set('deleted', 1);
  1542.                                     $player->save();
  1543.                                     $main_content .= '
  1544.                                         <div class="TableContainer" >  
  1545.                                             <table class="Table1" cellpadding="0" cellspacing="0" >    
  1546.                                                 <div class="CaptionContainer" >      
  1547.                                                     <div class="CaptionInnerContainer" >        
  1548.                                                         <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        
  1549.                                                         <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        
  1550.                                                         <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        
  1551.                                                         <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        
  1552.                                                         <div class="Text" >Character Deleted</div>        
  1553.                                                         <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        
  1554.                                                         <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        
  1555.                                                         <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        
  1556.                                                         <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      
  1557.                                                     </div>    
  1558.                                                 </div>    
  1559.                                                 <tr>      
  1560.                                                     <td>        
  1561.                                                         <div class="InnerTableContainer" >          
  1562.                                                             <table style="width:100%;" >
  1563.                                                                 <tr>
  1564.                                                                     <td>The character <b>'.htmlspecialchars($player_name).'</b> has been deleted.</td>
  1565.                                                                 </tr>          
  1566.                                                             </table>        
  1567.                                                         </div>  
  1568.                                                     </table>
  1569.                                                 </div>
  1570.                                             </td>
  1571.                                         </tr>
  1572.                                         <br>
  1573.                                         <center>
  1574.                                             <table border="0" cellspacing="0" cellpadding="0" >
  1575.                                                 <form action="?subtopic=accountmanagement" method="post" >
  1576.                                                     <tr>
  1577.                                                         <td style="border:0px;" >
  1578.                                                             <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  1579.                                                                 <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
  1580.                                                                     <div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  1581.                                                                     <input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" >
  1582.                                                                 </div>
  1583.                                                             </div>
  1584.                                                         </td>
  1585.                                                     </tr>
  1586.                                                 </form>
  1587.                                             </table>
  1588.                                         </center>';
  1589.                                 }
  1590.                                 else
  1591.                                     $delete_errors[] = 'This character is online.';
  1592.                             }
  1593.                             else
  1594.                             {
  1595.                                 $delete_errors[] = 'Wrong password to account.';
  1596.                             }
  1597.                         }
  1598.                         else
  1599.                         {
  1600.                             $delete_errors[] = 'Character <b>'.htmlspecialchars($player_name).'</b> is not on your account.';
  1601.                         }
  1602.                     }
  1603.                     else
  1604.                     {
  1605.                         $delete_errors[] = 'Character with this name doesn\'t exist.';
  1606.                     }
  1607.                 }
  1608.                 else
  1609.                 {
  1610.                     $delete_errors[] = 'Name contain illegal characters.';
  1611.                 }
  1612.             }
  1613.             else
  1614.             {
  1615.             $delete_errors[] = 'Character name or/and password is empty. Please fill in form.';
  1616.             }
  1617.         }
  1618.         if($dontshowtableagain != 1)
  1619.         {
  1620.             if(!empty($delete_errors))
  1621.             {
  1622.                 $main_content .= '
  1623.                     <div class="SmallBox" >  
  1624.                         <div class="MessageContainer" >    
  1625.                             <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    
  1626.                             <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    
  1627.                             <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    
  1628.                             <div class="ErrorMessage" >      
  1629.                                 <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      
  1630.                                 <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      
  1631.                                 <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div>
  1632.                                 <b>The Following Errors Have Occurred:</b><br/>';
  1633.                 foreach($delete_errors as $delete_error)
  1634.                 {
  1635.                     $main_content .= '<li>'.$delete_error;
  1636.                 }
  1637.                 $main_content .= '
  1638.                     </div>    
  1639.                     <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    
  1640.                     <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    
  1641.                     <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  
  1642.                 </div>
  1643.             </div><br/>';
  1644.             }
  1645.             $main_content .= 'To delete this character enter your password and click on "Submit". You can undelete the character within the first 2 months (60 days) after the deletion. After this time the character is deleted for good and cannot be restored anymore!.<br/><br/>
  1646.                 <form action="?subtopic=accountmanagement&action=deletecharacter" method="post" >
  1647.                     <input type="hidden" name="deletecharactersave" value="1">
  1648.                     <div class="TableContainer" >  
  1649.                         <table class="Table1" cellpadding="0" cellspacing="0" >    
  1650.                             <div class="CaptionContainer" >      
  1651.                                 <div class="CaptionInnerContainer" >        
  1652.                                     <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        
  1653.                                     <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        
  1654.                                     <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        
  1655.                                     <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        
  1656.                                     <div class="Text" >Delete Character</div>        
  1657.                                     <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        
  1658.                                     <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        
  1659.                                     <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        
  1660.                                     <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      
  1661.                                 </div>    
  1662.                             </div>    
  1663.                             <tr>    
  1664.                                 <td>        
  1665.                                     <div class="InnerTableContainer" >          
  1666.                                         <table style="width:100%;" >
  1667.                                             <tr>
  1668.                                                 <td class="LabelV" ><span >Character Name:</td>
  1669.                                                 <td style="width:90%;" >
  1670.                                                     <input type="hidden" name="delete_name" value="'.$_GET['name'].'" size="30" maxlength="29" >
  1671.                                                     <p>'.$_GET['name'].'</p>
  1672.                                                 </td>
  1673.                                             </tr>
  1674.                                             <tr>
  1675.                                                 <td class="LabelV" ><span >Password:</td>
  1676.                                                 <td>
  1677.                                                     <input type="password" name="delete_password" size="30" maxlength="29" >
  1678.                                                 </td>
  1679.                                             </tr>          
  1680.                                         </table>        
  1681.                                     </div>  
  1682.                                 </table>
  1683.                             </div>
  1684.                         </td>
  1685.                     </tr><br/>
  1686.                     <table style="width:100%" >
  1687.                         <tr align="center" >
  1688.                             <td>
  1689.                                 <table border="0" cellspacing="0" cellpadding="0" >
  1690.                                     <tr>
  1691.                                         <td style="border:0px;" >
  1692.                                             <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  1693.                                                 <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
  1694.                                                     <div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  1695.                                                     <input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" >
  1696.                                                 </div>
  1697.                                             </div>
  1698.                                         </td>
  1699.                                         <tr>
  1700.                                     </form>
  1701.                                 </table>
  1702.                             </td>
  1703.                             <td>
  1704.                                 <table border="0" cellspacing="0" cellpadding="0" >
  1705.                                     <form action="?subtopic=accountmanagement" method="post" >
  1706.                                         <tr>
  1707.                                             <td style="border:0px;" >
  1708.                                                 <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
  1709.                                                     <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
  1710.                                                         <div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
  1711.                                                         <input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" >
  1712.                                                     </div>
  1713.                                                 </div>
  1714.                                             </td>
  1715.                                         </tr>
  1716.                                     </form>
  1717.                                 </table>
  1718.                             </td>
  1719.                         </tr>
  1720.                     </table>';
  1721.         }
  1722.     }
  1723.  
  1724.    
  1725. //### UNDELETE character from account ###
  1726.     if($action == "undelete")
  1727.     {
  1728.         $player_name = trim($_GET['name']);
  1729.         if(!empty($player_name))
  1730.         {
  1731.             if(check_name($player_name))
  1732.             {
  1733.                 $player = new Player();
  1734.                 $player->find($player_name);
  1735.                 if($player->isLoaded())
  1736.                 {
  1737.                     $player_account = $player->getAccount();
  1738.                     if($account_logged->getId() == $player_account->getId())
  1739.                     {
  1740.                         if(!$player->isOnline())
  1741.                         {
  1742.                             $player->set('deleted', 0);
  1743.                             $player->save();
  1744.                             $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 <b>'.htmlspecialchars($player_name).'</b> 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>';
  1745.                         }
  1746.                         else
  1747.                             $delete_errors[] = 'This character is online.';
  1748.                     }
  1749.                     else
  1750.                         $delete_errors[] = 'Character <b>'.htmlspecialchars($player_name).'</b> is not on your account.';
  1751.                 }
  1752.                 else
  1753.                     $delete_errors[] = 'Character with this name doesn\'t exist.';
  1754.             }
  1755.             else
  1756.                 $delete_errors[] = 'Name contain illegal characters.';
  1757.         }
  1758.     }  
  1759.  
  1760. //## CREATE CHARACTER on account ###
  1761.     if($action == "createcharacter")
  1762.     {
  1763.         if(count($config['site']['worlds']) > 1)
  1764.         {
  1765.             if(isset($_REQUEST['world']))
  1766.                 $world_id = (int) $_REQUEST['world'];
  1767.         }
  1768.         else
  1769.             $world_id = 0;
  1770.         if(!isset($world_id))
  1771.         {
  1772.             $main_content .= 'Before you can create character you must select world: ';
  1773.             foreach($config['site']['worlds'] as $id => $world_n)
  1774.                 $main_content .= '<br /><a href="?subtopic=accountmanagement&action=createcharacter&world='.$id.'">- '.htmlspecialchars($world_n).'</a>';
  1775.             $main_content .= '<br /><h3><a href="?subtopic=accountmanagement">BACK</a></h3>';
  1776.         }
  1777.         else
  1778.         {
  1779.             $main_content .= '<script type="text/javascript">
  1780.             var nameHttp;
  1781.  
  1782. function checkName()
  1783. {
  1784.         if(document.getElementById("newcharname").value=="")
  1785.         {
  1786.             document.getElementById("name_check").innerHTML = \'<b><font color="red">Please enter new character name.</font></b>\';
  1787.             return;
  1788.         }
  1789.         nameHttp=GetXmlHttpObject();
  1790.         if (nameHttp==null)
  1791.         {
  1792.             return;
  1793.         }
  1794.         var newcharname = document.getElementById("newcharname").value;
  1795.         var url="?subtopic=ajax_check_name&name=" + newcharname + "&uid="+Math.random();
  1796.         nameHttp.onreadystatechange=NameStateChanged;
  1797.         nameHttp.open("GET",url,true);
  1798.         nameHttp.send(null);
  1799. }
  1800.  
  1801. function NameStateChanged()
  1802. {
  1803.         if (nameHttp.readyState==4)
  1804.         {
  1805.             document.getElementById("name_check").innerHTML=nameHttp.responseText;
  1806.         }
  1807. }
  1808. </script>';
  1809.             $newchar_name = ucwords(strtolower(trim($_POST['newcharname'])));
  1810.             $newchar_sex = $_POST['newcharsex'];
  1811.             $newchar_vocation = $_POST['newcharvocation'];
  1812.             $newchar_town = $_POST['newchartown'];
  1813.             if($_POST['savecharacter'] != 1)
  1814.             {
  1815.                 $main_content .= 'Please choose a name';
  1816.                 if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1817.                     $main_content .= ', vocation';
  1818.                 $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" >'.htmlspecialchars($config['server']['serverName']).' Rules</a>, or your character might get deleted or name locked.';
  1819.                 if($account_logged->getPlayersList()->count() >= $config['site']['max_players_per_account'])
  1820.                     $main_content .= '<b><font color="red"> You have maximum number of characters per account on your account. Delete one before you make new.</font></b>';
  1821.                 $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="'.htmlspecialchars($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>';
  1822.                 $main_content .= '<input type="radio" name="newcharsex" value="1" ';
  1823.                 if($newchar_sex == 1)
  1824.                     $main_content .= 'checked="checked" ';
  1825.                 $main_content .= '>male<br/>';
  1826.                 $main_content .= '<input type="radio" name="newcharsex" value="0" ';
  1827.                 if($newchar_sex == "0")
  1828.                     $main_content .= 'checked="checked" ';
  1829.                 $main_content .= '>female<br/></td></tr></table></div></div></table></div>';
  1830.                 if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  1831.                     $main_content .= '<div class="InnerTableContainer" >          <table style="width:100%;" ><tr>';
  1832.                 if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1833.                 {
  1834.                     $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your vocation:</b></td><td><table class="TableContent" width="100%" >';
  1835.                     foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
  1836.                     {
  1837.                         $main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';
  1838.                         if($newchar_vocation == $char_vocation_key)
  1839.                             $main_content .= 'checked="checked" ';
  1840.                         $main_content .= '>'.htmlspecialchars($vocation_name[0][$char_vocation_key]).'</td></tr>';
  1841.                     }
  1842.                     $main_content .= '</table></table></td>';
  1843.                 }
  1844.                 if(count($config['site']['newchar_towns'][$world_id]) > 1)
  1845.                 {
  1846.                     $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your city:</b></td><td><table class="TableContent" width="100%" >';
  1847.                     foreach($config['site']['newchar_towns'][$world_id] as $town_id)
  1848.                     {
  1849.                         $main_content .= '<tr><td><input type="radio" name="newchartown" value="'.$town_id.'" ';
  1850.                         if($newchar_town == $town_id)
  1851.                             $main_content .= 'checked="checked" ';
  1852.                         $main_content .= '>'.htmlspecialchars($towns_list[$world_id][$town_id]).'</td></tr>';
  1853.                     }
  1854.                     $main_content .= '</table></table></td>';
  1855.                 }
  1856.                 if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  1857.                     $main_content .= '</tr></table></div>';
  1858.                 $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>';
  1859.             }
  1860.             else
  1861.             {  
  1862.                 if(empty($newchar_name))
  1863.                     $newchar_errors[] = 'Please enter a name for your character!';
  1864.                 if(empty($newchar_sex) && $newchar_sex != "0")
  1865.                     $newchar_errors[] = 'Please select the sex for your character!';
  1866.                 if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1867.                 {
  1868.                     if(empty($newchar_vocation))
  1869.                         $newchar_errors[] = 'Please select a vocation for your character.';
  1870.                 }
  1871.                 else
  1872.                     $newchar_vocation = $config['site']['newchar_vocations'][$world_id][0];
  1873.                 if(count($config['site']['newchar_towns'][$world_id]) > 1)
  1874.                 {
  1875.                     if(empty($newchar_town))
  1876.                         $newchar_errors[] = 'Please select a town for your character.';
  1877.                 }
  1878.                 else
  1879.                     $newchar_town = $config['site']['newchar_towns'][$world_id][0];
  1880.                 if(empty($newchar_errors))
  1881.                 {
  1882.                     if(!check_name_new_char($newchar_name))
  1883.                         $newchar_errors[] = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.';
  1884.                     if($newchar_sex != 1 && $newchar_sex != "0")
  1885.                         $newchar_errors[] = 'Sex must be equal <b>0 (female)</b> or <b>1 (male)</b>.';
  1886.                     if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1887.                     {
  1888.                         $newchar_vocation_check = FALSE;
  1889.                         foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
  1890.                             if($newchar_vocation == $char_vocation_key)
  1891.                                 $newchar_vocation_check = TRUE;
  1892.                         if(!$newchar_vocation_check)
  1893.                             $newchar_errors[] = 'Unknown vocation. Please fill in form again.';
  1894.                     }
  1895.                     else
  1896.                         $newchar_vocation = 0;
  1897.                 }
  1898.                 if(empty($newchar_errors))
  1899.                 {
  1900.                     $check_name_in_database = new Player();
  1901.                     $check_name_in_database->find($newchar_name);
  1902.                     if($check_name_in_database->isLoaded())
  1903.                         $newchar_errors[] .= 'This name is already used. Please choose another name!';
  1904.                     $number_of_players_on_account = $account_logged->getPlayersList()->count();
  1905.                     if($number_of_players_on_account >= $config['site']['max_players_per_account'])
  1906.                         $newchar_errors[] .= 'You have too many characters on your account <b>('.$number_of_players_on_account.'/'.$config['site']['max_players_per_account'].')</b>!';
  1907.                 }
  1908.                 if(empty($newchar_errors))
  1909.                 {
  1910.                     $char_to_copy_name = $config['site']['newchar_vocations'][$world_id][$newchar_vocation];
  1911.                     $char_to_copy = new Player();
  1912.                     $char_to_copy->find($char_to_copy_name);
  1913.                     if(!$char_to_copy->isLoaded())
  1914.                         $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 <b>'.htmlspecialchars($char_to_copy_name).'</b> doesn\'t exist.';
  1915.                 }
  1916.                 if(empty($newchar_errors))
  1917.                 {
  1918.                     // load items and skills of player before we change ID
  1919.                     $char_to_copy->getItems()->load();
  1920.                     $char_to_copy->loadSkills();
  1921.                    
  1922.                     if($newchar_sex == "0")
  1923.                         $char_to_copy->setLookType(136);
  1924.                     $char_to_copy->setID(null); // save as new character
  1925.                     $char_to_copy->setLastIP(0);
  1926.                     $char_to_copy->setLastLogin(0);
  1927.                     $char_to_copy->setLastLogout(0);
  1928.                     $char_to_copy->setName($newchar_name);
  1929.                     $char_to_copy->setAccount($account_logged);
  1930.                     $char_to_copy->setSex($newchar_sex);
  1931.                     $char_to_copy->setTown($newchar_town);
  1932.                     $char_to_copy->setPosX(0);
  1933.                     $char_to_copy->setPosY(0);
  1934.                     $char_to_copy->setPosZ(0);
  1935.                     $char_to_copy->setBalance(0);                  
  1936.                     $char_to_copy->setWorldID((int) $world_id);
  1937.                     $char_to_copy->setCreateIP(Visitor::getIP());
  1938.                     $char_to_copy->setCreateDate(time());
  1939.                     $char_to_copy->setSave(); // make character saveable
  1940.                     $char_to_copy->save(); // now it will load 'id' of new player
  1941.                     if($char_to_copy->isLoaded())
  1942.                     {
  1943.                         $char_to_copy->saveItems();
  1944.                         $char_to_copy->saveSkills();
  1945.                         $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 <b>'.htmlspecialchars($newchar_name).'</b> has been created.<br/>Please select the outfit when you log in for the first time.<br/><br/><b>See you on '.$config['server']['serverName'].'!</b></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>';
  1946.                     }
  1947.                     else
  1948.                     {
  1949.                         echo "Error. Can\'t create character. Probably problem with database. Try again or contact with admin.";
  1950.                         exit;
  1951.                     }
  1952.                 }
  1953.                 else
  1954.                 {
  1955.                     $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/>';
  1956.                     foreach($newchar_errors as $newchar_error)
  1957.                         $main_content .= '<li>'.$newchar_error;
  1958.                     $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/>';
  1959.                     $main_content .= 'Please choose a name';
  1960.                     if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1961.                         $main_content .= ', vocation';
  1962.                     $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>';
  1963.                     $main_content .= '<input type="radio" name="newcharsex" value="1" ';
  1964.                     if($newchar_sex == 1)
  1965.                         $main_content .= 'checked="checked" ';
  1966.                     $main_content .= '>male<br/>';
  1967.                     $main_content .= '<input type="radio" name="newcharsex" value="0" ';
  1968.                     if($newchar_sex == "0")
  1969.                         $main_content .= 'checked="checked" ';
  1970.                     $main_content .= '>female<br/></td></tr></table></div></div></table></div>';
  1971.                     if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  1972.                         $main_content .= '<div class="InnerTableContainer" >          <table style="width:100%;" ><tr>';
  1973.                     if(count($config['site']['newchar_vocations'][$world_id]) > 1)
  1974.                     {
  1975.                         $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your vocation:</b></td><td><table class="TableContent" width="100%" >';
  1976.                         foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)
  1977.                         {
  1978.                             $main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.htmlspecialchars($char_vocation_key).'" ';
  1979.                             if($newchar_vocation == $char_vocation_key)
  1980.                                 $main_content .= 'checked="checked" ';
  1981.                             $main_content .= '>'.htmlspecialchars($vocation_name[0][$char_vocation_key]).'</td></tr>';
  1982.                         }
  1983.                         $main_content .= '</table></table></td>';
  1984.                     }
  1985.                     if(count($config['site']['newchar_towns'][$world_id]) > 1)
  1986.                     {
  1987.                         $main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your city:</b></td><td><table class="TableContent" width="100%" >';
  1988.                         foreach($config['site']['newchar_towns'][$world_id] as $town_id)
  1989.                         {
  1990.                             $main_content .= '<tr><td><input type="radio" name="newchartown" value="'.htmlspecialchars($town_id).'" ';
  1991.                             if($newchar_town == $town_id)
  1992.                                 $main_content .= 'checked="checked" ';
  1993.                             $main_content .= '>'.htmlspecialchars($towns_list[$world_id][$town_id]).'</td></tr>';
  1994.                         }
  1995.                         $main_content .= '</table></table></td>';
  1996.                     }
  1997.                     if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)
  1998.                         $main_content .= '</tr></table></div>';
  1999.                     $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>';
  2000.                 }
  2001.             }
  2002.         }
  2003.     }
  2004. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement