Ir para conteúdo
  • Cadastre-se

Posts Recomendados

 

Galera gostaria de um Hightscores com reset, ja tentei de tudo mas não conseguir por o rank reset

 

o meu sistema reset é por data base

\/

highscores.php

Spoiler

<?php
if(!defined('INITIALIZED'))
    exit;

$list = 'experience';
if(isset($_REQUEST['list']))
    $list = $_REQUEST['list'];

$page = 0;
if(isset($_REQUEST['page']))
    $page = min(50, $_REQUEST['page']);

$vocation = '';
if(isset($_REQUEST['vocation']))
    $vocation = $_REQUEST['vocation'];

switch($list)
{
    case "fist":
        $id=Highscores::SKILL_FIST;
        $list_name='Fist Fighting';
        break;
    case "club":
        $id=Highscores::SKILL_CLUB;
        $list_name='Club Fighting';
        break;
    case "sword":
        $id=Highscores::SKILL_SWORD;
        $list_name='Sword Fighting';
        break;
    case "axe":
        $id=Highscores::SKILL_AXE;
        $list_name='Axe Fighting';
        break;
    case "distance":
        $id=Highscores::SKILL_DISTANCE;
        $list_name='Distance Fighting';
        break;
    case "shield":
        $id=Highscores::SKILL_SHIELD;
        $list_name='Shielding';
        break;
    case "fishing":
        $id=Highscores::SKILL_FISHING;
        $list_name='Fishing';
        break;
    case "magic":
        $id=Highscores::SKILL__MAGLEVEL;
        $list_name='Magic';
        break;
    default:
        $id=Highscores::SKILL__LEVEL;
        $list_name='Experience';
        break;
}
$world_name = $config['server']['serverName'];

$offset = $page * 100;
$skills = new Highscores($id, 100, $page, $vocation);
$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD><CENTER><H2>Ranking for '.htmlspecialchars($list_name).' on '.htmlspecialchars($world_name).'</H2></CENTER><BR>';

$main_content .= '<br><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%></TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=whites><B>Rank</B></TD><TD WIDTH=75% CLASS=whites><B>Name</B></TD><TD WIDTH=15% CLASS=whites><b><center>Level</center></B></TD>';
if($list == "experience")
    $main_content .= '<TD CLASS=whites><b><center>Experience</center></B></TD>';
//$main_content .= '</TR><TR>';
$main_content .= '</TR>';
$number_of_rows = 0;
foreach($skills as $skill)
{
    if($list == "magic")
        $value = $skill->getMagLevel();
    elseif($list == "experience")
        $value = $skill->getLevel();
    else
        $value = $skill->getScore();
    $bgcolor = (($number_of_rows++ % 2 == 1) ?  $config['site']['darkborder'] : $config['site']['lightborder']);
    $main_content .= '<tr bgcolor="'.$bgcolor.'"><td style="text-align:right">'.($offset + $number_of_rows).'.</td><td><a href="?subtopic=characters&name='.urlencode($skill->getName()).'">'.($skill->getOnline()>0 ? "<font color=\"green\">".htmlspecialchars($skill->getName())."</font>" : "<font color=\"red\">".htmlspecialchars($skill->getName())."</font>").'</a><br><small>'.$skill->getLevel().' '.htmlspecialchars(Website::getVocationName($skill->getVocation())).'</small></td><td><center>'.$value.'</center></td>';
    if($list == "experience")
        $main_content .= '<td><center>'.$skill->getExperience().'</center></td>';
    $main_content .= '</tr>';
}
$main_content .= '</TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%>';
if($page > 0)
    $main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list='.urlencode($list).'&page='.($page - 1).'&vocation=' . urlencode($vocation) . '" CLASS="size_xxs">Previous Page</A></TD></TR>';
if($page < 50)
    $main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list='.urlencode($list).'&page='.($page + 1).'&vocation=' . urlencode($vocation) . '" CLASS="size_xxs">Next Page</A></TD></TR>';
$main_content .= '</TABLE></TD><TD WIDTH=5%><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=1 HEIGHT=1 BORDER=0></TD><TD WIDTH=15% VALIGN=top ALIGN=right><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=whites><B>Choose a skill</B></TD></TR><TR BGCOLOR="'.$config['site']['lightborder'].'"><TD><A HREF="?subtopic=highscores&list=experience" CLASS="size_xs">Experience</A><BR><A HREF="?subtopic=highscores&list=magic" CLASS="size_xs">Magic</A><BR><A HREF="?subtopic=highscores&list=shield" CLASS="size_xs">Shielding</A><BR><A HREF="?subtopic=highscores&list=distance" CLASS="size_xs">Distance</A><BR><A HREF="?subtopic=highscores&list=club" CLASS="size_xs">Club</A><BR><A HREF="?subtopic=highscores&list=sword" CLASS="size_xs">Sword</A><BR><A HREF="?subtopic=highscores&list=axe" CLASS="size_xs">Axe</A><BR><A HREF="?subtopic=highscores&list=fist" CLASS="size_xs">Fist</A><BR><A HREF="?subtopic=highscores&list=fishing" CLASS="size_xs">Fishing</A><BR></TD></TR></TABLE></TD><TD><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD></TR></TABLE>';

 

 

Link para o post
Compartilhar em outros sites
  • Sub-Admin
<?php
if (!defined('INITIALIZED')) exit;

// Função para verificar se é hora de resetar os highscores
function deveResetarHighscores() {
    // Coloque aqui a lógica para determinar se é hora de resetar os highscores
    // Por exemplo, verificar se passou uma certa quantidade de tempo desde o último reset
    // Retorne true se for hora de resetar, caso contrário, retorne false
    $lastResetTimestamp = /* Coloque aqui o timestamp do último reset */;
    $interval = 5 * 60; // 5 minutos em segundos
    $currentTimestamp = time();

    // Verifica se passou o intervalo de tempo definido desde o último reset
    return ($currentTimestamp - $lastResetTimestamp) >= $interval;
}

// Função para resetar os highscores
function resetarHighscores() {
    // Coloque aqui a lógica para resetar os highscores
    // Por exemplo, atualizar os valores na base de dados ou em outro sistema de armazenamento
    // Certifique-se de realizar as operações necessárias para reiniciar os highscores conforme sua lógica de negócios
}

$list = 'experience';
if (isset($_REQUEST['list'])) $list = $_REQUEST['list'];

$page = 0;
if (isset($_REQUEST['page'])) $page = min(50, $_REQUEST['page']);

$vocation = '';
if (isset($_REQUEST['vocation'])) $vocation = $_REQUEST['vocation'];

switch ($list) {
    case "fist":
        $id = Highscores::SKILL_FIST;
        $list_name = 'Fist Fighting';
        break;
    case "club":
        $id = Highscores::SKILL_CLUB;
        $list_name = 'Club Fighting';
        break;
    case "sword":
        $id = Highscores::SKILL_SWORD;
        $list_name = 'Sword Fighting';
        break;
    case "axe":
        $id = Highscores::SKILL_AXE;
        $list_name = 'Axe Fighting';
        break;
    case "distance":
        $id = Highscores::SKILL_DISTANCE;
        $list_name = 'Distance Fighting';
        break;
    case "shield":
        $id = Highscores::SKILL_SHIELD;
        $list_name = 'Shielding';
        break;
    case "fishing":
        $id = Highscores::SKILL_FISHING;
        $list_name = 'Fishing';
        break;
    case "magic":
        $id = Highscores::SKILL__MAGLEVEL;
        $list_name = 'Magic';
        break;
    default:
        $id = Highscores::SKILL__LEVEL;
        $list_name = 'Experience';
        break;
}

$world_name = $config['server']['serverName'];
$offset = $page * 100;
$skills = new Highscores($id, 100, $page, $vocation);

$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD><CENTER><H2>Ranking for '.htmlspecialchars($list_name).' on '.htmlspecialchars($world_name).'</H2></CENTER><BR>';

$main_content .= '<br><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%></TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=whites><B>Rank</B></TD><TD WIDTH=75% CLASS=whites><B>Name</B></TD><TD WIDTH=15% CLASS=whites><b><center>Level</center></B></TD>';
if ($list == "experience") $main_content .= '<TD CLASS=whites><b><center>Experience</center></B></TD>';
$main_content .= '</TR>';
$number_of_rows = 0;

foreach ($skills as $skill) {
    if ($list == "magic") $value = $skill->getMagLevel();
    elseif ($list == "experience") $value = $skill->getLevel();
    else $value = $skill->getScore();
    
    $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']);
    
    $main_content .= '<tr bgcolor="'.$bgcolor.'"><td style="text-align:right">'.($offset + $number_of_rows).'.</td><td><a href="?subtopic=characters&name='.urlencode($skill->getName()).'">'.($skill->getOnline() > 0 ? "<font color=\"green\">".htmlspecialchars($skill->getName())."</font>" : "<font color=\"red\">".htmlspecialchars($skill->getName())."</font>").'</a><br><small>'.$skill->getLevel().' '.htmlspecialchars(Website::getVocationName($skill->getVocation())).'</small></td><td><center>'.$value.'</center></td>';
    
    if ($list == "experience") $main_content .= '<td><center>'.$skill->getExperience().'</center></td>';
    
    $main_content .= '</tr>';
}

$main_content .= '</TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%>';
if ($page > 0) $main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list='.urlencode($list).'&page='.($page - 1).'&vocation=' . urlencode($vocation) . '" CLASS="size_xxs">Previous Page</A></TD></TR>';
if ($page < 50) $main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list='.urlencode($list).'&page='.($page + 1).'&vocation=' . urlencode($vocation) . '" CLASS="size_xxs">Next Page</A></TD></TR>';
$main_content .= '</TABLE></TD><TD WIDTH=5%><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=1 HEIGHT=1 BORDER=0></TD><TD WIDTH=15% VALIGN=top ALIGN=right><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=whites><B>Choose a skill</B></TD></TR><TR BGCOLOR="'.$config['site']['lightborder'].'"><TD><A HREF="?subtopic=highscores&list=experience" CLASS="size_xs">Experience</A><BR><A HREF="?subtopic=highscores&list=magic" CLASS="size_xs">Magic</A><BR><A HREF="?subtopic=highscores&list=shield" CLASS="size_xs">Shielding</A><BR><A HREF="?subtopic=highscores&list=distance" CLASS="size_xs">CLASS="size_xs">Distance</A><BR><A HREF="?subtopic=highscores&list=club" CLASS="size_xs">Club</A><BR><A HREF="?subtopic=highscores&list=sword" CLASS="size_xs">Sword</A><BR><A HREF="?subtopic=highscores&list=axe" CLASS="size_xs">Axe</A><BR><A HREF="?subtopic=highscores&list=fist" CLASS="size_xs">Fist</A><BR><A HREF="?subtopic=highscores&list=fishing" CLASS="size_xs">Fishing</A><BR></TD></TR></TABLE></TD><TD><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD></TR></TABLE>';

// Verifica se é hora de resetar os highscores
if (deveResetarHighscores()) {
    // Reseta os highscores
    resetarHighscores();
}
?>

 

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

Link para o post
Compartilhar em outros sites
Em 16/03/2024 em 07:59, L3K0T disse:

<?php
if (!defined('INITIALIZED')) exit;

// Função para verificar se é hora de resetar os highscores
function deveResetarHighscores() {
    // Coloque aqui a lógica para determinar se é hora de resetar os highscores
    // Por exemplo, verificar se passou uma certa quantidade de tempo desde o último reset
    // Retorne true se for hora de resetar, caso contrário, retorne false
    $lastResetTimestamp = /* Coloque aqui o timestamp do último reset */;
    $interval = 5 * 60; // 5 minutos em segundos
    $currentTimestamp = time();

    // Verifica se passou o intervalo de tempo definido desde o último reset
    return ($currentTimestamp - $lastResetTimestamp) >= $interval;
}

// Função para resetar os highscores
function resetarHighscores() {
    // Coloque aqui a lógica para resetar os highscores
    // Por exemplo, atualizar os valores na base de dados ou em outro sistema de armazenamento
    // Certifique-se de realizar as operações necessárias para reiniciar os highscores conforme sua lógica de negócios
}

$list = 'experience';
if (isset($_REQUEST['list'])) $list = $_REQUEST['list'];

$page = 0;
if (isset($_REQUEST['page'])) $page = min(50, $_REQUEST['page']);

$vocation = '';
if (isset($_REQUEST['vocation'])) $vocation = $_REQUEST['vocation'];

switch ($list) {
    case "fist":
        $id = Highscores::SKILL_FIST;
        $list_name = 'Fist Fighting';
        break;
    case "club":
        $id = Highscores::SKILL_CLUB;
        $list_name = 'Club Fighting';
        break;
    case "sword":
        $id = Highscores::SKILL_SWORD;
        $list_name = 'Sword Fighting';
        break;
    case "axe":
        $id = Highscores::SKILL_AXE;
        $list_name = 'Axe Fighting';
        break;
    case "distance":
        $id = Highscores::SKILL_DISTANCE;
        $list_name = 'Distance Fighting';
        break;
    case "shield":
        $id = Highscores::SKILL_SHIELD;
        $list_name = 'Shielding';
        break;
    case "fishing":
        $id = Highscores::SKILL_FISHING;
        $list_name = 'Fishing';
        break;
    case "magic":
        $id = Highscores::SKILL__MAGLEVEL;
        $list_name = 'Magic';
        break;
    default:
        $id = Highscores::SKILL__LEVEL;
        $list_name = 'Experience';
        break;
}

$world_name = $config['server']['serverName'];
$offset = $page * 100;
$skills = new Highscores($id, 100, $page, $vocation);

$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD><CENTER><H2>Ranking for '.htmlspecialchars($list_name).' on '.htmlspecialchars($world_name).'</H2></CENTER><BR>';

$main_content .= '<br><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%></TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=whites><B>Rank</B></TD><TD WIDTH=75% CLASS=whites><B>Name</B></TD><TD WIDTH=15% CLASS=whites><b><center>Level</center></B></TD>';
if ($list == "experience") $main_content .= '<TD CLASS=whites><b><center>Experience</center></B></TD>';
$main_content .= '</TR>';
$number_of_rows = 0;

foreach ($skills as $skill) {
    if ($list == "magic") $value = $skill->getMagLevel();
    elseif ($list == "experience") $value = $skill->getLevel();
    else $value = $skill->getScore();
    
    $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']);
    
    $main_content .= '<tr bgcolor="'.$bgcolor.'"><td style="text-align:right">'.($offset + $number_of_rows).'.</td><td><a href="?subtopic=characters&name='.urlencode($skill->getName()).'">'.($skill->getOnline() > 0 ? "<font color=\"green\">".htmlspecialchars($skill->getName())."</font>" : "<font color=\"red\">".htmlspecialchars($skill->getName())."</font>").'</a><br><small>'.$skill->getLevel().' '.htmlspecialchars(Website::getVocationName($skill->getVocation())).'</small></td><td><center>'.$value.'</center></td>';
    
    if ($list == "experience") $main_content .= '<td><center>'.$skill->getExperience().'</center></td>';
    
    $main_content .= '</tr>';
}

$main_content .= '</TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%>';
if ($page > 0) $main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list='.urlencode($list).'&page='.($page - 1).'&vocation=' . urlencode($vocation) . '" CLASS="size_xxs">Previous Page</A></TD></TR>';
if ($page < 50) $main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list='.urlencode($list).'&page='.($page + 1).'&vocation=' . urlencode($vocation) . '" CLASS="size_xxs">Next Page</A></TD></TR>';
$main_content .= '</TABLE></TD><TD WIDTH=5%><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=1 HEIGHT=1 BORDER=0></TD><TD WIDTH=15% VALIGN=top ALIGN=right><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=whites><B>Choose a skill</B></TD></TR><TR BGCOLOR="'.$config['site']['lightborder'].'"><TD><A HREF="?subtopic=highscores&list=experience" CLASS="size_xs">Experience</A><BR><A HREF="?subtopic=highscores&list=magic" CLASS="size_xs">Magic</A><BR><A HREF="?subtopic=highscores&list=shield" CLASS="size_xs">Shielding</A><BR><A HREF="?subtopic=highscores&list=distance" CLASS="size_xs">CLASS="size_xs">Distance</A><BR><A HREF="?subtopic=highscores&list=club" CLASS="size_xs">Club</A><BR><A HREF="?subtopic=highscores&list=sword" CLASS="size_xs">Sword</A><BR><A HREF="?subtopic=highscores&list=axe" CLASS="size_xs">Axe</A><BR><A HREF="?subtopic=highscores&list=fist" CLASS="size_xs">Fist</A><BR><A HREF="?subtopic=highscores&list=fishing" CLASS="size_xs">Fishing</A><BR></TD></TR></TABLE></TD><TD><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD></TR></TABLE>';

// Verifica se é hora de resetar os highscores
if (deveResetarHighscores()) {
    // Reseta os highscores
    resetarHighscores();
}
?>

 

não funcionou, oque eu gostaria de ter era por rank reset nos highscores, tipo tem de xp , sword , axe etc.. queria por rank reset

Link para o post
Compartilhar em outros sites
Em 16/03/2024 em 04:32, Gatinha Pirada disse:

data base

Como fica a sua database? resets? description? reset? Você não utiliza storage?

Link para o post
Compartilhar em outros sites
11 horas atrás, Mateus Robeerto disse:

Como fica a sua database? resets? description? reset? Você não utiliza storage?

boa noite 

eu uso esse scripts

 

 isso é na database 

Spoiler

ALTER TABLE players ADD resets tinyint(11) NOT NULL;

 

----------------------------------------------------------------------------------------------------------

esse é na pasta do site htdocs

 

player.php

Spoiler

<?php
if(!defined('INITIALIZED'))
    exit;

class Player extends ObjectData
{
    const LOADTYPE_ID = 'id';
    const LOADTYPE_NAME = 'name';
    const LOADTYPE_ACCOUNT_ID = 'account_id';
    public static $table = 'players';
    public $data = array('name' => null, 'group_id' => null, 'account_id' => null, 'level' => null, 'vocation' => null, 'health' => null, 'healthmax' => null, 'experience' => null, 'lookbody' => null, 'lookfeet' => null, 'lookhead' => null, 'looklegs' => null, 'looktype' => null, 'lookaddons' => null, 'maglevel' => null, 'mana' => null, 'manamax' => null, 'manaspent' => null, 'soul' => null, 'town_id' => null, 'posx' => null, 'posy' => null, 'posz' => null, 'conditions' => null, 'cap' => null, 'sex' => null, 'lastlogin' => null, 'lastip' => null, 'save' => null, 'skull' => null, 'skulltime' => null, 'lastlogout' => null, 'blessings' => null, 'balance' => null, 'stamina' => null, 'skill_fist' => null, 'skill_fist_tries' => null, 'skill_club' => null, 'skill_club_tries' => null, 'skill_sword' => null, 'skill_sword_tries' => null, 'skill_axe' => null, 'skill_axe_tries' => null, 'skill_dist' => null, 'skill_dist_tries' => null, 'skill_shielding' => null, 'skill_shielding_tries' => null, 'skill_fishing' => null, 'skill_fishing_tries' => null , 'deleted' => null, 'create_ip' => null, 'create_date' => null, 'comment' => null, 'hide_char' => null, 'resets' => null);
    public static $fields = array('id', 'name', 'group_id', 'account_id', 'level', 'vocation', 'health', 'healthmax', 'experience', 'lookbody', 'lookfeet', 'lookhead', 'looklegs', 'looktype', 'lookaddons', 'maglevel', 'mana', 'manamax', 'manaspent', 'soul', 'town_id', 'posx', 'posy', 'posz', 'conditions', 'cap', 'sex', 'lastlogin', 'lastip', 'save', 'skull', 'skulltime', 'lastlogout', 'blessings', 'balance', 'stamina', 'skill_fist', 'skill_fist_tries', 'skill_club', 'skill_club_tries', 'skill_sword', 'skill_sword_tries', 'skill_axe', 'skill_axe_tries', 'skill_dist', 'skill_dist_tries', 'skill_shielding', 'skill_shielding_tries', 'skill_fishing', 'skill_fishing_tries', 'deleted', 'create_ip', 'create_date', 'comment', 'hide_char', 'resets');
    public static $skillNames = array('fist', 'club', 'sword', 'axe', 'dist', 'shielding', 'fishing');
    public $items;
    public $storages;
    public $account;
    public $rank;
    public $guildNick;
    public static $onlineList;

    public function __construct($search_text = null, $search_by = self::LOADTYPE_ID)
    {
        if($search_text != null)
            $this->load($search_text, $search_by);
    }

    public function load($search_text, $search_by = self::LOADTYPE_ID)
    {
        if(in_array($search_by, self::$fields))
            $search_string = $this->getDatabaseHandler()->fieldName($search_by) . ' = ' . $this->getDatabaseHandler()->quote($search_text);
        else
            new Error_Critic('', 'Wrong Player search_by type.');
        $fieldsArray = array();
        foreach(self::$fields as $fieldName)
            $fieldsArray[] = $this->getDatabaseHandler()->fieldName($fieldName);

        $this->data = $this->getDatabaseHandler()->query('SELECT ' . implode(', ', $fieldsArray) . ' FROM ' . $this->getDatabaseHandler()->tableName(self::$table) . ' WHERE ' . $search_string)->fetch();
    }

    public function loadById($id)
    {
        $this->load($id, self::LOADTYPE_ID);
    }

    public function loadByName($name)
    {
        $this->load($name, self::LOADTYPE_NAME);
    }

    public function save($forceInsert = false)
    {
        if(!isset($this->data['id']) || $forceInsert)
        {
            $keys = array();
            $values = array();
            foreach(self::$fields as $key)
                if($key != 'id')
                {
                    $keys[] = $this->getDatabaseHandler()->fieldName($key);
                    $values[] = $this->getDatabaseHandler()->quote($this->data[$key]);
                }
            $this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName(self::$table) . ' (' . implode(', ', $keys) . ') VALUES (' . implode(', ', $values) . ')');
            $this->setID($this->getDatabaseHandler()->lastInsertId());
        }
        else
        {
            $updates = array();
            foreach(self::$fields as $key)
                $updates[] = $this->getDatabaseHandler()->fieldName($key) . ' = ' . $this->getDatabaseHandler()->quote($this->data[$key]);
            $this->getDatabaseHandler()->query('UPDATE ' . $this->getDatabaseHandler()->tableName(self::$table) . ' SET ' . implode(', ', $updates) . ' WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));
        }
    }

    public function getItems($forceReload = false)
    {
        if(!isset($this->items) || $forceReload)
            $this->items = new ItemsList($this->getID());

        return $this->items;
    }

    public function saveItems()
    {
        if(isset($this->items))
        {
            // if any script changed ID of player, function should save items with new player id
            $this->items->setPlayerId($this->getID());
            $this->items->save();
        }
        else
            new Error_Critic('', 'Player::saveItems() - items not loaded, cannot save');
    }

    public function loadStorages()
    {
        $this->storages = array();
        // load all
        $storages = $this->getDatabaseHandler()->query('SELECT ' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . $this->getDatabaseHandler()->fieldName('key') . 
            ', ' . $this->getDatabaseHandler()->fieldName('value') . ' FROM ' .$this->getDatabaseHandler()->tableName('player_storage') .
            ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']))->fetchAll();
        foreach($storages as $storage)
        {
            $this->storages[$storage['key']] = $storage['value'];
        }
    }

    public function saveStorages()
    {
        if(isset($this->storages))
        {
            $this->getDatabaseHandler()->query('DELETE FROM ' .$this->getDatabaseHandler()->tableName('player_storage') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));
            foreach($this->storages as $key => $value)
            {
                //save each
                $this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName('player_storage') . ' (' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . 
                    $this->getDatabaseHandler()->fieldName('key') . ', ' . $this->getDatabaseHandler()->fieldName('value') . ', ) VALUES (' . 
                    $this->getDatabaseHandler()->quote($this->data['id']) . ', ' . $this->getDatabaseHandler()->quote($key) . ', ' . $this->getDatabaseHandler()->quote($value) . ')');
            }
        }
        else
            new Error_Critic('', 'Player::saveStorages() - storages not loaded, cannot save');
    }

    public function getStorage($key)
    {
        if(!isset($this->storages))
        {
            $this->loadStorages();
        }
        if(isset($this->storages[$key]))
            return $this->storages[$key];
        else
            return null;
    }

    public function getStorages()
    {
        if(!isset($this->storages))
        {
            $this->loadStorages();
        }
        return $this->storages;
    }

    public function setStorage($key, $value)
    {
        if(!isset($this->storages))
        {
            $this->loadStorages();
        }
        $this->storages[$key] = $value;
    }

    public function removeStorage($key)
    {
        if(!isset($this->storages))
        {
            $this->loadStorages();
        }
        if(isset($this->storages[$key]))
            unset($this->storages[$key]);
    }

    public function getSkill($id)
    {
        if(isset(self::$skillNames[$id]))
            return $this->data['skill_' . self::$skillNames[$id]];
        else
            new Error_Critic('', 'Player::getSkill() - Skill ' . htmlspecialchars($id) . ' does not exist');
    }

    public function setSkill($id, $value)
    {
        if(isset(self::$skillNames[$id]))
            $this->data['skill_' . self::$skillNames[$id]] = $value;
    }

    public function getSkillCount($id)
    {
        if(isset(self::$skillNames[$id]))
            return $this->data['skill_' . self::$skillNames[$id] . '_tries'];
        else
            new Error_Critic('', 'Player::getSkillCount() - Skill ' . htmlspecialchars($id) . ' does not exist');
    }

    public function setSkillCount($id, $count)
    {
        if(isset(self::$skillNames[$id]))
            $this->data['skill_' . self::$skillNames[$id] . '_tries'] = $value;
    }

    public function loadAccount()
    {
        $this->account = new Account($this->getAccountID());
    }

    public function getAccount($forceReload = false)
    {
        if(!isset($this->account) || $forceReload)
            $this->loadAccount();

        return $this->account;
    }

    public function setAccount($account)
    {
        $this->account = $account;
        $this->setAccountID($account->getID());
    }

    public function loadRank()
    {
        $ranks = $this->getDatabaseHandler()->query('SELECT ' . $this->getDatabaseHandler()->fieldName('rank_id') . ', ' . $this->getDatabaseHandler()->fieldName('nick') . ' FROM ' . $this->getDatabaseHandler()->tableName('guild_membership') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()))->fetch();
        if($ranks)
        {
            $this->rank = new GuildRank($ranks['rank_id']);
            $this->guildNick = $ranks['nick'];
        }
        else
        {
            $this->rank = null;
            $this->guildNick = '';
        }
    }

    public function getRank($forceReload = false)
    {
        if(!isset($this->guildNick) || !isset($this->rank) || $forceReload)
            $this->loadRank();

        return $this->rank;
    }

    public function setRank($rank = null)
    {
        $this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName('guild_membership') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()));
        if($rank !== null)
        {
            $this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName('guild_membership') . ' (' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . $this->getDatabaseHandler()->fieldName('guild_id') . ', ' . $this->getDatabaseHandler()->fieldName('rank_id') . ', ' . $this->getDatabaseHandler()->fieldName('nick') . ') VALUES (' . $this->getDatabaseHandler()->quote($this->getID()) . ', ' . $this->getDatabaseHandler()->quote($rank->getGuildID()) . ', ' . $this->getDatabaseHandler()->quote($rank->getID()) . ', ' . $this->getDatabaseHandler()->quote('') . ')');
        }
        $this->rank = $rank;
    }

    public function hasGuild()
    {
        return $this->getRank() != null && $this->getRank()->isLoaded();
    }

    public function setGuildNick($value)
    {
        $this->guildNick = $value;
        $this->getDatabaseHandler()->query('UPDATE ' . $this->getDatabaseHandler()->tableName('guild_membership') . ' SET ' . $this->getDatabaseHandler()->fieldName('nick') . ' = ' . $this->getDatabaseHandler()->quote($this->guildNick) . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()));
    }

    public function getGuildNick()
    {
        if(!isset($this->guildNick) || !isset($this->rank))
            $this->loadRank();

        return $this->guildNick;
    }

    public function removeGuildInvitations()
    {
        $this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName('guild_invites') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->getID()));
    }

    public function unban()
    {
        $this->getAccount()->unban();
    }

    public function isBanned()
    {
        return $this->getAccount()->isBanned();
    }

    public function isNamelocked()
    {
        return false;
    }

    public function delete()
    {
        $this->db->query('UPDATE ' . $this->getDatabaseHandler()->tableName(self::$table) . ' SET ' . $this->getDatabaseHandler()->fieldName('deleted') . ' = 1 WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']));

        unset($this->data['id']);
    }
/*
 * default tfs 0.3.6 fields
*/
    public function setID($value){$this->data['id'] = $value;}
    public function getID(){return $this->data['id'];}
    // Kawo add
    public function getResets(){return $this->data['resets'];}
    //#####
    public function setAccountID($value){$this->data['account_id'] = $value;}
    public function getAccountID(){return $this->data['account_id'];}
    public function setName($value){$this->data['name'] = $value;}
    public function getName(){return $this->data['name'];}
    public function setGroupID($value){$this->data['group_id'] = $value;}
    public function getGroupID(){return $this->data['group_id'];}
    public function setVocation($value){$this->data['vocation'] = $value;}
    public function getVocation(){return $this->data['vocation'];}
    public function setLevel($value){$this->data['level'] = $value;}
    public function getLevel(){return $this->data['level'];}
    public function setExperience($value){$this->data['experience'] = $value;}
    public function getExperience(){return $this->data['experience'];}
    public function setHealth($value){$this->data['health'] = $value;}
    public function getHealth(){return $this->data['health'];}
    public function setHealthMax($value){$this->data['healthmax'] = $value;}
    public function getHealthMax(){return $this->data['healthmax'];}
    public function setMana($value){$this->data['mana'] = $value;}
    public function getMana(){return $this->data['mana'];}
    public function setManaMax($value){$this->data['manamax'] = $value;}
    public function getManaMax(){return $this->data['manamax'];}
    public function setMagLevel($value){$this->data['maglevel'] = $value;}
    public function getMagLevel(){return $this->data['maglevel'];}
    public function setManaSpent($value){$this->data['manaspent'] = $value;}
    public function getManaSpent(){return $this->data['manaspent'];}
    public function setSex($value){$this->data['sex'] = $value;}
    public function getSex(){return $this->data['sex'];}
    public function setTown($value){$this->data['town_id'] = $value;}
    public function getTown(){return $this->data['town_id'];}
    public function setPosX($value){$this->data['posx'] = $value;}
    public function getPosX(){return $this->data['posx'];}
    public function setPosY($value){$this->data['posy'] = $value;}
    public function getPosY(){return $this->data['posy'];}
    public function setPosZ($value){$this->data['posz'] = $value;}
    public function getPosZ(){return $this->data['posz'];}
    public function setCapacity($value){$this->data['cap'] = $value;}
    public function getCapacity(){return $this->data['cap'];}
    public function setSoul($value){$this->data['soul'] = $value;}
    public function getSoul(){return $this->data['soul'];}
    public function setConditions($value){$this->data['conditions'] = $value;}
    public function getConditions(){return $this->data['conditions'];}
    public function setLastIP($value){$this->data['lastip'] = $value;}
    public function getLastIP(){return $this->data['lastip'];}
    public function setLastLogin($value){$this->data['lastlogin'] = $value;}
    public function getLastLogin(){return $this->data['lastlogin'];}
    public function setLastLogout($value){$this->data['lastlogout'] = $value;}
    public function getLastLogout(){return $this->data['lastlogout'];}
    public function setSkull($value){$this->data['skull'] = $value;}
    public function getSkull(){return $this->data['skull'];}
    public function setSkullTime($value){$this->data['skulltime'] = $value;}
    public function getSkullTime(){return $this->data['skulltime'];}
    public function setSave($value = 1){$this->data['save'] = (int) $value;}
    public function getSave(){return $this->data['save'];}
    public function setBlessings($value){$this->data['blessings'] = $value;}
    public function getBlessings(){return $this->data['blessings'];}
    public function setBalance($value){$this->data['balance'] = $value;}
    public function getBalance(){return $this->data['balance'];}
    public function setStamina($value){$this->data['stamina'] = $value;}
    public function getStamina(){return $this->data['stamina'];}
    public function setDeleted($value){$this->data['deleted'] = (int) $value;}
    public function isDeleted(){return (bool) $this->data['deleted'];}
    public function setLookBody($value){$this->data['lookbody'] = $value;}
    public function getLookBody(){return $this->data['lookbody'];}
    public function setLookFeet($value){$this->data['lookfeet'] = $value;}
    public function getLookFeet(){return $this->data['lookfeet'];}
    public function setLookHead($value){$this->data['lookhead'] = $value;}
    public function getLookHead(){return $this->data['lookhead'];}
    public function setLookLegs($value){$this->data['looklegs'] = $value;}
    public function getLookLegs(){return $this->data['looklegs'];}
    public function setLookType($value){$this->data['looktype'] = $value;}
    public function getLookType(){return $this->data['looktype'];}
    public function setLookAddons($value){$this->data['lookaddons'] = $value;}
    public function getLookAddons(){return $this->data['lookaddons'];}
/*
 * Custom AAC fields
 * create_ip , INT, default 0
 * create_date , INT, default 0
 * hide_char , INT, default 0
 * comment , TEXT, default ''
*/
    public function setCreateIP($value){$this->data['create_ip'] = $value;}
    public function getCreateIP(){return $this->data['create_ip'];}
    public function setCreateDate($value){$this->data['create_date'] = $value;}
    public function getCreateDate(){return $this->data['create_date'];}
    public function setHidden($value){$this->data['hide_char'] = (int) $value;}
    public function isHidden(){return (bool) $this->data['hide_char'];}
    public function setComment($value){$this->data['comment'] = $value;}
    public function getComment(){return $this->data['comment'];}
/*
 * for compability with old scripts
*/
    public function setGroup($value){$this->setGroupID($value);}
    public function getGroup(){return $this->getGroupID();}
    public function getCreated(){return $this->getCreateDate();}
    public function setCreated($value){$this->setCreateDate($value);}
    public function setCap($value){$this->setCapacity($value);}
    public function getCap(){return $this->getCapacity();}
    public function isSaveSet(){return $this->getSave();}
    public function unsetSave(){$this->setSave(0);}
    public function getTownId(){return $this->getTown();}
    public function getHideChar(){return $this->isHidden();}
    public function find($name){$this->loadByName($name);}

    public static function isPlayerOnline($playerID)
    {
        if(!isset(self::$onlineList))
        {
            self::$onlineList = array();
            $onlines = Website::getDBHandle()->query('SELECT ' . Website::getDBHandle()->fieldName('player_id') . ' FROM ' . Website::getDBHandle()->tableName('players_online'))->fetchAll();
            foreach($onlines as $online)
            {
                self::$onlineList[$online['player_id']] = $online['player_id'];
            }
        }

        return isset(self::$onlineList[$playerID]);
    }

    public function isOnline()
    {
        return self::isPlayerOnline($this->getID());
    }

    public function getOnline()
    {
        return self::isPlayerOnline($this->getID());
    }
}
 
 

 

 

-----------------------------------------------------------------------------------------------------------------------------------------------

esse tbm é na pasta htdocs

accountmanagement.php

Spoiler

<img id="ContentBoxHeadline" class="Title" src="layouts/tibiacom/images/header/headline-accountmanagement.gif" alt="Contentbox headline">
<?php
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" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Logout Successful</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>You have logged out of your '.htmlspecialchars($config['server']['serverName']).' account. In order to view your account you need to <a href="?subtopic=accountmanagement" >log in</a> again.</td></tr>          </table>        </div>  </table></div></td></tr>';
    else
    {
        if(isset($isTryingToLogin))
        {
            switch(Visitor::getLoginState())
            {
                case Visitor::LOGINSTATE_NO_ACCOUNT:
                    $main_content .= 'Account with that name doesn\'t exist.';
                    break;
                case Visitor::LOGINSTATE_WRONG_PASSWORD:
                    $main_content .= 'Wrong password to account.';
                    break;
            }
        }
        $main_content .= 'Please enter your account name and your password.<br/><a href="?subtopic=createaccount" >Create an account</a> if you do not have one yet.<br/><br/><form action="?subtopic=accountmanagement" method="post" ><div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Account Login</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td class="LabelV" ><span >Account Name:</span></td><td style="width:100%;" ><input type="password" name="account_login" SIZE="10" maxlength="10" ></td></tr><tr><td class="LabelV" ><span >Password:</span></td><td><input type="password" name="password_login" size="30" maxlength="29" ></td></tr>          </table>        </div>  </table></div></td></tr><br/><table width="100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=lostaccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Account lost?" alt="Account lost?" src="'.$layout_name.'/images/buttons/_sbutton_accountlost.gif" ></div></div></td></tr></form></table></td></tr></table>';
    }
else
{
    if($action == "")
    {
        $account_reckey = $account_logged->getCustomField("key");
        if($account_logged->getPremDays() > 0)
            $account_status = '<b><font color="green">Premium Account, '. $account_logged->getPremDays() .' days left</font></b>';
        else
            $account_status = '<b><font color="red">Free Account</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();
        if($account_logged->isBanned())
            if($account_logged->getBanTime() > 0)
                $welcome_msg = '<font color="red">Your account is banished until '.date("j F Y, G:i:s", $account_logged->getBanTime()).'!</font>';
            else
                $welcome_msg = '<font color="red">Your account is banished FOREVER!</font>';
        else
            $welcome_msg = 'Welcome to your account!';
        $main_content .= '<div class="SmallBox" >  <div class="MessageContainer" ><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="Message" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><table><td width="100%"></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=logout" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Logout" alt="Logout" src="'.$layout_name.'/images/buttons/_sbutton_logout.gif" ></div></div></td></tr></form></table></td></tr></table>    </div><div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/><center><table><tr><td><img src="'.$layout_name.'/images/content/headline-bracer-left.gif" /></td><td style="text-align:center;vertical-align:middle;horizontal-align:center;font-size:17px;font-weight:bold;" >'.$welcome_msg.'<br/></td><td><img src="'.$layout_name.'/images/content/headline-bracer-right.gif" /></td></tr></table><br/></center>';
        //if account dont have recovery key show hint
        if(empty($account_reckey))
            $main_content .= '<div class="SmallBox" ><div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="Message" ><div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div><table><tr><td class="LabelV" >Hint:</td><td style="width:100%;" > <font color="red"> <b><h3>CREATE YOUR RECOVERY KEY AND SAVE IT! WE CANT GIVE YOUR CHAR BACK IF YOU GOT HACKED!!!!!! Click on "Register Account" and get your free recovery key today!</b></font></h3></td></tr></table><div align="center" ><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="'.$layout_name.'/images/buttons/_sbutton_registeraccount.gif" ></div></div></td></tr></form></table></div></div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div><div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div><div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/>'; 
        if($account_email_new_time > 1)
            if($account_email_new_time < time())
                $account_email_change = '<br>(You can accept <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/>';
            }
        $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" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >General Information</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div><tr>      <td>        <div class="InnerTableContainer" >          <table style="width:57%;" ><tr><td><div class="TableShadowContainerRightTop" >  <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" >    <table class="TableContent" width="100%" ><tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV" >Email Address:</td><td style="width:90%;" >'.htmlspecialchars($account_email).''.$account_email_change.'</td></tr><tr style="background-color:'.$config['site']['lightborder'].';" ><td class="LabelV" >Created:</td><td>'.date("j F Y, G:i:s", $account_created).'</td></td><tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV" >Last Login:</td><td>'.date("j F Y, G:i:s", time()).'</td></tr><tr style="background-color:'.$config['site']['lightborder'].';" ><td class="LabelV" >Account Status:</td><td>'.$account_status.'</td></tr><tr style="background-color:'.$config['site']['darkborder'].';" ><td class="LabelV" >Registred:</td><td>'.$account_registred.'</td></tr></table></div></div><div class="TableShadowContainer" ><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" ><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>  </div></div></td></tr><tr><td><table class="InnerTableButtonRow" cellpadding="0" cellspacing="0" ><tr><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changepassword" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Change Password" alt="Change Password" src="'.$layout_name.'/images/buttons/_sbutton_changepassword.gif" ></div></div></td></tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeemail" method="post" ><tr><td style="border:0px;" ><input type="hidden" name=newemail value="" ><input type="hidden" name=newemaildate value=0 ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Change Email" alt="Change Email" src="'.$layout_name.'/images/buttons/_sbutton_changeemail.gif" ></div></div></td></tr></form>    </table></td><td width="100%"></td>';        //show button "register account"
        if(empty($account_reckey))
            $main_content .= '<td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=registeraccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Register Account" alt="Register Account" src="'.$layout_name.'/images/buttons/_sbutton_registeraccount.gif" ></div></div></td></tr></form></table></td>';
        $main_content .= '</tr></table></td></tr></table></div></table></div></td></tr><br/><a name="Public+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="Table5" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Public Information</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" >  <div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" >    <table class="TableContent" width="100%" ><tr><td><table style="width:100%;"><tr><td class="LabelV" >Real Name:</td><td style="width:90%;" >'.$account_rlname.'</td></tr><tr><td class="LabelV" >Location:</td><td style="width:90%;" >'.$account_location.'</td></tr></table></td><td align=right><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=changeinfo" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Edit" alt="Edit" src="'.$layout_name.'/images/buttons/_sbutton_edit.gif" ></div></div></td></tr></form></table></td></tr>    </table>  </div></div><div class="TableShadowContainer" >  <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >    <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>    <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>  </div></div></td></tr>          </table>        </div>  </table></div></td></tr><br/><br/>';
        $main_content .= '<a name="Characters" ></a><div class="TopButtonContainer" ><div class="TopButton" ><a href="#top" ><image style="border:0px;" src="'.$layout_name.'/images/content/back-to-top.gif" /></a></div></div><div class="TableContainer" >  <table class="Table3" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" ><div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Characters</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div>   <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" ><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" >    <table class="TableContent" width="100%" ><tr class="LabelH" ><td style="width:65%" >Name</td><td style="width:15%" >Level</td><td style="width:7%">Status</td><td style="width:5%"> </td></tr>';
        $account_players = $account_logged->getPlayersList();
        //show list of players on account
        foreach($account_players as $account_player)
        {
            $player_number_counter++;
            $main_content .= '<tr style="background-color:';
            if(is_int($player_number_counter / 2))
                $main_content .= $config['site']['darkborder'];
            else
                $main_content .= $config['site']['lightborder'];
            $main_content .= ';" ><td><NOBR>'.$player_number_counter.'. '.htmlspecialchars($account_player->getName());
            if($account_player->isDeleted())
                $main_content .= '<font color="red"><b> [ DELETED ] </b> <a href="?subtopic=accountmanagement&action=undelete&name='.urlencode($account_player->getName()).'">>> UNDELETE <<</a></font>';
            $main_content .= '</NOBR></td><td><NOBR>'.$account_player->getLevel().' '.htmlspecialchars($vocation_name[$account_player->getVocation()]).'</NOBR></td>';
            if(!$account_player->isOnline())
                $main_content .= '<td><font color="red"><b>Offline</b></font></td>';
            else
                $main_content .= '<td><font color="green"><b>Online</b></font></td>';
            $main_content .= '<td>[<a href="?subtopic=accountmanagement&action=changecomment&name='.urlencode($account_player->getName()).'" >Edit</a>]</td></tr>';
        }
        $main_content .= '</table>  </div></div><div class="TableShadowContainer" >  <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >    <div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>    <div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>  </div></div></td></tr><tr><td><table class="InnerTableButtonRow" cellpadding="0" cellspacing="0" ><tr><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=createcharacter" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Create Character" alt="Create Character" src="'.$layout_name.'/images/buttons/_sbutton_createcharacter.gif" ></div></div></td></tr></form></table></td><td style="width:57%;" ></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=deletecharacter" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Delete Character" alt="Delete Character" src="'.$layout_name.'/images/buttons/_sbutton_deletecharacter.gif" ></div></div></td></tr></form></table></td><td style="width:100%;" ></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=reset" 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="Reset Character" alt="Reset Character" src="'.$layout_name.'/images/buttons/_sbutton_resetcharacter.gif" ></div></div></td></tr></form></table></td> </tr></table></td></tr>          </table>        </div>  </table></div></td></tr><br/><br/>';    
    }
//########### CHANGE PASSWORD ##########
    if($action == "changepassword") {
        $new_password = trim($_POST['newpassword']);
        $new_password2 = trim($_POST['newpassword2']);
        $old_password = trim($_POST['oldpassword']);
        if(empty($new_password) && empty($new_password2) && empty($old_password))
        {
            $main_content .= 'Please enter your current password and a new password. For your security, please enter the new password twice.<br/><br/><form action="?subtopic=accountmanagement&action=changepassword" method="post" ><div class="TableContainer" ><table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" ><div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Change Password</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td class="LabelV" ><span >New Password:</span></td><td style="width:90%;" ><input type="password" name="newpassword" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >New Password Again:</span></td><td><input type="password" name="newpassword2" size="30" maxlength="29" ></td></tr><tr><td class="LabelV" ><span >Current Password:</span></td><td><input type="password" name="oldpassword" size="30" maxlength="29" ></td></tr></table>        </div>  </table></div></td></tr><br/><table style="width:100%;" ><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
        }
        else
        {
            if(empty($new_password) || empty($new_password2) || empty($old_password))
            {
                $show_msgs[] = "Please fill in form.";
            }
            if($new_password != $new_password2)
            {
                $show_msgs[] = "The new passwords do not match!";
            }
            if(empty($show_msgs))
            {
                if(!check_password($new_password))
                {
                    $show_msgs[] = "New password contains illegal chars (a-z, A-Z and 0-9 only!) or lenght.";
                }
                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>

 

esse é o sistema completo do meu reset

 

Link para o post
Compartilhar em outros sites

Ótimo, basta substituir todo o seu highscore.php

<?php
if (!defined('INITIALIZED')) exit;

$list = 'experience';
if (isset($_REQUEST['list'])) $list = $_REQUEST['list'];

$page = 0;
if (isset($_REQUEST['page'])) $page = min(50, $_REQUEST['page']);

$vocation = '';
if (isset($_REQUEST['vocation'])) $vocation = $_REQUEST['vocation'];

switch ($list) {
    case "fist":
        $id = Highscores::SKILL_FIST;
        $list_name = 'Fist Fighting';
        break;
    case "club":
        $id = Highscores::SKILL_CLUB;
        $list_name = 'Club Fighting';
        break;
    case "sword":
        $id = Highscores::SKILL_SWORD;
        $list_name = 'Sword Fighting';
        break;
    case "axe":
        $id = Highscores::SKILL_AXE;
        $list_name = 'Axe Fighting';
        break;
    case "distance":
        $id = Highscores::SKILL_DISTANCE;
        $list_name = 'Distance Fighting';
        break;
    case "shield":
        $id = Highscores::SKILL_SHIELD;
        $list_name = 'Shielding';
        break;
    case "fishing":
        $id = Highscores::SKILL_FISHING;
        $list_name = 'Fishing';
        break;
    case "magic":
        $id = Highscores::SKILL__MAGLEVEL;
        $list_name = 'Magic';
        break;
    case "reset":
        $id = Highscores::SKILL__RESET;
        $list_name = 'Resets';
        break;
    default:
        $id = Highscores::SKILL__LEVEL;
        $list_name = 'Experience';
        break;
}

$world_name = $config['server']['serverName'];

$offset = $page * 100;
$skills = new Highscores($id, 100, $page, $vocation);

// Iniciar a construção do conteúdo principal
$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD><CENTER><H2>Ranking for '.htmlspecialchars($list_name).' on '.htmlspecialchars($world_name).'</H2></CENTER><BR>';

$main_content .= '<br><table border="0" cellpadding="4" cellspacing="1" width="100%">
<tr bgcolor="'.$config['site']['vdarkborder'].'">
<td class="whites"><b>Rank</b></td>
<td width="75%" class="whites"><b>Name</b></td>
<td width="10%" class="whites"><b><center>Level</center></b></td>';

if ($list == "experience") {
    $main_content .= '<td width="10%" class="whites"><b><center>Experience</center></b></td>
    <td width="10%" class="whites"><b><center>Resets</center></b></td>';
}

$main_content .= '</tr>';

$number_of_rows = 0;

foreach ($skills as $skill) {
    $value = $list == "magic" ? $skill->getMagLevel() : ($list == "experience" ? $skill->getLevel() : $skill->getScore());
    $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']);

    $main_content .= '<tr bgcolor="'.$bgcolor.'">
    <td style="text-align:right">'.($offset + $number_of_rows).'. </td>
    <td><a href="?subtopic=characters&name='.urlencode($skill->getName()).'">'.($skill->getOnline() > 0 ? "<font color=\"green\">".htmlspecialchars($skill->getName())."</font>" : "<font color=\"red\">".htmlspecialchars($skill->getName())."</font>").'</a><br><small>'.$skill->getLevel().' '.htmlspecialchars(Website::getVocationName($skill->getVocation())).'</small></td>
    <td><center>'.$value.'</center></td>';

    if ($list == "experience") {
        $main_content .= '<td><center>'.$skill->getExperience().'</center></td>';

        $main_content .= '<td><center>'.$skill->getResets().'</center></td>'; 
    }

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


$main_content .= '</table>';

$main_content .= '<table border="0" cellpadding="4" cellspacing="1" width="100%">
<tr bgcolor="'.$config['site']['vdarkborder'].'">
<td class="whites" colspan="2"><center><b>Choose a skill</b></center></td>
</tr>
<tr bgcolor="'.$config['site']['lightborder'].'">
<td style="text-align: center;">
<a href="?subtopic=highscores&list=experience" class="size_xs">Experience</a><br>
<a href="?subtopic=highscores&list=magic" class="size_xs">Magic</a><br>
<a href="?subtopic=highscores&list=shield" class="size_xs">Shielding</a><br>
<a href="?subtopic=highscores&list=distance" class="size_xs">Distance</a><br>
<a href="?subtopic=highscores&list=club" class="size_xs">Club</a><br>
<a href="?subtopic=highscores&list=sword" class="size_xs">Sword</a><br>
<a href="?subtopic=highscores&list=axe" class="size_xs">Axe</a><br>
<a href="?subtopic=highscores&list=fist" class="size_xs">Fist</a><br>
<a href="?subtopic=highscores&list=fishing" class="size_xs">Fishing</a><br>
<a href="?subtopic=highscores&list=reset" class="size_xs">Resets</a><br>
</td>
</tr>
</table>';

E depois vá em htdocs/classes/player.php

e procure por essa linha.

	public function loadStorages()
	{
		$this->storages = array();
		// load all
		$storages = $this->getDatabaseHandler()->query('SELECT ' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . $this->getDatabaseHandler()->fieldName('key') . 
			', ' . $this->getDatabaseHandler()->fieldName('value') . ' FROM ' .$this->getDatabaseHandler()->tableName('player_storage') .
			' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']))->fetchAll();
		foreach($storages as $storage)
		{
			$this->storages[$storage['key']] = $storage['value'];
		}
	}

É só adicionar abaixo e salvar. Pronto, o seu ranking com resets está pronto.

public function getResets()
{
    $result = $this->getDatabaseHandler()->query('SELECT resets FROM ' . $this->getDatabaseHandler()->tableName('players') . 
        ' WHERE id = ' . $this->getDatabaseHandler()->quote($this->data['id']))->fetch();

    if ($result) {
        return (int)$result['resets'];
    } else {
        $this->getDatabaseHandler()->execute('INSERT INTO ' . $this->getDatabaseHandler()->tableName('players') . 
            ' (id, resets) VALUES (' . $this->getDatabaseHandler()->quote($this->data['id']) . ', 0)' .
            ' ON DUPLICATE KEY UPDATE resets = 0'); 
        return 0; 
    }
}

Depois, não se esqueça de dar REP e marcar como solução :)

Editado por Mateus Robeerto (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
32 minutos atrás, Mateus Robeerto disse:

Ótimo, basta substituir todo o seu highscore.php


<?php
if (!defined('INITIALIZED')) exit;

$list = 'experience';
if (isset($_REQUEST['list'])) $list = $_REQUEST['list'];

$page = 0;
if (isset($_REQUEST['page'])) $page = min(50, $_REQUEST['page']);

$vocation = '';
if (isset($_REQUEST['vocation'])) $vocation = $_REQUEST['vocation'];

switch ($list) {
    case "fist":
        $id = Highscores::SKILL_FIST;
        $list_name = 'Fist Fighting';
        break;
    case "club":
        $id = Highscores::SKILL_CLUB;
        $list_name = 'Club Fighting';
        break;
    case "sword":
        $id = Highscores::SKILL_SWORD;
        $list_name = 'Sword Fighting';
        break;
    case "axe":
        $id = Highscores::SKILL_AXE;
        $list_name = 'Axe Fighting';
        break;
    case "distance":
        $id = Highscores::SKILL_DISTANCE;
        $list_name = 'Distance Fighting';
        break;
    case "shield":
        $id = Highscores::SKILL_SHIELD;
        $list_name = 'Shielding';
        break;
    case "fishing":
        $id = Highscores::SKILL_FISHING;
        $list_name = 'Fishing';
        break;
    case "magic":
        $id = Highscores::SKILL__MAGLEVEL;
        $list_name = 'Magic';
        break;
    case "reset":
        $id = Highscores::SKILL__RESET;
        $list_name = 'Resets';
        break;
    default:
        $id = Highscores::SKILL__LEVEL;
        $list_name = 'Experience';
        break;
}

$world_name = $config['server']['serverName'];

$offset = $page * 100;
$skills = new Highscores($id, 100, $page, $vocation);

// Iniciar a construção do conteúdo principal
$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD><CENTER><H2>Ranking for '.htmlspecialchars($list_name).' on '.htmlspecialchars($world_name).'</H2></CENTER><BR>';

$main_content .= '<br><table border="0" cellpadding="4" cellspacing="1" width="100%">
<tr bgcolor="'.$config['site']['vdarkborder'].'">
<td class="whites"><b>Rank</b></td>
<td width="75%" class="whites"><b>Name</b></td>
<td width="10%" class="whites"><b><center>Level</center></b></td>';

if ($list == "experience") {
    $main_content .= '<td width="10%" class="whites"><b><center>Experience</center></b></td>
    <td width="10%" class="whites"><b><center>Resets</center></b></td>';
}

$main_content .= '</tr>';

$number_of_rows = 0;

foreach ($skills as $skill) {
    $value = $list == "magic" ? $skill->getMagLevel() : ($list == "experience" ? $skill->getLevel() : $skill->getScore());
    $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']);

    $main_content .= '<tr bgcolor="'.$bgcolor.'">
    <td style="text-align:right">'.($offset + $number_of_rows).'. </td>
    <td><a href="?subtopic=characters&name='.urlencode($skill->getName()).'">'.($skill->getOnline() > 0 ? "<font color=\"green\">".htmlspecialchars($skill->getName())."</font>" : "<font color=\"red\">".htmlspecialchars($skill->getName())."</font>").'</a><br><small>'.$skill->getLevel().' '.htmlspecialchars(Website::getVocationName($skill->getVocation())).'</small></td>
    <td><center>'.$value.'</center></td>';

    if ($list == "experience") {
        $main_content .= '<td><center>'.$skill->getExperience().'</center></td>';

        $main_content .= '<td><center>'.$skill->getResets().'</center></td>'; 
    }

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


$main_content .= '</table>';

$main_content .= '<table border="0" cellpadding="4" cellspacing="1" width="100%">
<tr bgcolor="'.$config['site']['vdarkborder'].'">
<td class="whites" colspan="2"><center><b>Choose a skill</b></center></td>
</tr>
<tr bgcolor="'.$config['site']['lightborder'].'">
<td style="text-align: center;">
<a href="?subtopic=highscores&list=experience" class="size_xs">Experience</a><br>
<a href="?subtopic=highscores&list=magic" class="size_xs">Magic</a><br>
<a href="?subtopic=highscores&list=shield" class="size_xs">Shielding</a><br>
<a href="?subtopic=highscores&list=distance" class="size_xs">Distance</a><br>
<a href="?subtopic=highscores&list=club" class="size_xs">Club</a><br>
<a href="?subtopic=highscores&list=sword" class="size_xs">Sword</a><br>
<a href="?subtopic=highscores&list=axe" class="size_xs">Axe</a><br>
<a href="?subtopic=highscores&list=fist" class="size_xs">Fist</a><br>
<a href="?subtopic=highscores&list=fishing" class="size_xs">Fishing</a><br>
<a href="?subtopic=highscores&list=reset" class="size_xs">Resets</a><br>
</td>
</tr>
</table>';

E depois vá em htdocs/classes/player.php

e procure por essa linha.


	public function loadStorages()
	{
		$this->storages = array();
		// load all
		$storages = $this->getDatabaseHandler()->query('SELECT ' . $this->getDatabaseHandler()->fieldName('player_id') . ', ' . $this->getDatabaseHandler()->fieldName('key') . 
			', ' . $this->getDatabaseHandler()->fieldName('value') . ' FROM ' .$this->getDatabaseHandler()->tableName('player_storage') .
			' WHERE ' . $this->getDatabaseHandler()->fieldName('player_id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id']))->fetchAll();
		foreach($storages as $storage)
		{
			$this->storages[$storage['key']] = $storage['value'];
		}
	}

É só adicionar abaixo e salvar. Pronto, o seu ranking com resets está pronto.


public function getResets()
{
    $result = $this->getDatabaseHandler()->query('SELECT resets FROM ' . $this->getDatabaseHandler()->tableName('players') . 
        ' WHERE id = ' . $this->getDatabaseHandler()->quote($this->data['id']))->fetch();

    if ($result) {
        return (int)$result['resets'];
    } else {
        $this->getDatabaseHandler()->execute('INSERT INTO ' . $this->getDatabaseHandler()->tableName('players') . 
            ' (id, resets) VALUES (' . $this->getDatabaseHandler()->quote($this->data['id']) . ', 0)' .
            ' ON DUPLICATE KEY UPDATE resets = 0'); 
        return 0; 
    }
}

Depois, não se esqueça de dar REP e marcar como solução :)

apareceu foi esse erro agora

Fatal error: Cannot redeclare Player::getResets() in C:\xampp\htdocs\classes\player.php on line 310

Erro fatal : Constante de classe indefinida 'SKILL__RESET' em C:\xampp\htdocs\pages\highscores.php na linha 47

 

 

 

Link para o post
Compartilhar em outros sites

Você adicionou corretamente?

13 minutos atrás, Gatinha Pirada disse:

'SKILL__RESET

Desculpe, houve outro arquivo. Esqueci de postar. Então, vá em htdocs/classes/highscores.php

e procure por essa linha.

const SKILL__LEVEL = 8;

é so adicione baixo.

const SKILL__RESET = 9;

 

Link para o post
Compartilhar em outros sites
43 minutos atrás, Mateus Robeerto disse:

Você adicionou corretamente?

Desculpe, houve outro arquivo. Esqueci de postar. Então, vá em htdocs/classes/highscores.php

e procure por essa linha.


const SKILL__LEVEL = 8;

é so adicione baixo.


const SKILL__RESET = 9;

 

continua dando esse erro

Fatal error: Cannot redeclare Player::getResets() in C:\xampp\htdocs\classes\player.php on line 310

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.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo