Ir para conteúdo
  • Cadastre-se

Posts Recomendados

.Qual servidor ou website você utiliza como base? 

8.60 tfs 0.4 ubuntu

Qual o motivo deste tópico? 

Problemas no site

Está surgindo algum erro? Se sim coloque-o aqui. 

Citar

O site mostra player online e servidor offline.

Já tentei de várias formas, nada funciona!

Spoiler

layout.php


<?php

$playersOnline = $SQL->query("SELECT COUNT(`players`.`online`) AS allOnline  FROM `players` WHERE `online` > '0'")->fetch();

$number_of_players_online = $playersOnline['allOnline'];



function anti_injection($sql){

// remove palavras que contenham sintaxe sql

$sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$sql);

$sql = trim($sql);//limpa espa os vazio

$sql = strip_tags($sql);//tira tags html e php

$sql = addslashes($sql);//Adiciona barras invertidas a uma string

return $sql;

}

?>

<html>

<head>

<meta charset="utf-8">

<title><?PHP echo $title ?></title>

<meta name="description" content="Wono Battle é um servidor alternativo de tibia MMORPG 2D criado pela comunidade fã de naruto.">

<meta name="author" content="Diarmaint">

<meta http-equiv="content-language" content="en">

<meta name="keywords" content="nto, otserver, narutibia, tibia">

<!--ICON-->

<link rel="shortcut icon" href="<?PHP echo $layout_name; ?>/images/general/favicon.ico" type="image/x-icon">

<link rel="icon" href="<?PHP echo $layout_name; ?>/images/general/favicon.ico" type="image/x-icon">

<!--CSS'S-->

<link href="<?PHP echo $layout_name; ?>/css/basic_d.css" rel="stylesheet" type="text/css">

<link href="<?PHP echo $layout_name; ?>/css/news.css" rel="stylesheet" type="text/css">

<!--JS--> 

<script id="twitter-wjs" src="<?PHP echo $layout_name; ?>/js/widgets.js"></script>

<script id="facebook-jssdk" async src="<?PHP echo $layout_name; ?>/js/all.js"></script>

<script type="text/javascript" src="<?PHP echo $layout_name; ?>/js/jquery.js"></script>

<script type="text/javascript" src="<?PHP echo $layout_name; ?>/js/ajaxcip.js"></script>

<script type="text/javascript" src="<?PHP echo $layout_name; ?>/js/generic.js"></script>

<script type="text/javascript" src="<?PHP echo $layout_name; ?>/js/create_character.js"></script>

<script type="text/javascript">  

var loginStatus=0; 

loginStatus='<?PHP if($logged){ ?>true<?PHP }else{ ?>false<?PHP } ?>';  

var activeSubmenuItem='<?PHP echo $subtopic; ?>';  

var JS_DIR_IMAGES=0; 

JS_DIR_IMAGES='<?PHP echo $layout_name; ?>/images/';  

var JS_DIR_ACCOUNT=0; 

JS_DIR_ACCOUNT='';  

var g_FormName='';  

var g_FormField='';  

var g_Deactivated=false;

var FB_TryLogin = 0;

var FB_ForceReload = 0;

</script>

<script type="text/javascript">

  if(top.location != window.location) {

    top.location = self.location;

  }

</script>

<script type="text/javascript" src="<?PHP echo $layout_name; ?>/initialize.js"></script>



<link href="<?PHP echo $layout_name; ?>/css/facebook.css" rel="stylesheet" type="text/css">  

</head>



<body onBeforeUnLoad="SaveMenu();" onUnload="SaveMenu();" data-twttr-rendered="true">

<script type="text/javascript">

  window.fbAsyncInit = function() {

    FB.init({

      appId      : 497232093667125, // App ID

      status     : true,              // check login status

      cookie     : true,              // enable cookies to allow the server to access the session

      xfbml      : true               // parse XFBML

    });

    FB.Event.subscribe('auth.login', function() {

      var URLHelper = "?";

      if (window.location.search.replace("?", "").length > 0) {

        URLHelper = "&";

      }

      if (FB_TryLogin == 1) {

        window.location = window.location + URLHelper + "step=facebooktrylogin&wasreloaded=1";

      } else if (FB_TryLogin == 2) {

        window.location = window.location + URLHelper + "page=facebooktrylogin&wasreloaded=1";

      } else {

        window.location = window.location + URLHelper + "wasreloaded=1";

      }

    });

    FB.Event.subscribe('auth.logout', function(a_Response) {

      if (a_Response.status !== 'connected') {

        window.location.href=window.location.href;

      } else {

        /* nothing to do here*/

      }

    });

    FB.Event.subscribe('auth.statusChange', function(response) {

      if (FB_ForceReload == 1 && response.status == "connected") {

        var URLHelper = "?";

        if (window.location.search.replace("?", "").length > 0) {

          URLHelper = "&";

        }

        window.location = window.location + URLHelper + "step=facebooktrylogin&wasreloaded=1";

      }

    });

  };

  (function(d){

    var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];

    if (d.getElementById(id)) {return;}

    js = d.createElement('script'); js.id = id; js.async = true;

    js.src = "//connect.facebook.net/en_US/all.js";

    ref.parentNode.insertBefore(js, ref);

  }(document));

