Advertisement
Guest User

Untitled

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