</script>

  <a name="top"></a>

  <div id="MainHelper1">

  	<div id="MainHelper2">

    	<div id="ArtworkHelper1">

        	<div id="ArtworkHelper2">

          		<div id="HeaderArtworkDiv" style="background-image:url(<?PHP echo $layout_name; ?>/images/header/background-artwork.jpg);"></div>

        	</div>

      	</div>

      	<div id="DeactivationContainer" onclick="DisableDeactivationContainer();"></div>



      	<div id="Bodycontainer">

      	<div id="ContentRow">

          	<div id="MenuColumn">

            	<div id="LeftArtwork">

              		<a href="/?subtopic=latestnews">

						<img id="TibiaLogoArtworkTop" src="<?PHP echo $layout_name; ?>/images/header/tibia-logo-artwork-top.png" alt="logoartwork">

					</a>

            	</div>

  				<?PHP include "loginbox.php"; ?>

				<div id="Menu">

					<div id="MenuTop" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/box-top.giif);"></div>

						<div id="news" class="menuitem">

							<span onclick="MenuItemAction('news')">

  								<div class="MenuButton" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/button-background.png);">

    								<div onmouseover="MouseOverMenuItem(this);" onmouseout="MouseOutMenuItem(this);"><div class="Button" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/button-background-over.png);"></div>

      								<span id="news_Lights" class="Lights">

        								<div class="light_lu" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

										<div class="light_ld" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

										<div class="light_ru" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

      								</span>

									<div id="news_Icon" class="Icon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-neews.gif);"></div>

									<div id="news_Label" class="Label" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/label-news.png);"></div>

									<div id="news_Extend" class="Extend" style="background-image: url(<?PHP echo $layout_name; ?>/images/general/minus.gif);"></div>

    							</div>

  							</div>

						</span>

						<div id="news_Submenu" class="Submenu">

							<a href="?subtopic=latestnews">

  								<div id="submenu_latestnews" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

    								<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

    								<div id="ActiveSubmenuItemIcon_latestnews" class="ActiveSubmenuItemIcon" style="background-image: url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

    								<div id="ActiveSubmenuItemLabel_latestnews" class="SubmenuitemLabel">Inicio</div>

    								<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

  								</div>

							</a>

							<a href="?subtopic=archive">

  								<div id="submenu_archive" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

    								<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

									<div id="ActiveSubmenuItemIcon_archive" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

									<div id="ActiveSubmenuItemLabel_archive" class="SubmenuitemLabel">Arquivo</div>

									<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

  								</div>

							</a>

						</div>

					</div>

				<div id="library" class="menuitem">

					<span onclick="MenuItemAction('library')">

						<div class="MenuButton" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/button-background.png);">

							<div onmouseover="MouseOverMenuItem(this);" onmouseout="MouseOutMenuItem(this);"><div class="Button" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/button-background-over.png);"></div>

							<span id="library_Lights" class="Lights">

								<div class="light_lu" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

								<div class="light_ld" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

								<div class="light_ru" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

							</span>

							<div id="library_Icon" class="Icon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-liibrary.gif);"></div>

							<div id="library_Label" class="Label" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/label-library.png);"></div>

							<div id="library_Extend" class="Extend" style="background-image: url(<?PHP echo $layout_name; ?>/images/general/plus.gif);"></div>

						</div>

					</div>

				</span>

				<div id="library_Submenu" class="Submenu">

					<a href="?subtopic=serverinfo">

						<div id="submenu_serverinfo" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

							<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

							<div id="ActiveSubmenuItemIcon_serverinfo" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

							<div id="ActiveSubmenuItemLabel_serverinfo" class="SubmenuitemLabel">Conheça-nos </div>

							<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						</div>

					</a>

					<a href="?subtopic=dicaupar">

						<div id="submenu_c" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

							<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

							<div id="ActiveSubmenuItemIcon_dicaupar" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

							<div id="ActiveSubmenuItemLabel_dicaupar" class="SubmenuitemLabel">Dica Upar </div>

							<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						</div>

					</a>



					<a href="?subtopic=dicagraduacao">

						<div id="submenu_dicagraduacao" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

							<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

							<div id="ActiveSubmenuItemIcon_dicagraduacao" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

							<div id="ActiveSubmenuItemLabel_dicagraduacao" class="SubmenuitemLabel">Graduações</div>

							<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						</div>

					</a>



					<a href="?subtopic=dicaquest">

						<div id="submenu_dicaquest" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

							<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

							<div id="ActiveSubmenuItemIcon_dicaquest" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

							<div id="ActiveSubmenuItemLabel_dicaquest" class="SubmenuitemLabel">Quests</div>

							<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						</div>

					</a>

					<a href="?subtopic=dicaaprimoration">

						<div id="submenu_dicaaprimoration" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

							<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

							<div id="ActiveSubmenuItemIcon_dicaaprimoration" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

							<div id="ActiveSubmenuItemLabel_dicaaprimoration" class="SubmenuitemLabel">Aprimoramentos</div>

							<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						</div>

					</a>

					<a href="?subtopic=dicaanbu">

						<div id="submenu_dicaanbu" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

							<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

							<div id="ActiveSubmenuItemIcon_dicaanbu" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

							<div id="ActiveSubmenuItemLabel_dicaanbu" class="SubmenuitemLabel">Anbu / Akatsuki </div>

							<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						</div>

					</a>

					<a href="?subtopic=dicaotsutsuki">

						<div id="submenu_dicaotsutsuki" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

							<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

							<div id="ActiveSubmenuItemIcon_dicaotsutsuki" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

							<div id="ActiveSubmenuItemLabel_dicaotsutsuki" class="SubmenuitemLabel">Clã Otsutsuki </div>

							<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						</div>

					</a>

					<a href="?subtopic=dicahotkey">

						<div id="submenu_dicahotkey" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

							<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

							<div id="ActiveSubmenuItemIcon_dicahotkey" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

							<div id="ActiveSubmenuItemLabel_dicahotkey" class="SubmenuitemLabel">Hotkeys Elfbot </div>

							<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						</div>

					</a>

					<a href="?subtopic=dicacombos">

						<div id="submenu_dicacombos" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

							<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

							<div id="ActiveSubmenuItemIcon_dicacombos" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>
							<div id="ActiveSubmenuItemLabel_dicacombos" class="SubmenuitemLabel">Combos Elfbot</div>

							<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						</div>

					</a>

				</div>

			</div>

			<div id="community" class="menuitem">

				<span onclick="MenuItemAction('community')">

					<div class="MenuButton" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/button-background.png);">

						<div onmouseover="MouseOverMenuItem(this);" onmouseout="MouseOutMenuItem(this);"><div class="Button" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/button-background-over.png);"></div>

						<span id="community_Lights" class="Lights">

							<div class="light_lu" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

							<div class="light_ld" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

							<div class="light_ru" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

						</span>

						<div id="community_Icon" class="Icon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-communiity.gif);"></div>

						<div id="community_Label" class="Label" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/label-community.png);"></div>

						<div id="community_Extend" class="Extend" style="background-image: url(<?PHP echo $layout_name; ?>/images/general/plus.gif);"></div>

					</div>

				</div>

			</span>

			<div id="community_Submenu" class="Submenu">

				<a href="?subtopic=characters">

					<div id="submenu_characters" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

						<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						<div id="ActiveSubmenuItemIcon_characters" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

						<div id="ActiveSubmenuItemLabel_characters" class="SubmenuitemLabel">Investigar Player</div>

						<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

					</div>

				</a>

				<a href="?subtopic=whoisonline">

					<div id="submenu_whoisonline" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

						<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						<div id="ActiveSubmenuItemIcon_whoisonline" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

						<div id="ActiveSubmenuItemLabel_whoisonline" class="SubmenuitemLabel">Jogadores Online</div>

						<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

					</div>

				</a>

				<a href="?subtopic=highscores">

					<div id="submenu_highscores" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

						<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						<div id="ActiveSubmenuItemIcon_highscores" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

						<div id="ActiveSubmenuItemLabel_highscores" class="SubmenuitemLabel">Ranking Jogadores</div>

						<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

					</div>

				</a>

				<a href="?subtopic=killstatistics">

					<div id="submenu_killstatistics" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

						<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						<div id="ActiveSubmenuItemIcon_killstatistics" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

						<div id="ActiveSubmenuItemLabel_killstatistics" class="SubmenuitemLabel">Registro de Morte</div>

						<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

					</div>

				</a>

				<a href="?subtopic=houses">

					<div id="submenu_houses" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

						<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						<div id="ActiveSubmenuItemIcon_houses" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

						<div id="ActiveSubmenuItemLabel_houses" class="SubmenuitemLabel">Houses</div>

						<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

					</div>

				</a>

				<a href="?subtopic=guilds">

					<div id="submenu_guilds" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

						<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						<div id="ActiveSubmenuItemIcon_guilds" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

						<div id="ActiveSubmenuItemLabel_guilds" class="SubmenuitemLabel">Guild</div>

						<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

					</div>

				</a>

				<a href="?subtopic=castsystem">

					<div id="submenu_castsystem" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

						<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						<div id="ActiveSubmenuItemIcon_castsystem" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

						<div id="ActiveSubmenuItemLabel_castsystem" class="SubmenuitemLabel">Cast TV</div>

						<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

					</div>

				</a>				

			</div>

		</div>

			<div id="forum" class="menuitem">

				<span onclick="MenuItemAction('forum')">

					<div class="MenuButton" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/button-background.png);">

						<div onmouseover="MouseOverMenuItem(this);" onmouseout="MouseOutMenuItem(this);"><div class="Button" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/button-background-over.png);"></div>

						<span id="forum_Lights" class="Lights">

							<div class="light_lu" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

							<div class="light_ld" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

							<div class="light_ru" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

						</span>

						<div id="forum_Icon" class="Icon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-forrum.gif);"></div>

						<div id="forum_Label" class="Label" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/label-forum.png);"></div>

						<div id="forum_Extend" class="Extend" style="background-image: url(<?PHP echo $layout_name; ?>/images/general/plus.gif);"></div>

					</div>

				</div>

			</span>

			<div id="forum_Submenu" class="Submenu">

				<a href="?subtopic=serverinfo">

					<div id="submenu_forum" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

						<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						<div id="ActiveSubmenuItemIcon_forum" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

						<div id="ActiveSubmenuItemLabel_forum" class="SubmenuitemLabel">Junte-se a nós !</div>

						<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

					</div>

				</a>

			</div>

		</div>

			<div id="account" class="menuitem">

				<span onclick="MenuItemAction('account')">

  					<div class="MenuButton" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/button-background.png);">

    					<div onmouseover="MouseOverMenuItem(this);" onmouseout="MouseOutMenuItem(this);"><div class="Button" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/button-background-over.png);"></div>

      					<span id="account_Lights" class="Lights">

        					<div class="light_lu" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

							<div class="light_ld" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

							<div class="light_ru" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

      					</span>

					  	<div id="account_Icon" class="Icon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-accaount.gif);"></div>

					  	<div id="account_Label" class="Label" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/label-account.png);"></div>

					  	<div id="account_Extend" class="Extend" style="background-image: url(<?PHP echo $layout_name; ?>/images/general/plus.gif);"></div>

    				</div>

  				</div>

			</span>

			<div id="account_Submenu" class="Submenu">

			<?PHP

			if($group_id_of_acc_logged >= $config['site']['access_admin_panel']){

			?>

				<a href="?subtopic=cpanel">

  					<div id="submenu_cpanel" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

						<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						<div id="ActiveSubmenuItemIcon_cpanel" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

						<div id="ActiveSubmenuItemLabel_cpanel" class="SubmenuitemLabel"><font color=red>Admin Panel</font></div>

						<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

  					</div>

				</a>

			<?PHP } ?>

				<a href="?subtopic=accountmanagement">

  					<div id="submenu_accountmanagement" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

						<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						<div id="ActiveSubmenuItemIcon_accountmanagement" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

						<div id="ActiveSubmenuItemLabel_accountmanagement" class="SubmenuitemLabel">Gerenciar Conta</div>

						<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

  					</div>

				</a>

				<a href="?subtopic=createaccount">

  					<div id="submenu_createaccount" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

    					<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						<div id="ActiveSubmenuItemIcon_createaccount" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

						<div id="ActiveSubmenuItemLabel_createaccount" class="SubmenuitemLabel">Criar Conta</div>

						<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

  					</div>

				</a>

				<a href="?subtopic=lostaccount">

  					<div id="submenu_lostaccount" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

						<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						<div id="ActiveSubmenuItemIcon_lostaccount" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

						<div id="ActiveSubmenuItemLabel_lostaccount" class="SubmenuitemLabel">Recuperar Conta?</div>

						<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

  					</div>

				</a>

				<a href="?subtopic=download">

  					<div id="submenu_download" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

    					<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						<div id="ActiveSubmenuItemIcon_download" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

						<div id="ActiveSubmenuItemLabel_download" class="SubmenuitemLabel" ><font color=0099FF>D O W N L O A D</font></div>

						<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

  					</div>

				</a>

			</div>

		</div>

			<div id="team" class="menuitem">

				<span onclick="MenuItemAction('team')">

  					<div class="MenuButton" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/button-background.png);">

    					<div onmouseover="MouseOverMenuItem(this);" onmouseout="MouseOutMenuItem(this);"><div class="Button" style="background-image: url(<?PHP echo $layout_name; ?>/images/menu/button-background-over.png);"></div>

      					<span id="team_Lights" class="Lights">

							<div class="light_lu" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

							<div class="light_ld" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

							<div class="light_ru" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

      					</span>

						<div id="team_Icon" class="Icon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-suppport.gif);"></div>

						<div id="team_Label" class="Label" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/label-support.png);"></div>

						<div id="team_Extend" class="Extend" style="background-image: url(<?PHP echo $layout_name; ?>/images/general/plus.gif);"></div>

    				</div>

  				</div>

			</span>

			<div id="team_Submenu" class="Submenu">

				<a href="?subtopic=tibiarules">

  					<div id="submenu_tibiarules" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

						<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						<div id="ActiveSubmenuItemIcon_tibiarules" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

						<div id="ActiveSubmenuItemLabel_tibiarules" class="SubmenuitemLabel">Regras do Jogo</div>

						<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

  					</div>

				</a>

				<a href="?subtopic=team">

  					<div id="submenu_team" class="Submenuitem" onmouseover="MouseOverSubmenuItem(this)" onmouseout="MouseOutSubmenuItem(this)">

						<div class="LeftChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

						<div id="ActiveSubmenuItemIcon_team" class="ActiveSubmenuItemIcon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);"></div>

						<div id="ActiveSubmenuItemLabel_team" class="SubmenuitemLabel">Staff Online</div>

						<div class="RightChain" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);"></div>

  					</div>

				</a>

			</div>

		</div>

		<?PHP

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

		?>

			<div id="shops" class="menuitem">

				<span onclick="MenuItemAction('shops')">

  					<div class="MenuButton" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/button-background.png);">

    					<div onmouseover="MouseOverMenuItem(this);" onmouseout="MouseOutMenuItem(this);"><div class="Button" style="background-image: url(<?PHP echo $layout_name; ?>/images/menu/button-background-over.png);"></div>

      					<span id="shops_Lights" class="Lights">

							<div class="light_lu" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

							<div class="light_ld" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

							<div class="light_ru" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/green-light.gif);"></div>

      					</span>

					  	<div id="shops_Icon" class="Icon" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-sheops.gif);"></div>

					  	<div id="shops_Label" class="Label" style="background-image:url(<?PHP echo $layout_name; ?>/images/menu/label-shops.png);"></div>

					  	<div id="shops_Extend" class="Extend" style="background-image: url(<?PHP echo $layout_name; ?>/images/general/plus.gif);"></div>

    				</div>

  				</div>

			</span>

			<div id="shops_Submenu" class="Submenu">

				<a href='?subtopic=donate'>

  					<div id='submenu_donate' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>

    					<div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

						<div id='ActiveSubmenuItemIcon_donate' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div>

						<div class='SubmenuitemLabel'>Donate</div>

						<div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

  					</div>

				</a>

				<a href='?subtopic=shopsystem'>

  					<div id='submenu_shopsystem' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>

						<div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

						<div id='ActiveSubmenuItemIcon_shopsystem' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div>

						<div class='SubmenuitemLabel'>Shop Offer</div>

						<div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

  					</div>

				</a>

				<a href='?subtopic=shopguild'>

  					<div id='submenu_shopguild' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>

						<div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

						<div id='ActiveSubmenuItemIcon_shopguild' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div>

						<div class='SubmenuitemLabel'>Shop Guild</div>

						<div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

  					</div>

				</a>

				<?PHP

				if($logged){

				?>

				<a href='?subtopic=shopsystem&action=show_history'>

  					<div id='submenu_show_history' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>

						<div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

						<div id='ActiveSubmenuItemIcon_show_history' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div>

						<div class='SubmenuitemLabel'>History</div>

						<div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

  					</div>

				</a>

				<?PHP } ?>

				<?PHP

				if($group_id_of_acc_logged >= $config['site']['access_admin_panel']){

				?>

				<a href='?subtopic=shopadmin'>

  					<div id='submenu_shopadmin' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>

						<div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

						<div id='ActiveSubmenuItemIcon_shopadmin' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div>

						<div class='SubmenuitemLabel'><font color=0099FF>Shop Admin</font></div>

						<div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

  					</div>

				</a>

				<a href='?subtopic=shopguildadmin'>

  					<div id='submenu_shopguildadmin' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>

						<div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

						<div id='ActiveSubmenuItemIcon_shopguildadmin' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div>

						<div class='SubmenuitemLabel'><font color=#EB8305>ShopGuild Admin</font></div>

						<div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

  					</div>

				</a>

				<?PHP } ?>

			</div>

		</div>

		<?PHP } ?>

		<div id="MenuBottom" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/box-bottom.gif);"></div>

	</div>

	<script type="text/javascript">InitializePage();</script></div>

    	<div id="ContentColumn">

        	<div id="Content" class="Content">

            	<div id="ContentHelper">

				<script type="text/javascript" src="<?PHP echo $layout_name; ?>/newsticker.js"></script>

				<?PHP echo $news_content; ?>

  				<div id="news" class="Box">

    				<div class="Corner-tl" style="background-image:url(<?PHP echo $layout_name; ?>/images/content/corner-tl.png);"></div>

					<div class="Corner-tr" style="background-image:url(<?PHP echo $layout_name; ?>/images/content/corner-tr.png);"></div>

					<div class="Border_1" style="background-image:url(<?PHP echo $layout_name; ?>/images/content/border-1.png);"></div>

					<div class="BorderTitleText" style="background-image:url(<?PHP echo $layout_name; ?>/images/content/title-background-green.png);"></div>

    				<img id="ContentBoxHeadline" class="Title" src="./layouts/tibiarl/images/header/headline-latestnews.png" alt="Contentbox headline">

    				<div class="Border_2">

      					<div class="Border_3">

        					<div class="BoxContent" style="background-image:url(<?PHP echo $layout_name; ?>/images/content/scroll.png);">

								<?PHP echo $main_content; ?>

        					</div>

      					</div>

    				</div>

					<div class="Border_1" style="background-image:url(<?PHP echo $layout_name; ?>/images/content/border-1.png);"></div>

					<div class="CornerWrapper-b"><div class="Corner-bl" style="background-image:url(<?PHP echo $layout_name; ?>/images/content/corner-bl.png);"></div></div>

					<div class="CornerWrapper-b"><div class="Corner-br" style="background-image:url(<?PHP echo $layout_name; ?>/images/content/corner-br.png);"></div></div>

  				</div>



              	<div id="ThemeboxesColumn">

                	<div id="DeactivationContainer" onclick="DisableDeactivationContainer();"></div>

                	<div id="RightArtwork">

                  		<img id="PedestalAndOnline" src="<?PHP echo $layout_name; ?>/images/header/pedestal-and-online.png" alt="Monster Pedestal and Players Online Box">

                  		<div id="PlayersOnline" onClick="window.location='?subtopic=whoisonline'">

																<?PHP

																echo $number_of_players_online.'<br />Players Online';

																?>

		  				</div>

        			</div>

                	<div id="Themeboxes">

					

<?php

$skills = $SQL->query('SELECT * FROM players WHERE deleted = 0 AND group_id = 1 AND account_id != 1 ORDER BY level DESC LIMIT 5');

?>

<style type="text/css" media="all">

  .Toplevelbox {

    top: -4px;

    position: relative;

    margin-bottom: 10px;

    width: 180px;

    height: 200px;

  }

  .top_level {

    position: absolute;

    toop: 29px;

    left: 25px;

    height: 592px;

    width: 175px;

    z-index: 20;

    text-align: center;

    padding-top:33px;

    font-family: Tahoma, Geneva, sans-serif;

    font-size: 9.2pt;

    color: #FFF;

    font-weight: bold;

    text-align: right;

    text-decoration: inherit;

    text-shadow: 0.1em 0.1em #333

  }



  #Topbar a {

  text-decoration: none;

  cursor: auto;

  }

  a.topfont {

    font-family: Verdana, Arial, Helvetica; 

    font-size: 11px; 

        color: #FF0000;

    text-decoration: none

  }

  a:hover.topfont {

    font-family: Verdana, Arial, Helvetica; 

    font-size: 11px; 

    color: #CCC; 

    text-decoration:none

  }

</style>



<div id="Topbar" class="Themebox" style="background-image:url(<?PHP echo $layout_name; ?>/images/themeboxes/top_leevel.png);">

  <div class="top_level" style="background:url(<?PHP echo $layout_name; ?>/images/themeboxes/boxgeral.png)" align="	">

    <?php 

    $a = 1;

    foreach($skills as $skill) {

      echo '<div align="left"><a href="?subtopic=characters&name='.$skill['name'].'" class="topfont">

        <font color="#CCC">&nbsp;&nbsp;&nbsp;&nbsp;'.$a.' - </font>'.$skill['name'].'

        <br>

        <small><font color="white">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Level: ('.$skill['level'].')</font></small>

        <br>

      </a>

      </div>';

      $a++;

    }

    ?>

    <div class="Bottom" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/box-bottom.giif); top: 159px;; left:-5px;">

	</div>

</div>	

</div>

<br>

<br><br>

				

                  		<!-- premium theme box -->

						<div id="PremiumBox" class="Themebox" style="background-image:url(<?PHP echo $layout_name; ?>/images/themeboxes/premium/premiumbox.png);right: -53;top: 168;">

    						<div class="ThemeboxButton">

    							<form action="?subtopic=donate" method="post" style="padding:0px;margin:0px;">

									<div class="BigButton" style="background-image:url(<?PHP echo $layout_name; ?>/images/buttons/buttonpremium.png)">

										<div onmouseover="MouseOverBigButton(this);" onmouseout="MouseOutBigButton(this);"><div class="BigButtonOver" style="background-image:url(<?PHP echo $layout_name; ?>/images/buttons/buttonpremium-hover.png);"></div>

											<input class="ButtonText" type="image" name="Get Premium" alt="Get Premium" src="<?PHP echo $layout_name; ?>/images/buttons/comprarpremium.png">

										</div>

									</div>

								</form>  

							</div>

  							<div class="Bottom" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/box-bottom.giif);"></div>

						</div>



						<!-- networks theme box -->

						<?PHP

						$nF = $SQL->query("SELECT " .$SQL->fieldName('network_link'). " FROM " .$SQL->tableName('z_network_box'). " WHERE " .$SQL->fieldName('network_name'). " = 'facebook'")->fetch();

						$nT = $SQL->query("SELECT " .$SQL->fieldName('network_link'). " FROM " .$SQL->tableName('z_network_box'). " WHERE " .$SQL->fieldName('network_name'). " = 'twitter'")->fetch();

						?>

						<?PHP if(!empty($nF)){ ?>

						<div id="NetworksBox" class="Themebox" style="background-image:url(<?PHP echo $layout_name; ?>/images/themeboxes/networks/neetworksbox.png);">

  							<div id="FacebookBlock">

    							<div id="FacebookLikeBox">

      								<div class="fb-like-box fb_iframe_widget" data-href="https://www.facebook.com/wonobattle" data-width="175" data-height="180" data-show-faces="true" data-stream="false" data-border-color="none" data-header="false" fb-xfbml-state="rendered">

										<span style="vertical-align: bottom; width: 181px; height: 180px;">

										</span>

									</div>

    							</div>

    							<div id="FacebookSendBox">

      								<div class="fb-send fb_iframe_widget" data-href="https://www.facebook.com/narutohard" data-width="50" data-height="20" fb-xfbml-state="rendered">

										<span style="vertical-align: bottom; width: 50px; height: 20px;">

										</span>

									</div>

    							</div>

    							<div id="FacebookLikes">

      								<div class="fb-like fb_edge_widget_with_comment fb_iframe_widget" data-href="https://www.facebook.com/narutohard" data-send="false" data-width="225" data-show-faces="false" fb-xfbml-state="rendered">

										<span style="height: 28px; width: 225px;">

										</span>

									</div>

    							</div>

  							</div>

							<?PHP if(!empty($nT)){ ?>

  							<div id="TwitterBlock">

    							<a href="https://twitter.com/<?PHP echo $nT['network_link']; ?>" class="twitter-follow-button" data-show-count="false">Follow @<?PHP echo $nT['network_link']; ?></a>

<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

  							</div>

							<?PHP } ?>

  							<div class="Bottom" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/box-bottom.giif);"></div>

						</div>

						<?PHP } ?>

						<?PHP if($config['site']['screenshot_page']){ ?>

  						<!-- screenshot theme box -->

  						<div id="ScreenshotBox" class="Themebox" style="background-image:url(<?PHP echo $layout_name; ?>/images/themeboxes/screenshot/screenshotbox.gif);">

    						<a href="#">

      							<img id="ScreenshotContent" class="ThemeboxContent" src="images/screenshots/witch_thumb.gif" alt="Screenshot of the Day">

    						</a>

  							<div class="Bottom" style="background-image:url(<?PHP echo $layout_name; ?>/images/general/box-bottom.gif);"></div>

  						</div>

						<?PHP } ?>

    					<!-- current poll theme box -->

							<?PHP

    						$time = time();

							$viewpoll = $SQL->query("SELECT * FROM `z_polls` where end > '$time' ORDER BY id DESC LIMIT 1");

							foreach($viewpoll as $p){

							$polls .= '<center>'.$p['question'].'</center>';

								if(isset($p['id'])){

								 echo '<div id="CurrentPollBox" class="Themebox" style="background-image:url('.$layout_name.'/images/themeboxes/current-poll/currentpollbox.gif);">

								  <div id="CurrentPollText">'.$polls.'</div>

								  <a class="ThemeboxButton" href="index.php?subtopic=polls&id= '.$p['id'].'" onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOut

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

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

								  </a>

								<div class="Bottom" style="background-image:url('.$layout_name.'/images/general/box-bottom.gif);"></div>

								</div>';

								}

							}

							?>



                	</div>

				</div>

            </div>           

		</div>

		<div id="Footer">

        	Copyright by CipSoft GmbH. All rights reserved.<br>

            <a href="#">About CipSoft</a> | 

			<a href="#">Service Agreement</a> | 

			<a href="#">Privacy Policy</a>

        </div>

	</div>

</div>

</div>

</div>

</div>

  

  <script type="text/javascript">

    // disable all control elements which are not part of the content container element

    if (g_Deactivated == true) {

      document.getElementById('LoginButtonContainer').style.zIndex = "1";

      document.getElementById('DeactivationContainer').style.display = "block";

      document.getElementById('DeactivationContainer').style.zIndex = "50";

      document.getElementById('DeactivationContainerThemebox').style.display = "block";

      document.getElementById('Monster').style.cursor = "auto";

      document.getElementById('PlayersOnline').style.cursor = "auto";

      document.getElementById('ThemeboxesColumn').style.opacity = "0.30";

      document.getElementById('ThemeboxesColumn').style.MozOpacity = "0.30";

      document.getElementById('ThemeboxesColumn').filters.alpha.opacity = "0.75";

      document.getElementById('ThemeboxesColumn').style.filter = "alpha(opacity=50); opacity: 0.30";

      document.getElementById('Monster').setAttribute("onclick", "")

      document.getElementById('PlayersOnline').setAttribute("onclick", "")

    }

  </script>

  	<div id="HelperDivContainer" style="background-image: url(<?PHP echo $layout_name; ?>/images/content/scroll.gif);">

  		<div class="HelperDivArrow" style="background-image: url(<?PHP echo $layout_name; ?>/images/content/helper-div-arrow.png);"></div>

  		<div id="HelperDivHeadline"></div>

  		<div id="HelperDivText"></div>

 		<center>

  			<img class="Ornament" src="<?PHP echo $layout_name; ?>/images/content/ornament.gif">

  		</center>

  	<br>

	</div>

</body>

</html>

 

Spoiler

accountmanagement.php


<?php

date_default_timezone_set('America/Araguaina');

if(!defined('INITIALIZED'))

	exit;

	

if(!$logged)

	if($action == "logout")

		$main_content .= '

			<div class="TableContainer" >  

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

					<div class="CaptionContainer" >      

						<div class="CaptionInnerContainer" >        

							<div class="Text" >Conta deslogada com Sucesso!</div>        

							</div>    

					</div>    

					<tr>      

						<td>        

							<div class="InnerTableContainer" >          

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

									<tr>

										<td>Você saiu da sua conta, Para visualizar sua conta, você precisa <a href="?subtopic=accountmanagement" >Logar Conta</a> Novamente.</td>

									</tr>          

								</table>        

							</div>

						</td>

					</tr>  

				</table>

			</div>';

	else

	{

		$passB = '<span>Senha:</span>';

		$logB = '<span>Nome da conta:</span>';

		if(isset($isTryingToLogin))

		{

			$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/>';

			switch(Visitor::getLoginState())

			{

				case Visitor::LOGINSTATE_NO_ACCOUNT:

					$main_content .= 'Account with that name doesn\'t exist.<br/>';

					$logB = '<span style="color:red;">Account Name:</span>';

					break;

				case Visitor::LOGINSTATE_WRONG_PASSWORD:

					$main_content .= 'Wrong password to account.<br/>';

					$passB = '<span style="color:red;">Password:</span>';

					break;

			}

				$main_content .= '

					</div>

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

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

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

					</div>

				</div>

			</div><br/>';

		}

		$main_content .= '

			<form action="?subtopic=accountmanagement" method="post" style="margin: 0px; padding: 0px;">

				<div class="TableContainer" >

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

						<div class="CaptionContainer" >

							<div class="CaptionInnerContainer" >

								<div class="Text" >Logar Conta</div>								

							</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%"  style="border:0px solid #737373;" >

															<tr>

																<td>

																	<table style="float: left; width: 370px;" cellpadding="0" cellspacing="0" >

																		<tr>

																			<td class="LabelV120" ><span>'.$logB.'</span></td>

																			<td><input type="password" name="account_login" size="35" maxlength="30" ></td>

																		</tr>

																		<tr>

																			<td class="LabelV120" ><span>'.$passB.'</span></td>

																			<td><input type="password" name="password_login" size="35" maxlength="29" ></td>

																		</tr>

																	</table>

																	<div style="float: right; font-size: 1px;" >

																		<input type="hidden" name="page" value="overview" >

																			<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="Login" alt="Login" src="'.$layout_name.'/images/buttons/_sbutton_login.gif" >

																				</div>

																			</div>

																		</form>

																		<div style="width: 2px; height: 2px;" ></div>

																		<form action="/?subtopic=lostaccount" method="post" style="padding:0px;margin:0px;" >

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

																					<input class="ButtonText" type="image" name="Account lost?" alt="Account lost?" src="'.$layout_name.'/images/buttons/_sbutton_accountlost.gif" >

																				</div>

																			</div>

																		</form>

																	</div>

																</td>

															</tr>

														</table>

													</div>

												</div>

												<div class="TableShadowContainer" >

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

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

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

													</div>

												</div>

											</td>

										</tr>

									</table>

								</div>

							</table>

						</div>

					</td>

				</tr>

				<br/>

				<center>

					<h1>Novo no '.$config['server']['serverName'].' server?</h1>

				</center>

				<div class="TableContainer" >

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

						<div class="CaptionContainer" >

							<div class="CaptionInnerContainer" > 															

								<div class="Text" >Novo Jogador</div>			

							</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%"  style="border:0px solid #737373;" >

															<tr>

																<td >

																	<div style="float: right; margin-top: 3px;" >

																		<form class="MediumButtonForm" action="/?subtopic=createaccount" method="post" >

																			<div class="MediumButtonBackground" style="background-image:url('.$layout_name.'/images/buttons/mediumbutton.png)" onMouseOver="MouseOverMediumButton(this);" onMouseOut="MouseOutMediumButton(this);" ><div class="MediumButtonOver" style="background-image:url('.$layout_name.'/images/buttons/mediumbutton-over.png)" onMouseOver="MouseOverMediumButton(this);" onMouseOut="MouseOutMediumButton(this);" ></div>

																				<input class="MediumButtonText" type="image" name="Create Account" alt="Create Account" src="'.$layout_name.'/images/buttons/mediumbutton_createaccount.png" />

																			</div>

																		</form>

																	</div>

																	<div id="LoginCreateAccountBox" >

																		<p><b>'.$config['server']['serverName'].'...</b></p>

																		<div style="margin-left: 10px;" >

																			<p>... onde o jogo hardcore encontra a fantasia.</p>

																			<p>... onde amizades duram a vida toda.</p>

																			<p>... aventureiros unidos desde 2015!</p>

																		</div>

																	</div>

														</table>

													</div>

												</div>

												<div class="TableShadowContainer" >

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

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

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

													</div>

												</div>

											</td>

										</tr>

									</table>

								</div>

							</table>

						</div>

					</td>

				</tr>';

	}

else

{

	

	

	//Here start our new accountmanagement ;D

	if($action == "")

	{

		if($account_logged->getCustomField('vip_time') > 0)

			$account_statusOver = '

				<span class="green">

					<span class="BigBoldText">Conta Premium</span>

				</span>';

		else

			$account_statusOver = '

				<span class="red">

					<span class="BigBoldText">Conta Gratuita</span>

				</span>';

				

		if($account_logged->getCustomField('vip_time') > 0)

			$account_statusPic = '<img class="AccountStatusImage" src="'.$layout_name.'/images/account/account-status_green.gif" alt="free account">';

		else

			$account_statusPic = '<img class="AccountStatusImage" src="'.$layout_name.'/images/account/account-status_red.gif" alt="free account">';

			

		$main_content .= '

			<center>

				<table>

					<tbody>

						<tr>

							<td><img src="'.$layout_name.'/images/content/headline-bracer-left.gif"></td>

							<td style="text-align:center;vertical-align:middle;horizontal-align:center;font-size:17px;font-weight:bold;">Bem vindo a sua Conta '.$account_logged->getRLName().'!<br></td>

							<td><img src="'.$layout_name.'/images/content/headline-bracer-right.gif"></td>

						</tr>

					</tbody>

				</table>

			</center>

			<br>';

		$main_content .= '

			<div class="TableContainer">

				<div class="CaptionContainer">

					<div class="CaptionInnerContainer"> 

						<div class="Text">Status da Conta</div>						

					</div>

				</div>

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

					<tbody>

						<tr>

							<td>

								<div class="InnerTableContainer">

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

										<tbody>

											<tr>

												<td>

													<div class="TableShadowContainerRightTop">

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

													</div>

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

														<div class="TableContentContainer">

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

																<tbody>

																	<tr>

																		<td>'.$account_statusPic.'</td>

																		<td width="100%" valign="middle">

																			'.$account_statusOver.'';

																		$main_content .= '

																			<small><br>Seu tempo Premium expira em <font style="text-transform:capitalize;">'.date('d/m/Y, H:i:s', $account_logged->getCustomField('vip_time')).'</font></small>';

																		$main_content .= '

																		</td>

																		<td>

																			<form action="?subtopic=accountmanagement&action=manage" method="post" style="padding:0px;margin: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="Manage Account" alt="Manage Account" src="'.$layout_name.'/images/buttons/_sbutton_manageaccount.gif">

																					</div>

																				</div>

																			</form>

																			<div style="font-size:1px;height:4px;"></div>

																				<form action="?subtopic=donate" method="post" style="padding:0px;margin:0px;">

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

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

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

																						</div>

																					</div>

																				</form>

																				<div style="font-size:1px;height:4px;"></div>

																				<form action="?subtopic=accountmanagement&action=logout" method="post" style="padding:0px;margin:0px;">

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

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

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

																						</div>

																					</div>

																				</form>

																			</td>

																		</tr>

																	</tbody>

																</table>

															</div>

														</div>

														<div class="TableShadowContainer">

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

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

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

														</div>

													</div>

												</td>

											</tr>

										</tbody>

									</table>

								</div>

							</td>

						</tr>

					</tbody>

				</table>

			</div>

			<br>';

			//REGISTRAR

			$account_reckey = $account_logged->getCustomField("key");

			if(empty($account_reckey))

			$main_content .= '

				<div class="SmallBox" >

					<div class="MessageContainer" >

						<div class="Message" >

							<table class="HintBox" >

								<tr>

									<td>

										<div class="BoxButtons" >

											<form action="?subtopic=accountmanagement&action=registeraccount" method="post" style="padding:0px;margin:0px;" >

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

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

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

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

													</div>

												</div>

											</form>

											<div style="font-size:1px;height:4px;" ></div>

										</div>

										<p><b>Sua conta não está registrada!</b></p>

										<p>Você precisa clicar aqui para registrar sua conta e receber sua chave de recuperação. Por favor, tome cuidado sua Recovery Key.</p>

										<p>Caso tenha perdido sua chave de recuperação, você pode solicitar a nova chave de recuperação para sua conta novamente.</p>

									</td>

								<tr>

							</table>

						</div>

						</div>

					</div><br/>

			';

			//CHARACTERS

			$main_content .= '

				<div class="RowsWithOverEffect">

					<div class="TableContainer">

						<div class="CaptionContainer">

							<div class="CaptionInnerContainer"> 

								<div class="Text">Personagem</div>

								</div>

						</div>

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

							<tbody>

								<tr>

									<td>

										<div class="InnerTableContainer">

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

												<tbody>

													<tr>

														<td>

															<div class="TableShadowContainerRightTop">

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

															</div>

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

																<div class="TableContentContainer">

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

																		<tbody>

																			<tr class="LabelH">

																				<td></td>

																				<td style="width:40%;">Nome</td>

																				<td style="width:120px!important;">Mundo</td>

																				<td style="width:90px!important;">Status</td>

																				<td style="width:90px!important;">&nbsp;</td>

																			</tr>';

																			

																	$account_players = $account_logged->getPlayersList();

																	//show list of players on account

																	$var = 0;

																	foreach($account_players as $account_player)

																		{

																			$player_number_counter++;

																			if($var==0) {

																					$preview = ' previewstate="0"';

																			} else {

																					$preview = '';

																			}

																			

																			if($var==0) {

																				$display = 'block';

																			} else {

																				$display = 'none';

																			}

																			

																			if($var==0) {

																				$displayNum = 'none';

																			} else {

																				$displayNum = 'inline';

																			}

																			

																			if($var==0) {

																				$displayBold = 'bold';

																			} else {

																				$displayBold = 'normal';

																			}

																			

																			if($var==0) {

																				$displayFont = '13';

																			} else {

																				$displayFont = '10';

																			}

																			

																			$main_content .='

																			<tr id="CharacterRow_'.$player_number_counter.'" 

																				onmouseover="InRowWithOverEffect(&#39;CharacterRow_'.$player_number_counter.'&#39;,';

																				

																				if(is_int($player_number_counter / 2))

																					$main_content .= '&#39;#737373&#39;';

																				else

																					$main_content .= '&#39;#737373&#39;'; 

																				

																				

																				$main_content .='

																				);"

																				onmouseout="OutRowWithOverEffect(&#39;CharacterRow_'.$player_number_counter.'&#39;,'; 

																				

																				if(is_int($player_number_counter / 2))

																					$main_content .= '&#39;#505050&#39;';

																				else

																					$main_content .= '&#39;#505050&#39;';																				

																				

																				$main_content .='

																				);" 

																				onclick="FocusCharacter('.$player_number_counter.', &#39;'.urlencode($account_player->getName()).'&#39;, '.$config['site']['max_players_per_account'].');" 

																				class="Odd" style="font-weight: '.$displayBold.';';

																				

																				if(is_int($player_number_counter / 2))

																					$main_content .= 'background-color: #505050;">';

																				else

																					$main_content .= 'background-color: #505050;">';

																				

																				$main_content .='

																				<td style="width:40px;text-align:center;padding:2px;">

																					<span id="CharacterNumberOf_'.$player_number_counter.'" style="display: '.$displayNum.';">'.$player_number_counter.'.</span>

																					<span id="PlayButtonOf_'.$player_number_counter.'" style="display: '.$display.';">

																						<span name="FlashClientPlayButton" id="FlashClientPlayButton" playlink="#" ' . $preview . '>';

																						

																						if($account_player->isDeleted())

																							{

																								$main_content .= '<img style="border:0px;" src="'.$layout_name.'/images/account/play-not-button.gif">';

																							} else {

																								$main_content .= '

																								<a href="#" >

																									<img style="border:0px;" onmouseover="InMiniButton(this, &#39;&#39;);" onmouseout="OutMiniButton(this, &#39;&#39;);" src="'.$layout_name.'/images/account/play-button.gif">

																								</a>';

																							}

																							

																						$main_content .='

																						</span>

																					</span>

																				</td>

																				<td id="CharacterCell2_'.$player_number_counter.'">

																					<span style="white-space:nowrap;vertical-align:middle;">

																						<span id="CharacterNameOf_'.$player_number_counter.'" style="font-size: '.$displayFont.'pt;">'.htmlspecialchars($account_player->getName()).'</span><br>

																						<span id="CharacterNameOf_'.$player_number_counter.'"><small>'.htmlspecialchars($vocation_name[$account_player->getPromotion()][$account_player->getVocation()]).' - Level '.$account_player->getLevel().'</small></span>

																					</span>

																				</td>

																				<td id="CharacterCell2_'.$player_number_counter.'">

																					<span style="white-space:nowrap;">'.htmlspecialchars($config['server']['serverName']).'</span>

																				</td>

																				<td id="CharacterCell3_'.$player_number_counter.'">';

																					if(!$account_player->isOnline())

																						$main_content .= '';

																					else

																						$main_content .= '<font color="#00CD00"><b>online</b></font>';

																					if($account_player->isDeleted())

																						{

																							$main_content .= 'deleted';

																						}

																				$main_content .='

																				</td>

																				<td id="CharacterCell4_'.$player_number_counter.'" style="text-align:center;">

																					<span id="CharacterOptionsOf_'.$player_number_counter.'" style="display: '.$display.';">

																						<span style="font-weight:normal;">[<a href="?subtopic=accountmanagement&action=changecomment&name='.urlencode($account_player->getName()).'">Edit</a>]</span>';

																						if($account_player->isDeleted())

																						{

																							$main_content .= '<br><span style="font-weight:normal;">[<a href="?subtopic=accountmanagement&action=undelete&name='.urlencode($account_player->getName()).'">Undelete</a>]</span>';

																						} else {

																							$main_content .= '<br><span style="font-weight:normal;">[<a href="?subtopic=accountmanagement&action=deletecharacter&name='.urlencode($account_player->getName()).'">Delete</a>]</span>';

																						}

																						

																					$main_content .= '

																					</span>

																				</td>

																			</tr>';

																			$var++;

																		}																		

																		$main_content .='

																		</tbody>

																	</table>

																</div>

															</div>

															<div class="TableShadowContainer">

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

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

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

																</div>

															</div>

														</td>

													</tr>

													<tr>

														<td>

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

																<tbody>

																	<tr>

																		<td></td>

																		<td align="right" style="padding-right:7px;width:100%;">

																			<form action="?subtopic=accountmanagement&action=createcharacter" method="post" style="padding:0px;margin:0px;">

																				<input type="hidden" name="selectedcharacter" value="Draz Mytos">

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

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

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

																					</div>

																				</div>

																			</form>

																		</td>

																	</tr>

																</tbody>

															</table>

														</td>

													</tr>

												</tbody>

											</table>

										</div>

									</td>

								</tr>

							</tbody>

						</table>

					</div>

				</div>

				<br><br>';

				//MIGRATION TOOL ;D

				if($group_id_of_acc_logged >= $config['site']['access_admin_panel']){

				$main_content .= '

					<div class="SmallBox">

						<div class="MessageContainer">

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

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

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

							<div class="Message">

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

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

								<table class="HintBox">

									<tbody>

										<tr>

											<td>

												<p><b>Admin Panel</b></p>

												<p>Click <a href="?subtopic=cpanel">here</a> to go your new <strong>Admin Panel</strong></p>

											</td>

										</tr>

										<tr></tr>

									</tbody>

								</table>

							</div>

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

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

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

						</div>

					</div>

					<br>';

				}else{

					$main_content .= '

					<div class="SmallBox">

						<div class="MessageContainer">

							<div class="Message">

								<table class="HintBox">

									<tbody>

										<tr>

											<td>

												<p><b>Gerenciamento de conta</b></p>

												<p>Esta é a página principal de gerenciamento de sua conta, aqui você terá a chave para as informações da sua conta exibidas e atualizadas, divirta-se!! </p>

											</td>

										</tr>

										<tr></tr>

									</tbody>

								</table>

							</div>

							</div>

					</div>

					<br>';

				}

	}

	//Here finish our new account management

	$account_id = $account_logged->getId();

	if($account_id == 1) header("Location: ?subtopic=accountmanagement&action=logout");

	

	if($action == "manage")

	{

		$account_reckey = $account_logged->getCustomField("key");

		$dataAtual = time();

		$dataProxima = $account_logged->getCustomField('vip_time');

		$data1 = $dataProxima - $dataAtual;

		$dataCerta = $data1 / 86400;

		if($account_logged->getCustomField('vip_time') > 0)

			$account_status = '<b><font color="#00CD00">Conta Premium, '. floor($dataCerta) .' days left</font></b>';

		else

			$account_status = '<b><font color="red">Conta Gratuita</font></b>';

		if(empty($account_reckey))

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

		else

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

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

			else

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

				

		$account_created = $account_logged->getCreateDate();

		$account_email = $account_logged->getEMail();

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

		if($account_email_new_time > 1)

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

		$account_rlname = $account_logged->getRLName();

		$account_location = $account_logged->getLocation();

		

		$main_content .= '

			<div class="SmallBox" >

				<div class="MessageContainer" >					

					<div class="Message" >

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

						<td style="width:100%;text-align:center;" >

							<nobr>[<a href="#General+Information" >Informação geral</a>]</nobr> 

							<nobr>[<a href="#Registration" >Cadastrar Conta</a>]</nobr> 

						</td>

						<td>

							<form action="?subtopic=doacao" method="post" style="padding:0px;margin:0px;" >

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

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

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

									</div>

								</div>

							</form>

							<div style="font-size:1px;height:4px;" ></div>

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

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

									<tr>

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

											<input type="hidden" name=page value=overview >

											<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="Overview" alt="Overview" src="'.$layout_name.'/images/buttons/_sbutton_overview.gif" >

												</div>

											</div>

										</td>

									</tr>

								</form>

							</table>

						</td>

					</tr>

				</table>

			</div>

			</div>

	</div><br/>';

		$main_content .= '

			<a name="General+Information" ></a>

			<div class="TopButtonContainer" >

				<div class="TopButton" >

					<a href="#top" >

						<image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" />

					</a>

				</div>

			</div>

			<div class="TableContainer" >

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

					<div class="CaptionContainer" >

						<div class="CaptionInnerContainer" > 

							<div class="Text" >Informação geral</div>

							</div>

					</div>

					<tr>		

						<td>		

							<div class="InnerTableContainer" >

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

									<tr>

										<td>

											<div class="TableShadowContainerRightTop" >

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

											</div>

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

												<div class="TableContentContainer" >

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

														<tr style="background-color:#505050;" >

															<td class="LabelV" >Nome da conta:</td>

															<td style="width:90%;" >

																<div style="position:relative;width:100%;" >

																	<span id="DisplayAccountID" >'.str_repeat('*', strlen(htmlspecialchars($account_logged->getName()))).'</span>

																	<span id="MaskedAccountID" style="visibility:hidden;display:none" >'.str_repeat('*', strlen(htmlspecialchars($account_logged->getName()))).'</span>

																	<span id="ReadableAccountID" style="visibility:hidden;display:none" >'.htmlspecialchars($account_logged->getName()).'</span>

																	<img id="ButtonAccountID" onMouseDown="ToggleMaskedText(\'AccountID\');" style="position:absolute;right:0px;top:2px;cursor:pointer;" src="'.$layout_name.'/images/general/show.gif" />

																</div>

															</td>

														</tr>

														<tr style="background-color:#505050;" >

															<td class="LabelV" >Endereço de e-mail:</td>

															<td style="width:90%;" >

																<div style="position:relative;width:100%;" >

																	<span id="DisplayEMail" >'.str_repeat('*', strlen(htmlspecialchars($account_email))).'</span>

																	<span id="MaskedEMail" style="visibility:hidden;display:none" >'.str_repeat('*', strlen(htmlspecialchars($account_email))).'</span>

																	<span id="ReadableEMail" style="visibility:hidden;display:none" >'.htmlspecialchars($account_email).'</span>

																	<img id="ButtonEMail" onMouseDown="ToggleMaskedText(\'EMail\');" style="position:absolute;right:0px;top:2px;cursor:pointer;" src="'.$layout_name.'/images/general/show.gif" />

																</div>

															</td>

														</tr>

														<tr style="background-color:#505050;" >

															<td class="LabelV" >Criado:</td>

																<td>'.date("M d Y, G:i:s", $account_created).'</td>

														</tr>

														<tr style="background-color:#505050;" >

															<td class="LabelV" >Último login:</td>

															<td>'.date("M d Y, G:i:s", time()).'</td>

														</tr>

														<tr style="background-color:#505050;" >

															<td class="LabelV" >Status da Conta:</td>

															<td>'.$account_status;

															if($account_logged->getCustomField('vip_time') <= time()){

																

																$main_content .= '<br/><font style="font-size:8pt">(Seu tempo Premium expira em ' .date('d/m/Y, H:i:s', $account_logged->getCustomField('vip_time')). ')</font>';

															}else{

																$main_content .= '<br/><font style="font-size:8pt">(VIP time expires at ' .date('d/m/Y, H:i:s', $account_logged->getCustomField('vip_time')). ')</font>';

															}

														$main_content .= '

															</td>

														</tr>

													</table>

												</div>

											</div>

											<div class="TableShadowContainer" >

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

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

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

												</div>

											</div>

										</td>

									</tr>

									<tr>

										<td>

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

												<tr>

													<td>

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

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

																<tr>

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

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

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

																			</div>

																		</div>

																	</td>

																</tr>

															</form>

														</table>

													<td></td>

													<td>

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

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

																<tr>

																	<td style="border:0px;" ><input type="hidden" name=step value=changename >

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

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

																				<input class="ButtonText" type="image" name="Change Email" alt="Rename Account" src="'.$layout_name.'/images/buttons/_sbutton_changeemail.gif" >

																			</div>

																		</div>

																	</td>

																</tr>

															</form>

														</table>

													</td>											

												</tr>

											</table>

										</td>

									</tr>

								</table>

							</div>

						</table>

					</div>

				</td>

			</tr><br/><br/>'; 

		if($account_email_new_time > 1)

			if($account_email_new_time < time())

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

			else

			{

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

				

				$main_content .= '

					<div class="SmallBox" >  

						<div class="MessageContainer" >    

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

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

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

							<div class="Message" >      

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

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

								<table>

									<tr>

										<td class="LabelV" >Note:</td>

										<td style="width:100%;" >A request has been submitted to change the email address of this account to <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>

									</tr>

								</table>

								<div align="center" >

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

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

											<tr>

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

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

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

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

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

														</div>

													</div>

												</td>

											</tr>

										</form>

									</table>

								</div>    

							</div>    

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

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

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

						</div>

					</div>

				<br/><br/>';

			}

			

		//REGISTRATION

		$main_content .= '

			<a name="Registration" ></a>

			<div class="TopButtonContainer" >

				<div class="TopButton" >

					<a href="#top" >

						<image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" />

					</a>

				</div>

			</div>

			<div class="TableContainer" >  

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

					<div class="CaptionContainer" >      

						<div class="CaptionInnerContainer" >

							<div class="Text" >Cadastrar Conta</div>

							</div>    

					</div>    

					<tr>      

						<td>        

							<div class="InnerTableContainer" >          

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

									<tr>

										<td>

											<div class="TableShadowContainerRightTop" >  

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

											</div>

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

												<div class="TableContentContainer" >    

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

														<tr>

															<td>

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

																	<tr>

																		<td class="LabelV" >Nome Real:</td>

																		<td style="width:90%;" >'.$account_rlname.'</td>

																	</tr>

																	<tr>

																		<td class="LabelV" >Cidade:</td>

																		<td style="width:90%;" >'.$account_location.'</td>

																	</tr>

																</table>

															</td>

															<td align=right>

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

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

																		<tr>

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

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

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

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

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

																					</div>

																				</div>

																			</td>

																		</tr>

																	</form>

																</table>

															</td>

														</tr>    

													</table>  

												</div>

											</div>

											<div class="TableShadowContainer" >  

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

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

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

											</div>

										</div>

									</td>

								</tr>          

							</table>        

						</div>  

					</table>

				</div>

			</td>

		</tr><br/>';

	}

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

	if($action == "changepassword") {

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

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

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

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

		{

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

		}

		else

		{

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

			{

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

			}

			if($new_password != $new_password2)

			{

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

			}

			if(empty($show_msgs))

			{

				if(!check_password($new_password))

				{

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

				}

				if(!$account_logged->isValidPassword($old_password))

				{

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

				}

			}

			if(!empty($show_msgs))

			{

				//show errors

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

				foreach($show_msgs as $show_msg) {

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

				}

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

				//show form

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

			}

			else

			{

				$org_pass = $new_password;

				$account_logged->setPassword($new_password);

				$account_logged->save();

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

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

				{

					$mailBody = '<html>

					<body>

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

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

					<p>New password: <b>'.htmlspecialchars($org_pass).'</b></p>

					</body>

					</html>';

					$mail = new PHPMailer();

					if ($config['site']['smtp_enabled'])

					{

						$mail->IsSMTP();

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

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

						$mail->SMTPAuth = $config['site']['smtp_auth'];

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

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

					}

					else

						$mail->IsMail();

					$mail->IsHTML(true);

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

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

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

					$mail->Body = $mailBody;

					if($mail->Send())

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

					else

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

				}

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

				$_SESSION['password'] = $new_password;

			}

		}

	}



//############# CHANGE E-MAIL ###################

	if($action == "changeemail")

	{

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

		if($account_email_new_time > 10) {$account_email_new = $account_logged->getCustomField("email_new"); }

		if($account_email_new_time < 10)

		{

			if($_POST['changeemailsave'] == 1)

			{

				$account_email_new = trim($_POST['new_email']);

				$post_password = trim($_POST['password']);

				if(empty($account_email_new))

				{

					$change_email_errors[] = "Please enter your new email address.";

				}

				else

				{

					if(!check_mail($account_email_new))

					{

						$change_email_errors[] = "E-mail address is not correct.";

					}

				}

				if(empty($post_password))

				{

					$change_email_errors[] = "Please enter password to your account.";

				}

				else

				{

					if(!$account_logged->isValidPassword($post_password))

					{

						$change_email_errors[] = "Wrong password to account.";

					}

				}

				if(empty($change_email_errors))

				{

					$account_email_new_time = time() + $config['site']['email_days_to_change'] * 24 * 3600;

					$account_logged->set("email_new", $account_email_new);

					$account_logged->set("email_new_time", $account_email_new_time);

					$account_logged->save();

					$main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >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>';

				}

				else

				{

					//show errors

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

					foreach($change_email_errors as $change_email_error)

					{

						$main_content .= '<li>'.$change_email_error.'</li>';

					}

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

					//show form

					$main_content .= 'Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. <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>';

				}

			}

			else

			{

				$main_content .= 'Please enter your password and the new email address. Make sure that you enter a valid email address which you have access to. <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>';

			}

		}

		else

		{

			if($account_email_new_time < time())

			{

				if($_POST['changeemailsave'] == 1)

				{

					$account_logged->set("email_new", "");

					$account_logged->set("email_new_time", 0);

					$account_logged->setEmail($account_email_new);

					$account_logged->save();

					$main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Email Address Change Accepted</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>You have accepted <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>';

				}

				else

				{

					$main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Email Address Change Accepted</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>Do you accept <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>';

				}

			}

			else

			{

				$main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Change of Email Address</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>A request has been submitted to change the email address of this account to <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>';

			}

		}

		if($_POST['emailchangecancel'] == 1)

		{

			$account_logged->set("email_new", "");

			$account_logged->set("email_new_time", 0);

			$account_logged->save();

			$main_content = '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Email Address Change Cancelled</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>Your request to change the email address of your account has been cancelled. The email address will not be changed.</td></tr>          </table>        </div>  </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';

		}

	}

	

//########### CHANGE PUBLIC INFORMATION (about account owner) ######################

	if($action == "changeinfo") {

		$new_rlname = htmlspecialchars(trim($_POST['info_rlname']));

		$new_location = htmlspecialchars(trim($_POST['info_location']));

		if($_POST['changeinfosave'] == 1) {

		//save data from form

			$account_logged->set("rlname", $new_rlname);

			$account_logged->set("location", $new_location);

			$account_logged->save();

			$main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Public Information Changed</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>Your public information has been changed.</td></tr>          </table>        </div>  </table></div></td></tr><br><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';

		}

		else

		{

		//show form

			$account_rlname = $account_logged->getCustomField("rlname");

			$account_location = $account_logged->getCustomField("location");

			$main_content .= 'Aqui você pode dizer a outros jogadores sobre você. Esta informação será exibida ao lado dos dados de seus personagens. Se você não quiser preencher um determinado campo, deixe em branco.<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" > 

			<div class="Text" >Alterar informações públicas</div>

			</div>

			</div>

			<tr>   

			<td>     

			<div class="InnerTableContainer" > 

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

			<tr><td class="LabelV" >Nome Real:</td><td style="width:90%;" >

			<input name="info_rlname" value="'.$account_rlname.'" size="30" maxlength="50" >

			</td>

			</tr>

			<tr>

			<td class="LabelV" >Cidade:</td>

			<td><input name="info_location" value="'.$account_location.'" size="30" maxlength="50" ></td></tr>

			</table>

			</div>

			</table>

			</div>

			</td>

			</tr>

			<br/>

			<table width="100%">

			<tr align="center">

			<td>

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

			<tr>

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

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

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

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

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

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

			</div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" >

			<form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" >

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

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

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

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

			</div>

			</div>

			</td>

			</tr>

			</form>

			</table>

			</td>

			</tr>

			</table>';

		}

	}



//############## GENERATE RECOVERY KEY ###########

	if($action == "registeraccount")

	{

		$reg_password = trim($_POST['reg_password']);

		$old_key = $account_logged->getCustomField("key");

		if($_POST['registeraccountsave'] == "1")

		{

			if($account_logged->isValidPassword($reg_password))

			{

				if(empty($old_key))

				{

					$dontshowtableagain = 1;

					$acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789';

					$max = strlen($acceptedChars)-1;

					$new_rec_key = NULL;

					// 10 = number of chars in generated key

					for($i=0; $i < 10; $i++) {

						$cnum[$i] = $acceptedChars{mt_rand(0, $max)};

						$new_rec_key .= $cnum[$i];

					}

					$account_logged->set("key", $new_rec_key);

					$account_logged->save();

					$main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Account Registered</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" >Thank you for registering your account! You can now recover your account if you have lost access to the assigned email address by using the following<br/><br/><font size="5">&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>';

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

					{

						$mailBody = '<html>

						<body>

						<h3>New recovery key!</h3>

						<p>You or someone else generated recovery key to your account on server <a href="'.$config['server']['url'].'"><b>'.htmlspecialchars($config['server']['serverName']).'</b></a>.</p>

						<p>Recovery key: <b>'.htmlspecialchars($new_rec_key).'</b></p>

						</body>

						</html>';

						$mail = new PHPMailer();

						if ($config['site']['smtp_enabled'])

						{

							$mail->IsSMTP();

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

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

							$mail->SMTPAuth = $config['site']['smtp_auth'];

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

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

						}

						else

							$mail->IsMail();

						$mail->IsHTML(true);

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

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

						$mail->Subject = $config['server']['serverName']." - recovery key";

						$mail->Body = $mailBody;

						if($mail->Send())

							$main_content .= '<br /><small>Your recovery key were send on email address <b>'.htmlspecialchars($account_logged->getEMail()).'</b>.</small>';

						else

							$main_content .= '<br /><small>An error occorred while sending email with recovery key! You will not receive e-mail with this key.</small>';

					}

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

				}

				else

					$reg_errors[] = 'Your account is already registred.';

			}

			else

				$reg_errors[] = 'Wrong password to account.';

		}

		if($dontshowtableagain != 1)

		{

			//show errors if not empty

			if(!empty($reg_errors))

			{

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

				foreach($reg_errors as $reg_error)

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

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

			}

			//show form

			$main_content .= 'To generate recovery key for your account please enter your password.<br/><br/><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><input type="hidden" name="registeraccountsave" value="1"><div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Generate recovery key</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td class="LabelV" ><span >Password:</td><td><input type="password" name="reg_password" size="30" maxlength="29" ></td></tr>          </table>        </div>  </table></div></td></tr><br/><table style="width:100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';

		}

	}



//############## GENERATE NEW RECOVERY KEY ###########

	if($action == "newreckey")

	{

		$reg_password = trim($_POST['reg_password']);

		$reckey = $account_logged->getCustomField("key");

		if((!$config['site']['generate_new_reckey'] || !$config['site']['send_emails']) || empty($reckey))

			$main_content .= 'You cant get new rec key';

		else

		{

			$points = $account_logged->getCustomField('vip_time');

			if($_POST['registeraccountsave'] == "1")

			{

				if($account_logged->isValidPassword($reg_password))

				{

					if($points >= $config['site']['generate_new_reckey_price'])

					{

							$dontshowtableagain = 1;

							$acceptedChars = 'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789';

							$max = strlen($acceptedChars)-1;

							$new_rec_key = NULL;

							// 10 = number of chars in generated key

							for($i=0; $i < 10; $i++) {

								$cnum[$i] = $acceptedChars{mt_rand(0, $max)};

								$new_rec_key .= $cnum[$i];

							}

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

								$mailBody = '<html>

								<body>

								<h3>New recovery key!</h3>

								<p>You or someone else generated recovery key to your account on server <a href="'.$config['server']['url'].'"><b>'.htmlspecialchars($config['server']['serverName']).'</b></a>.</p>

								<p>Recovery key: <b>'.htmlspecialchars($new_rec_key).'</b></p>

								</body>

								</html>';

								$mail = new PHPMailer();

								if ($config['site']['smtp_enabled'])

								{

									$mail->IsSMTP();

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

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

									$mail->SMTPAuth = $config['site']['smtp_auth'];

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

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

								}

								else

									$mail->IsMail();

								$mail->IsHTML(true);

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

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

								$mail->Subject = $config['server']['serverName']." - new recovery key";

								$mail->Body = $mailBody;

								if($mail->Send())

								{

									$account_logged->set("key", $new_rec_key);

									$account_logged->set("vip_time", $account_logged->get("vip_time")-$config['site']['generate_new_reckey_price']);

									$account_logged->save();

									$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.';

								}

								else

									$main_content .= '<br />An error occorred while sending email ( <b>'.htmlspecialchars($account_logged->getEMail()).'</b> ) with recovery key! Recovery key not changed. Try again.';

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

					}

					else

						$reg_errors[] = 'You need '.$config['site']['generate_new_reckey_price'].' premium points to generate new recovery key. You have <b>'.$points.'<b> premium points.';

				}

				else

					$reg_errors[] = 'Wrong password to account.';

			}

			if($dontshowtableagain != 1)

			{

				//show errors if not empty

				if(!empty($reg_errors))

				{

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

					foreach($reg_errors as $reg_error)

						$main_content .= '<li>'.$reg_error.'</li>';

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

				}

				//show form

				$main_content .= 'To generate 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>';

			}

		}

	}



	

	

//###### CHANGE CHARACTER COMMENT ######

	if($action == "changecomment")

	{

		$player_name = $_REQUEST['name'];

		$signature = htmlspecialchars(substr(trim($_POST['signature']),0,2000));

		$new_comment = htmlspecialchars(substr(trim($_POST['comment']),0,2000));

		$new_hideacc = (int) $_POST['accountvisible'];

		if(check_name($player_name))

		{

			$player = new Player();

			$player->find($player_name);

			if($player->isLoaded())

			{

				$player_account = $player->getAccount();

				if($account_logged->getId() == $player_account->getId())

				{

					if($_POST['changecommentsave'] == 1)

					{

						$player->set("hide_char", $new_hideacc);

						$player->set("comment", $new_comment);

						$player->set("signature", $signature);

						$player->save();

						$main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Character Information Changed</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>The character information has been changed.</td></tr>          </table>        </div>  </table></div></td></tr><br><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';

					}

					else

					{

						$main_content .= '

							Here you can see and edit the information about your character.<br/>If you do not want to specify a certain field, just leave it blank.<br/><br/>

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

								<div class="TableContainer" >  

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

										<div class="CaptionContainer" >      

											<div class="CaptionInnerContainer" >        

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

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

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

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

												<div class="Text" >Edit Character Information</div>        

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

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

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

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

											</div>    

										</div>    

										<tr>      

											<td>        

												<div class="InnerTableContainer" >          

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

														<tr>

															<td>

																<div class="TableShadowContainerRightTop" >  

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

																</div>

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

																	<div class="TableContentContainer" >    

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

																			<tr>

																				<td class="LabelV" >Name:</td>

																				<td style="width:80%;" >'.htmlspecialchars($player_name).'</td>

																			</tr>

																			<tr>

																				<td class="LabelV" >Hide Account:</td><td>';

																		if($player->getCustomField("hide_char") == 1)

																		{

																			$main_content .= '

																				<input type="checkbox" name="accountvisible"  value="1" checked="checked">';

																		}

																		else

																		{

																			$main_content .= '

																				<input type="checkbox" name="accountvisible"  value="1" >';

																		}

																				$main_content .= ' 

																					check to hide your account information

																				</td>

																			</tr>    

																		</table>  

																	</div>

																</div>

																<div class="TableShadowContainer" >  

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

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

																</div>

															</td>

														</tr>

														<tr>

															<td>

																<div class="TableShadowContainerRightTop" >  

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

																</div>

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

																	<div class="TableContentContainer" >    

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

																			<tr>

																				<td class="LabelV" ><span >Comment:</span></td>

																				<td style="width:80%;" >

																					<textarea name="comment" rows="10" cols="50" wrap="virtual" >'.$player->getCustomField("comment").'</textarea><br>

																				</td>

																			</tr>

																			<tr>

																				<td class="LabelV" style="white-space:normal;" ><span >Forum Signature:</span></td>

																				<td style="width:80%;" >

																					<textarea name="signature" rows="4" cols="50" wrap="virtual" >'.$player->getCustomField("signature").'</textarea>

																				</td>

																			</tr>    

																		</table>  

																	</div>

																</div>

																<div class="TableShadowContainer" >  

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

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

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

																	</div>

																</div>

															</td>

														</tr>

													</td>

												</tr>          

											</table>        

										</div>  

									</table>

								</div>

							</td>

						</tr><br/>

						<table style="width:100%" >

							<tr align="center" >

								<td>

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

										<tr>

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

												<input type="hidden" name="name" value="'.htmlspecialchars($player->getName()).'">

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

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

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

											</div>

										</div>

									</td>

								<tr>

							</form>

						</table>

					</td>

					<td>

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

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

								<tr>

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

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

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

									</td>

								</tr>

								

							</form>

						</table>

					</td>

				</tr>

			</table>';

					}

				}

				else

				{

					$main_content .= "Error. Character <b>".htmlspecialchars($player_name)."</b> is not on your account.";

				}

			}

			else

			{

				$main_content .= "Error. Character with this name doesn't exist.";

			}

		}

		else

		{

			$main_content .= "Error. Name contain illegal characters.";

		}

	}



//### DELETE character from account ###

	if($action == "deletecharacter")

	{

		$player_name = trim($_POST['delete_name']);

		$password_verify = trim($_POST['delete_password']);

		if($_POST['deletecharactersave'] == 1)

		{

			if(!empty($player_name) && !empty($password_verify))

			{

				if(check_name($player_name))

				{

					$player = new Player();

					$player->find($player_name);

					if($player->isLoaded())

					{

						$player_account = $player->getAccount();

						if($account_logged->getId() == $player_account->getId())

						{

							if($account_logged->isValidPassword($password_verify))

							{

								if(!$player->isOnline())

								{

									//dont show table "delete character" again

									$dontshowtableagain = 1;

									//delete player

									$player->set('deleted', 1);

									$player->save();

									$main_content .= '

										<div class="TableContainer" >  

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

												<div class="CaptionContainer" >      

													<div class="CaptionInnerContainer" >        

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

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

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

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

														<div class="Text" >Character Deleted</div>        

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

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

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

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

													</div>    

												</div>    

												<tr>      

													<td>        

														<div class="InnerTableContainer" >          

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

																<tr>

																	<td>The character <b>'.htmlspecialchars($player_name).'</b> has been deleted.</td>

																</tr>          

															</table>        

														</div>  

													</table>

												</div>

											</td>

										</tr>

										<br>

										<center>

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

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

													<tr>

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

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

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

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

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

																</div>

															</div>

														</td>

													</tr>

												</form>

											</table>

										</center>';

								}

								else

									$delete_errors[] = 'This character is online.';

							}

							else

							{

								$delete_errors[] = 'Wrong password to account.';

							}

						}

						else

						{

							$delete_errors[] = 'Character <b>'.htmlspecialchars($player_name).'</b> is not on your account.';

						}

					}

					else

					{

						$delete_errors[] = 'Character with this name doesn\'t exist.';

					}

				}

				else

				{

					$delete_errors[] = 'Name contain illegal characters.';

				}

			}

			else

			{

			$delete_errors[] = 'Character name or/and password is empty. Please fill in form.';

			}

		}

		if($dontshowtableagain != 1)

		{

			if(!empty($delete_errors))

			{

				$main_content .= '

					<div class="SmallBox" >  

						<div class="MessageContainer" >    

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

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

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

							<div class="ErrorMessage" >      

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

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

								<div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div>

								<b>The Following Errors Have Occurred:</b><br/>';

				foreach($delete_errors as $delete_error)

				{

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

				}

				$main_content .= '

					</div>    

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

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

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

				</div>

			</div><br/>';

			}

			$main_content .= 'To delete 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/>

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

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

					<div class="TableContainer" >  

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

							<div class="CaptionContainer" >      

								<div class="CaptionInnerContainer" >        

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

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

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

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

									<div class="Text" >Delete Character</div>        

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

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

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

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

								</div>    

							</div>    

							<tr>     

								<td>        

									<div class="InnerTableContainer" >          

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

											<tr>

												<td class="LabelV" ><span >Character Name:</td>

												<td style="width:90%;" >

													<input type="hidden" name="delete_name" value="'.$_GET['name'].'" size="30" maxlength="29" >

													<p>'.$_GET['name'].'</p>

												</td>

											</tr>

											<tr>

												<td class="LabelV" ><span >Password:</td>

												<td>

													<input type="password" name="delete_password" size="30" maxlength="29" >

												</td>

											</tr>          

										</table>        

									</div>  

								</table>

							</div>

						</td>

					</tr><br/>

					<table style="width:100%" >

						<tr align="center" >

							<td>

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

									<tr>

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

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

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

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

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

												</div>

											</div>

										</td>

										<tr>

									</form>

								</table>

							</td>

							<td>

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

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

										<tr>

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

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

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

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

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

													</div>

												</div>

											</td>

										</tr>

									</form>

								</table>

							</td>

						</tr>

					</table>';

		}

	}



	

//### UNDELETE character from account ###

	if($action == "undelete")

	{

		$player_name = trim($_GET['name']);

		if(!empty($player_name))

		{

			if(check_name($player_name))

			{

				$player = new Player();

				$player->find($player_name);

				if($player->isLoaded())

				{

					$player_account = $player->getAccount();

					if($account_logged->getId() == $player_account->getId())

					{

						if(!$player->isOnline())

						{

							$player->set('deleted', 0);

							$player->save();

							$main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >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>';

						}

						else

							$delete_errors[] = 'This character is online.';

					}

					else

						$delete_errors[] = 'Character <b>'.htmlspecialchars($player_name).'</b> is not on your account.';

				}

				else

					$delete_errors[] = 'Character with this name doesn\'t exist.';

			}

			else

				$delete_errors[] = 'Name contain illegal characters.';

		}

	}	



//## CREATE CHARACTER on account ###

	if($action == "createcharacter")

	{

		if(count($config['site']['worlds']) > 1)

		{

			if(isset($_REQUEST['world']))

				$world_id = (int) $_REQUEST['world'];

		}

		else

			$world_id = 0;

		if(!isset($world_id))

		{

			$main_content .= 'Before you can create character you must select world: ';

			foreach($config['site']['worlds'] as $id => $world_n)

				$main_content .= '<br /><a href="?subtopic=accountmanagement&action=createcharacter&world='.$id.'">- '.htmlspecialchars($world_n).'</a>';

			$main_content .= '<br /><h3><a href="?subtopic=accountmanagement">BACK</a></h3>';

		}

		else

		{

			$main_content .= '<script type="text/javascript">

			var nameHttp;



function checkName()

{

		if(document.getElementById("newcharname").value=="")

		{

			document.getElementById("name_check").innerHTML = \'<b><font color="red">Please enter new character name.</font></b>\';

			return;

		}

		nameHttp=GetXmlHttpObject();

		if (nameHttp==null)

		{

			return;

		}

		var newcharname = document.getElementById("newcharname").value;

		var url="?subtopic=ajax_check_name&name=" + newcharname + "&uid="+Math.random();

		nameHttp.onreadystatechange=NameStateChanged;

		nameHttp.open("GET",url,true);

		nameHttp.send(null);

} 



function NameStateChanged() 

{ 

		if (nameHttp.readyState==4)

		{ 

			document.getElementById("name_check").innerHTML=nameHttp.responseText;

		}

}

</script>';

			$newchar_name = ucwords(strtolower(trim($_POST['newcharname'])));

			$newchar_sex = $_POST['newcharsex'];

			$newchar_vocation = $_POST['newcharvocation'];

			$newchar_town = $_POST['newchartown'];

			if($_POST['savecharacter'] != 1)

			{

				$main_content .= 'Please choose a name';

				if(count($config['site']['newchar_vocations'][$world_id]) > 1)

					$main_content .= ', vocation';

				$main_content .= ' and sex for your character. <br/>In any case the name must not violate the naming conventions stated in the <a href="?subtopic=tibiarules" target="_blank" >'.htmlspecialchars($config['server']['serverName']).' Rules</a>, or your character might get deleted or name locked.';

				if($account_logged->getPlayersList()->count() >= $config['site']['max_players_per_account'])

					$main_content .= '<b><font color="red"> You have maximum number of characters per account on your account. Delete one before you make new.</font></b>';

				$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>';

				$main_content .= '<input type="radio" name="newcharsex" value="1" ';

				if($newchar_sex == 1)

					$main_content .= 'checked="checked" ';

				$main_content .= '>male<br/>';

				$main_content .= '<input type="radio" name="newcharsex" value="0" ';

				if($newchar_sex == "0")

					$main_content .= 'checked="checked" ';

				$main_content .= '>female<br/></td></tr></table></div></div></table></div>';

				if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)

					$main_content .= '<div class="InnerTableContainer" >          <table style="width:100%;" ><tr>';

				if(count($config['site']['newchar_vocations'][$world_id]) > 1)

				{

					$main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your vocation:</b></td><td><table class="TableContent" width="100%" >';

					foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)

					{

						$main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';

						if($newchar_vocation == $char_vocation_key)

							$main_content .= 'checked="checked" ';

						$main_content .= '>'.htmlspecialchars($vocation_name[0][$char_vocation_key]).'</td></tr>';

					}

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

				}

				if(count($config['site']['newchar_towns'][$world_id]) > 1)

				{

					$main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your city:</b></td><td><table class="TableContent" width="100%" >';

					foreach($config['site']['newchar_towns'][$world_id] as $town_id)

					{

						$main_content .= '<tr><td><input type="radio" name="newchartown" value="'.$town_id.'" ';

						if($newchar_town == $town_id)

							$main_content .= 'checked="checked" ';

						$main_content .= '>'.htmlspecialchars($towns_list[$world_id][$town_id]).'</td></tr>';

					}

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

				}

				if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)

					$main_content .= '</tr></table></div>';

				$main_content .= '</table></div></td></tr><br/><table style="width:100%;" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';

			}

			else

			{	

				if(empty($newchar_name))

					$newchar_errors[] = 'Please enter a name for your character!';

				if(empty($newchar_sex) && $newchar_sex != "0")

					$newchar_errors[] = 'Please select the sex for your character!';

				if(count($config['site']['newchar_vocations'][$world_id]) > 1)

				{

					if(empty($newchar_vocation))

						$newchar_errors[] = 'Please select a vocation for your character.';

				}

				else

					$newchar_vocation = $config['site']['newchar_vocations'][$world_id][0];

				if(count($config['site']['newchar_towns'][$world_id]) > 1)

				{

					if(empty($newchar_town))

						$newchar_errors[] = 'Please select a town for your character.';

				}

				else

					$newchar_town = $config['site']['newchar_towns'][$world_id][0];

				if(empty($newchar_errors))

				{

					if(!check_name_new_char($newchar_name))

						$newchar_errors[] = 'This name contains invalid letters, words or format. Please use only a-Z, - , \' and space.';

					if($newchar_sex != 1 && $newchar_sex != "0")

						$newchar_errors[] = 'Sex must be equal <b>0 (female)</b> or <b>1 (male)</b>.';

					if(count($config['site']['newchar_vocations'][$world_id]) > 1)

					{

						$newchar_vocation_check = FALSE;

						foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)

							if($newchar_vocation == $char_vocation_key)

								$newchar_vocation_check = TRUE;

						if(!$newchar_vocation_check)

							$newchar_errors[] = 'Unknown vocation. Please fill in form again.';

					}

					else

						$newchar_vocation = 0;

				}

				if(empty($newchar_errors))

				{

					$check_name_in_database = new Player();

					$check_name_in_database->find($newchar_name);

					if($check_name_in_database->isLoaded())

						$newchar_errors[] .= 'This name is already used. Please choose another name!';

					$number_of_players_on_account = $account_logged->getPlayersList()->count();

					if($number_of_players_on_account >= $config['site']['max_players_per_account'])

						$newchar_errors[] .= 'You have too many characters on your account <b>('.$number_of_players_on_account.'/'.$config['site']['max_players_per_account'].')</b>!';

				}

				if(empty($newchar_errors))

				{

					$char_to_copy_name = $config['site']['newchar_vocations'][$world_id][$newchar_vocation];

					$char_to_copy = new Player();

					$char_to_copy->find($char_to_copy_name);

					if(!$char_to_copy->isLoaded())

						$newchar_errors[] .= 'Wrong characters configuration. Try again or contact with admin. ADMIN: Edit file config/config.php and set valid characters to copy names. Character to copy <b>'.htmlspecialchars($char_to_copy_name).'</b> doesn\'t exist.';

				}

				if(empty($newchar_errors))

				{

					// load items and skills of player before we change ID

					$char_to_copy->getItems()->load();

					$char_to_copy->loadSkills();

					

					if($newchar_sex == "0")

						$char_to_copy->setLookType(136);

					$char_to_copy->setID(null); // save as new character

					$char_to_copy->setLastIP(0);

					$char_to_copy->setLastLogin(0);

					$char_to_copy->setLastLogout(0);

				    $char_to_copy->setName($newchar_name);

				    $char_to_copy->setAccount($account_logged);

				    $char_to_copy->setSex($newchar_sex);

				    $char_to_copy->setTown($newchar_town);

					$char_to_copy->setPosX(0);

					$char_to_copy->setPosY(0);

					$char_to_copy->setPosZ(0);

					$char_to_copy->setBalance(0);					

					$char_to_copy->setWorldID((int) $world_id);

					$char_to_copy->setCreateIP(Visitor::getIP());

					$char_to_copy->setCreateDate(time());

					$char_to_copy->setSave(); // make character saveable

					$char_to_copy->save(); // now it will load 'id' of new player

					if($char_to_copy->isLoaded())

					{

						$char_to_copy->saveItems();

						$char_to_copy->saveSkills();

						$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>';

					}

					else

					{

						echo "Error. Can\'t create character. Probably problem with database. Try again or contact with admin.";

						exit;

					}

				}

				else

				{

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

					foreach($newchar_errors as $newchar_error)

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

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

					$main_content .= 'Please choose a name';

					if(count($config['site']['newchar_vocations'][$world_id]) > 1)

						$main_content .= ', vocation';

					$main_content .= ' and sex for your character. <br/>In any case the name must not violate the naming conventions stated in the <a href="?subtopic=tibiarules" target="_blank" >'.$config['server']['serverName'].' Rules</a>, or your character might get deleted or name locked.<br/><br/><form action="?subtopic=accountmanagement&action=createcharacter" method="post" ><input type="hidden" name="world" value="'.$world_id.'" ><input type="hidden" name=savecharacter value="1" ><div class="TableContainer" >  <table class="Table3" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Create Character</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div><tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" >  <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >  <div class="TableContentContainer" ><table class="TableContent" width="100%" ><tr class="LabelH" ><td style="width:50%;" ><span >Name</td><td><span >Sex</td></tr><tr class="Odd" ><td><input id="newcharname" name="newcharname" onkeyup="checkName();" value="'.$newchar_name.'" size="30" maxlength="29" ><BR><font size="1" face="verdana,arial,helvetica"><div id="name_check">Please enter your character name.</div></font></td><td>';

					$main_content .= '<input type="radio" name="newcharsex" value="1" ';

					if($newchar_sex == 1)

						$main_content .= 'checked="checked" ';

					$main_content .= '>male<br/>';

					$main_content .= '<input type="radio" name="newcharsex" value="0" ';

					if($newchar_sex == "0")

						$main_content .= 'checked="checked" ';

					$main_content .= '>female<br/></td></tr></table></div></div></table></div>';

					if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)

						$main_content .= '<div class="InnerTableContainer" >          <table style="width:100%;" ><tr>';

					if(count($config['site']['newchar_vocations'][$world_id]) > 1)

					{

						$main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your vocation:</b></td><td><table class="TableContent" width="100%" >';

						foreach($config['site']['newchar_vocations'][$world_id] as $char_vocation_key => $sample_char)

						{

							$main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.htmlspecialchars($char_vocation_key).'" ';

							if($newchar_vocation == $char_vocation_key)

								$main_content .= 'checked="checked" ';

							$main_content .= '>'.htmlspecialchars($vocation_name[0][$char_vocation_key]).'</td></tr>';

						}

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

					}

					if(count($config['site']['newchar_towns'][$world_id]) > 1)

					{

						$main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your city:</b></td><td><table class="TableContent" width="100%" >';

						foreach($config['site']['newchar_towns'][$world_id] as $town_id)

						{

							$main_content .= '<tr><td><input type="radio" name="newchartown" value="'.htmlspecialchars($town_id).'" ';

							if($newchar_town == $town_id)

								$main_content .= 'checked="checked" ';

							$main_content .= '>'.htmlspecialchars($towns_list[$world_id][$town_id]).'</td></tr>';

						}

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

					}

					if(count($config['site']['newchar_towns'][$world_id]) > 1 || count($config['site']['newchar_vocations'][$world_id]) > 1)

						$main_content .= '</tr></table></div>';

					$main_content .= '</table></div></td></tr><br/><table style="width:100%;" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';

				}

			}

		}

	}

}

 

 

Editado por diarmaint (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

@diarmaint O problema não tá no site e sim nas configurações da sua hospedagem, só por curiosidade, por que o site não está está rodando junto com o servidor na mesma maquina do google ? 

Link para o post
Compartilhar em outros sites
2 minutos atrás, r0bert0lol disse:

@diarmaint O problema não tá no site e sim nas configurações da sua hospedagem, só por curiosidade, por que o site não está está rodando junto com o servidor na mesma maquina do google ? 

Pois não consegui instalar o php e as databases nele.

só achei tutorial antigo, ensinando instalar o php5 que não está disponível na versão 16.04 do ubuntu disponível na vms

Editado por diarmaint (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

@diarmaint Se você estiver usando as distros mais recentes do ubuntu, terá que usar versões mais recentes do php também, caso queira ligar o site seguindo os tutoriais que tem por aqui, você teria que utilizar a versão 14.04 do ubuntu ou até mesmo inferior 12.04, é claro isso não é recomendado, mas é possível. Na plataforma do Google Cloud, quando você cria uma nova instância, é sugerido algumas distros, versão 16.04 do ubuntu em diante, etc... Porém você pode selecionar uma distro personalizada clicando em Marketplace e pesquisando por Ubuntu Trusty, essa distro é ubuntu na versão 14.04 crie uma nova instancia utilizando ela e siga todos os tutoriais encontrados aqui no forum e seja feliz.

Link para o post
Compartilhar em outros sites
21 horas atrás, r0bert0lol disse:

@diarmaint Se você estiver usando as distros mais recentes do ubuntu, terá que usar versões mais recentes do php também, caso queira ligar o site seguindo os tutoriais que tem por aqui, você teria que utilizar a versão 14.04 do ubuntu ou até mesmo inferior 12.04, é claro isso não é recomendado, mas é possível. Na plataforma do Google Cloud, quando você cria uma nova instância, é sugerido algumas distros, versão 16.04 do ubuntu em diante, etc... Porém você pode selecionar uma distro personalizada clicando em Marketplace e pesquisando por Ubuntu Trusty, essa distro é ubuntu na versão 14.04 crie uma nova instancia utilizando ela e siga todos os tutoriais encontrados aqui no forum e seja feliz.

Não sabia dessa, muito obrigado.

Instalei tudo correto, servidor compilado e site online, mas não consigo logar na conta adm no site, é alguma proteção ?

Edit--

O site ainda mostra que tem player on e servidor off...

Editado por diarmaint (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Andersontatuador
      .Qual servidor ou website você utiliza como base? 
      Global Full 8.60 + Zao
      Qual o motivo deste tópico? 
      O site não esta adicionando os pontos na conta dos plays.
       
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       



    • Por A.Mokk
      .Qual servidor ou website você utiliza como base? 
      TFS 0.4
      Qual o motivo deste tópico? 
      Estou tendo um probleminha indelicado no meu site, gostaria de obter respostas aqui com voces que sao sempre muito eficientes e praticos.
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
       
    • Por thunmin
      .Qual servidor ou website você utiliza como base? 
      Canary
      Qual o motivo deste tópico? 
      Não consigo deixar ele automatico os players tem que confirmar o pagamento depois eu tenho que verificar se caiu pra depois eu confirmar e colocar as coins
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • Por Jordan422
      Faala Deuses do Tibia! Estou com um projeto sólido de um global old, mas to preso nessa parte do website viu.. Eu dou meu jeitinho mas ta chegando nas coisas avançadas que precisa daquele freelancer bacana para ajeitar umas páginas para mim! Já tenho as ideias, basta somente botar a mão na massa.. Quem estiver interessado por favor entrar em contato por mensagem aqui no Tibiaking mesmo ou preferencialmente pelo discord mythh9257 
       
    • Por moleza
      Para quem quer abrir um servidor antigo que roda em php5 e está com dificuldade com a configuração do linux, pode contratar um cpanel que contenha o php5 que facilita a configuração do site!!
       
      essa foi a minha solução!
       
      Resolvido !!
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo