Ir para conteúdo
  • Cadastre-se

Posts Recomendados

minha versão do xampp é 1.7.3

 

Spoiler

Erro

consulta SQL:

/*!40101 SET NAMES utf8mb4 */;
 

Mensagens do MySQL : Documentação

#1115 - Unknown character set: 'utf8mb4' 

 

Assim que eu tento entrar no site pelo localhost aparece esses erros

Spoiler

image.thumb.png.6b455cb2fb6bd911d82f8817ec4a1654.png

 

load.compat.php

Spoiler

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

// DEFINE VARIABLES FOR SCRIPTS AND LAYOUTS (no more notices 'undefinied variable'!)
if(!isset($_REQUEST['subtopic']) || empty($_REQUEST['subtopic']) || is_array($_REQUEST['subtopic']))
{
    $_REQUEST['subtopic'] = "latestnews";
}
else
    $_REQUEST['subtopic'] = (string) $_REQUEST['subtopic'];

if(Functions::isValidFolderName($_REQUEST['subtopic']))
{
    if(Website::fileExists("pages/" . $_REQUEST['subtopic'] . ".php"))
    {
        $subtopic = $_REQUEST['subtopic'];
    }
    else
        new Error_Critic('CRITICAL ERROR', 'Cannot load page <b>' . htmlspecialchars($_REQUEST['subtopic']) . '</b>, file does not exist.');
}
else
    new Error_Critic('CRITICAL ERROR', 'Cannot load page <b>' . htmlspecialchars($_REQUEST['subtopic']) . '</b>, invalid file name [contains illegal characters].');

// action that page should execute
if(isset($_REQUEST['action']))
    $action = (string) $_REQUEST['action'];
else
    $action = '';

$logged = false;
$account_logged = new Account();
$group_id_of_acc_logged = 0;
// with ONLY_PAGE option we want disable useless SQL queries
if(!ONLY_PAGE)
{
    // logged boolean value: true/false
    $logged = Visitor::isLogged();
    // Account object with account of logged player or empty Account
    $account_logged = Visitor::getAccount();
    // group of acc. logged
    if(Visitor::isLogged())
        $group_id_of_acc_logged = Visitor::getAccount()->getPageAccess();
}
$layout_name = './layouts/' . Website::getWebsiteConfig()->getValue('layout');

$title = ucwords($subtopic) . ' - ' . Website::getServerConfig()->getValue('serverName');

$topic = $subtopic;

$passwordency = Website::getServerConfig()->getValue('passwordType');
if($passwordency == 'plain')
    $passwordency = '';

$news_content = '';
$vocation_name = array();
foreach(Website::getVocations() as $vocation)
{
    $vocation_name[$vocation->getId()] = $vocation->getName();
}

$layout_ini = parse_ini_file($layout_name.'/layout_config.ini');
foreach($layout_ini as $key => $value)
    $config['site'][$key] = $value;

//###################### FUNCTIONS ######################
function microtime_float()
{
    return microtime(true);
}

function isPremium($premdays, $lastday)
{
    return Functions::isPremium($premdays, $lastday);
}

function saveconfig_ini($config)
{
    new Error_Critic('', 'function <i>saveconfig_ini</i> is deprecated. Do not use it.');
}

function password_ency($password, $account = null)
{
    new Error_Critic('', 'function <i>password_ency</i> is deprecated. Do not use it.');
}

function check_name($name)
{
    $name = (string) $name;
    $temp = strspn("$name", "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM- [ ] '");
    if($temp != strlen($name))
        return false;
    if(strlen($name) > 25)
        return false;

    return true;
}

function check_account_name($name)
{
    $name = (string) $name;
    $temp = strspn("$name", "QWERTYUIOPASDFGHJKLZXCVBNM0123456789");
    if ($temp != strlen($name))
        return false;
    if(strlen($name) < 1)
        return false;
    if(strlen($name) > 32)
        return false;

    return true;
}

function check_name_new_char($name)
{
    $name = (string) $name;
    $name_to_check = strtolower($name);
    //first word can't be:
    $first_words_blocked = array('gm ','cm ', 'god ','tutor ', "'", '-');
    //names blocked:
    $names_blocked = array('gm','cm', 'god', 'tutor', 'relembra', 'lixo', 'server', 'reset', 'suporte', 'support', 'senior', 'rashid', 'rashid', 'yasir', 'ukea', 'shirith', 'shiriel', 'shanar', 'roderick', 'repenter', 'Olrik', 'maealil', 'llathriel', 'lavirias', 'larfion the shaman', 'irea', 'huntsman', 'guide thelandil', 'finarfin', 'faluae', 'eroth', 'elvith', 'elf guard', 'elathriel', 'edala', 'dreadeye', 'cruleo', 'ceiron', 'captain seagull', 'briasol', 'brasith', 'benevola', 'bashira', 'ashari', 'anerui', 'an Old dragonlord', 'amarie', 'a wrinkled bonelord', 'a sweaty cyclops', 'william', 'trisha', 'toothless tim', 'tibra', 'shauna', 'sarina', 'rowenna', 'rachel', 'queen eloise', 'phillip', 'percybald', 'perac', 'padreia', 'nydala', 'nielson', 'lothar', 'liane', 'legola', 'lector', 'lea', 'karl', 'imalas', 'guide alexena', 'friedolin', 'florentine', 'fenbala', 'eva', 'emma', 'dane', 'dalbrect', 'cornelia', 'cerdras', 'captain greyhound', 'busty bonecrusher', 'bunny bonecrusher', 'blossom bonecrusher', 'benny the baker', 'barbara', 'bambi bonecrusher', 'arkarra', 'alia', 'xelvar', 'uzgod', 'tulf', 'tezila', 'talphion', 'storkus', 'sigurd', 'shortsighted dwarf', 'scutty', 'robson', 'riddler', 'rapanaio', 'pydar', 'pukosch', 'nezil', 'melfar', 'maryza', 'malech', 'lunch', 'lukosch', 'lokur', 'kroox', 'kawill', 'junkar', 'jimbin', 'jagran', 'iwar', 'isimov', 'humnog the guard', 'humgolf', 'grodrik', 'gewen', 'ferus', 'etzel', 'emperor kruzak', 'dwarven guard', 'duria', 'dukosch', 'dronk', 'burt', 'budrik', 'brom', 'brodrosch', 'bezil', 'basilisk', 'alberto', 'a dwarven ghost', 'al dee', 'amber', 'an Orc guard', 'asralius', 'azure frog', 'bog frog', 'coral frog', 'crimson frog', 'deathspawn', 'filth toad', 'green frog', 'infernal frog', 'Orchid frog', 'toad', 'the frog prince', 'quara constrictor', 'quara hydromancer', 'quara mantassin', 'quara pincher', 'quara predator', 'quara constrictor scout', 'quara hydromancer scout', 'quara mantassin scout', 'quara pincher scout', 'quara predator scout', 'renegade quara constrictor', 'renegade quara hydromancer', 'renegade quara mantassin', 'renegade quara pincher', 'renegade quara predator', 'inky', 'sharptooth', 'splasher', 'thul', 'deepling brawler', 'deepling elite', 'deepling guard', 'deepling master librarian', 'deepling scout', 'deepling spellsinger', 'deepling tyrant', 'deepling warrior', 'deepling worker', 'groam', 'jaul', 'Obujos', 'tanjis', 'salamander', 'crystal spider', 'dawn scorpion', 'frost spider', 'giant spider', 'instable sparkion', 'poison spider', 'sacred spider', 'sandstone scorpion', 'scorpion', 'sparkion', 'spider', 'tarantula', 'wailing widow', 'hide', 'mamma longlegs', 'spider queen', 'the bloodweb', 'the Old widow', 'webster', 'blood crab', 'crab', 'crustacea gigantica', 'deepsea blood crab', 'ancient scarab', 'berrypest', 'brimstone bug', 'bug', 'butterfly', 'dawnfly', 'emerald damselfly', 'insect swarm', 'insectoid scout', 'insectoid worker', 'kollos', 'lady bug', 'lancer beetle', 'larva', 'lesser swarmer', 'parasite', 'sandcrawler', 'scarab', 'shimmying butterfly', 'spidris', 'spidris elite', 'spitter', 'swarmer', 'swarmer hatchling', 'terramite', 'wasp', 'waspoid', 'anmothra', 'chopper', 'fleshcrawler', 'fleshslicer', 'hive Overseer', 'maw', 'mindmasher', 'rotspit', 'sulphur scuttler', 'the blightfather', 'willi wasp', 'anmothra', 'centipede', 'crawler', 'wiggler', 'abyssador', 'shadowstalker', 'apocalypse', 'bazir', 'infernatil', 'verminor', 'annihilon', 'golgordan', 'hellgorak', 'latrivan', 'madareth', 'ushuriel', 'zugurosh', 'angry demon', 'askarak demon', 'askarak lord', 'askarak prince', 'choking fear', 'damned soul', 'dark torturer', 'demon', 'demon Outcast', 'destroyer', 'diabolic imp', 'eclipse knight', 'enthralled demon', 'feversleep', 'fire devil', 'frazzlemaw', 'gloombringer', 'gozzler', 'grave guard', 'gravedigger', 'grimeleech', 'guzzlemaw', 'hand of cursed fate', 'harbinger of darkness', 'hellflayer', 'hellhound', 'hellspawn', 'herald of gloom', 'juggernaut', 'lesser fire devil', 'pit berserker', 'nightmare', 'nightmare scion', 'pit battler', 'nightstalker', 'pit blacking', 'pit brawler', 'plaguesmith', 'retching horror', 'rift brood', 'rift lord', 'rift phantom', 'rift scythe', 'rift worm', 'shaburak demon', 'shaburak lord', 'shaburak prince', 'shadow fiend', 'shadow hound', 'shiversleep', 'shock head', 'sight of surrender', 'silencer', 'sin devourer', 'tentacle of the deep terror', 'terrorsleep', 'the fettered shatterer', 'unbound demon', 'unbound demon Outcast', 'vexclaw', 'weakened demon', 'yielothax', 'boogey', 'bretzecutioner', 'flameborn', 'horadron', 'kerberos', 'massacre', 'mawhawk', 'mazoran', 'mephiles', 'monstor', 'Omrafir', 'Orshabaal', 'phrodomo', 'plagirath', 'prince drazzak', 'ragiaz', 'razzagorn', 'shulgrax', 'tarbaz', 'terofar', 'the handmaiden', 'the imperor', 'the shatterer', 'tormentor', 'ungreez', 'zavarash', 'haunter', 'the dreadorian', 'the masked marauder', 'the Obliverator', 'eclipse knight', 'gloombringer', 'harbinger of darkness', 'herald of gloom', 'phrodomo', 'shadow hound', 'spawn of despair', 'morgaroth', 'zoralurk', 'angry plant', 'bane bringer', 'blood beast', 'bog raider', 'carniphila', 'defiler', 'devourer', 'disgusting Ooze', 'empowered glooth horror', 'feeble glooth horror', 'glooth anemone', 'glooth horror', 'haunted treeling', 'hideous fungus', 'humongous fungus', 'humorless fungus', 'leaf golem', 'mechanical fighter', 'Omnivora', 'possessed tree', 'spit nettle', 'swampling', 'wilting leaf golem', 'woodling', 'bane lord', 'deathbine', 'deep terror', 'diseased bill', 'diseased dan', 'lisa', 'the abomination', 'tiquandas revenge', 'glooth blob', 'death blob', 'acid blob', 'mercury blob', 'midnight spawn', 'essence of darkness', 'midnight spawn', 'frost servant', 'ice golem', 'lost time', 'solid frozen horror', 'shardhead', 'breach brood', 'charged energy elemental', 'dread intruder', 'energy elemental', 'high voltage elemental', 'instable breach brood', 'instable sparkion', 'massive energy elemental', 'Overcharged energy elemental', 'reality reaver', 'sparkion', 'stabilizing reality reaver', 'anomaly', 'energy Overlord', 'earth Overlord', 'energy Overlord', 'fire Overlord', 'ice Overlord', 'lord of the elements', 'armadile', 'clay guardian', 'cliff strider', 'control tower', 'crystal crusher', 'damaged worker golem', 'diamond servant', 'diamond servant replica', 'earth elemental', 'elder forest fury', 'enraged crystal golem', 'eternal guardian', 'forest fury', 'gargoyle', 'glooth golem', 'golden servant', 'golden servant replica', 'infected weeper', 'iron servant', 'iron servant replica', 'jagged earth elemental', 'lava golem', 'magma crawler', 'massive earth elemental', 'medusa', 'metal gargoyle', 'minion of versperoth', 'muddy earth elemental', 'Orewalker', 'rustheap golem', 'stone devourer', 'stone golem', 'vulcongra', 'walker', 'war golem', 'weeper', 'worker golem', 'abyssador', 'deathstrike', 'earth Overlord', 'glooth fairy', 'gorgo', 'professor maxxen', 'massive water elemental', 'roaring water elemental', 'slick water elemental', 'spirit of fertility', 'water elemental', 'blazing fire elemental', 'blistering fire elemental', 'fire elemental', 'flame of Omrafir', 'hellfire fighter', 'infected weeper', 'lava golem', 'magma crawler', 'massive fire elemental', 'Orewalker', 'thornfire wolf', 'vulcongra', 'weeper', 'fire Overlord', 'dwarf', 'dwarf guard', 'dwarf geomancer', 'dwarf soldier', 'lost basher', 'lost berserker', 'lost husher', 'lost thrower', 'foreman kneebiter', 'gnomevil', 'lloyd', 'elf', 'elf arcanist', 'elf Overseer', 'elf scout', 'firestarter', 'mornenion', 'behemoth', 'cyclops', 'cyclops drone', 'cyclops smith', 'frost giant', 'frost giantess', 'juvenile cyclops', 'Orclops doomhauler', 'Orclops ravager', 'yeti', 'stonecracker', 'goblin', 'goblin assassin', 'goblin leader', 'goblin scavenger', 'grynch clan goblin', 'muglex clan assassin', 'muglex clan footman', 'muglex clan scavenger', 'Orc', 'Orc berserker', 'Orc leader', 'Orc marauder', 'Orc rider', 'Orc shaman', 'Orc spearman', 'Orc warlord', 'Orc warrior', 'rorc', 'scar tribe shaman', 'hacker', 'frost troll', 'furious troll', 'island troll', 'mountain troll', 'swamp troll', 'troll', 'troll champion', 'troll guard', 'troll legionnaire', 'troll marauder', 'young troll', 'big boss trolliver', 'salamander trainer', 'Ogre brute', 'Ogre savage', 'Ogre shaman', 'amazon', 'valkyrie', 'xenia', 'barbarian bloodwalker', 'barbarian brutetamer', 'barbarian headsplitter', 'barbarian skullhunter', 'barbaria', 'dark monk', 'monk', 'acolyte of darkness', 'blood hand', 'blood priest', 'bride of night', 'necromancer', 'priestess', 'shadow pupil', 'necropharus', 'adventurer', 'angry adventurer', 'assassin', 'bandit', 'black knight', 'crazed beggar', 'crypt defiler', 'elvira hammerthrust', 'feverish citizen', 'gang member', 'gladiator', 'glooth bandit', 'glooth brigand', 'grave robber', 'hero', 'hunter', 'jesse the wicked', 'midnight warrior', 'mornenion', 'mutated human', 'nightslayer', 'nomad', 'poacher', 'primitive', 'renegade knight', 'robby the reckless', 'smuggler', 'stalker', 'thief', 'vicious squire', 'vile grandmaster', 'wild warrior', 'pirate buccaneer', 'pirate corsair', 'pirate cutthroat', 'pirate ghost', 'pirate marauder', 'pirate skeleton', 'brutus bloodbeard', 'captain jones', 'deadeye devious', 'dirtbeard', 'lethal lissy', 'ron the ripper', 'dark apprentice', 'dark magician', 'dawnfire asura', 'fury', 'ice witch', 'infernalist', 'mad scientist', 'midnight asura', 'warlock', 'witch', 'ascending ferumbras', 'yalahari', 'azerus', 'carlin', 'venore', 'thais', 'yalahar', 'liberty bay', 'darashia', 'roshamuul', 'Oramond', 'death priest shargon', 'destabilized ferumbras', 'doctor perhaps', 'ekatrix', 'energized raging mage', 'ferumbras', 'ferumbras essence', 'ferumbras mortal shell', 'ferumbras soul splinter', 'furyosa', 'mad mage', 'raging mage', 'the flaming Orchid', 'the last lore keeper', 'yaga the crone', 'yakchal', 'zarabustor', 'zushuka', 'acolyte of the cult', 'adept of the cult', 'doomsday cultist', 'enlightened of the cult', 'novice of the cult', 'grandfather tridian', 'tzumrah the dazzler', 'doomsday cultist', 'chakoya toolshaper', 'chakoya tribewarden', 'chakoya windcaller', 'Ocyakao', 'dworc fleshhunter', 'dworc venomsniper', 'dworc voodoomaster', 'Oodok witchmaster', 'depowered minotaur', 'execowtioner', 'glooth powered minotaur', 'minotaur', 'minotaur amazon', 'minotaur archer', 'minotaur mage', 'moohtant', 'worm priestess', 'bullwark', 'the horned fox', 'corym charlatan', 'corym skirmisher', 'corym vanguard', 'little corym charlatan', 'bonelord', 'braindeath', 'elder bonelord', 'eye of the seven', 'gazer', 'evil mastermind', 'the evil eye', 'blue djinn', 'efreet', 'green djinn', 'marid', 'fahim the wise', 'merikh the slaughterer', 'kreebosh the exile', 'kongra', 'merlkin', 'sibang', 'yeti', 'freegoiz', 'hairman the huge', 'the hairy One', 'black sheep', 'boar', 'clomp', 'deer', 'desperate white deer', 'doom deer', 'dromedary', 'enraged white deer', 'evil sheep', 'evil sheep lord', 'horse', 'ironblight', 'mad sheep', 'mushroom sniffer', 'pig', 'sheep', 'stampor', 'stone rhino', 'vampire pig', 'water buffalo', 'wereboar', 'white deer', 'wild horse', 'tromphonyte', 'Owin', 'crystal wolf', 'dog', 'ghost wolf', 'gloom wolf', 'hellhound', 'hot dog', 'husky', 'poodle', 'starving wolf', 'thornfire wolf', 'war wolf', 'werewolf', 'wild dog', 'winter wolf', 'wolf', 'feroxa', 'hemming', 'kerberos', 'the big bad One', 'elephant', 'mammoth', 'terrified elephant', 'the bloodtusk', 'cat', 'lion', 'midnight panther', 'mutated tiger', 'noble lion', 'roaring lion', 'tiger', 'zomba', 'badger', 'bat', 'ghoulish hyaena', 'gnarlhound', 'hyaena', 'modified gnarlhound', 'skunk', 'werebadger', 'fleabringer', 'mutated bat', 'mutated human', 'mutated rat', 'mutated tiger', 'bruise payne', 'esmeralda', 'bear', 'panda', 'polar bear', 'undead cavebear', 'werebear', 'bloodpaw', 'cave rat', 'enraged squirrel', 'killer rabbit', 'mutated rat', 'rabbit', 'rat', 'silver rabbit', 'squirrel', 'thieving squirrel', 'esmeralda', 'munster', 'the lord of the lice', 'carrion worm', 'drillworm', 'enraged bookworm', 'rift worm', 'rotworm', 'rottie the rotworm', 'rotworm queen', 'tremor worm', 'versperoth', 'white pale', 'breach brood', 'instable breach brood', 'jellyfish', 'anomaly', 'berserker chicken', 'cave parrot', 'chicken', 'demon parrot', 'dire penguin', 'flamingo', 'marsh stalker', 'meadow strider', 'parrot', 'penguin', 'pigeon', 'seagull', 'terror bird', 'abyssal calamary', 'calamary', 'slug', 'manta ray', 'fish', 'northern pike', 'shark', 'slippery northern pike', 'guilt', 'lizard sentinel', 'lizard snakecharmer', 'lizard templar', 'wyvern', 'heoni', 'high templar cobrass', 'fatality', 'menace', 'lizard chosen', 'lizard dragon priest', 'lizard high guard', 'lizard legionnaire', 'lizard magistratus', 'lizard noble', 'lizard zaogun', 'souleater', 'battlemaster zunzu', 'fazzrah', 'flamecaller zazrak', 'lizard abomination', 'lizard gate guardian', 'mutated zalamon', 'the voice of ruin', 'draken abomination', 'draken elite', 'draken spellweaver', 'draken warmaster', 'draptor', 'wounded cave draptor', 'chizzoron the distorter', 'paiz the pauperizer', 'zulazza the corruptor', 'tirecz', 'crocodile', 'killer caiman', 'thornback tortoise', 'tortoise', 'dreadmaw', 'the snapper', 'cobra', 'hydra', 'sacred snake', 'sea serpent', 'seacrest serpent', 'serpent spawn', 'snake', 'spawn of the welter', 'young sea serpent', 'leviathan', 'snake god essence', 'snake thing', 'the keeper', 'the many', 'the noxious spawn', 'the welter', 'corrupted soul', 'dryad', 'enraged soul', 'ghost', 'ghostly apparition', 'phantasm', 'pirate ghost', 'redeemed soul', 'rift phantom', 'skullfrost', 'soul spark', 'souleater', 'spectre', 'tainted soul', 'tarnished spirit', 'tormented ghost', 'white shade', 'wisp', 'captain jones', 'countess sorrow', 'teneshpar', 'dryad', 'soul spark', 'teneshpar', 'arkhothep', 'ashmunrah', 'dipthrah', 'horestis', 'mahrdis', 'morguthis', 'Omruc', 'rahemos', 'superior death minion', 'thalas', 'the ravager', 'vashresamun', 'minion of skyrr', 'yellow toilet paper man', 'betrayed wraith', 'bonebeast', 'brittle skeleton', 'death dragon', 'demon skeleton', 'dreadbeast', 'honour guard', 'lesser death minion', 'lost soul', 'party skeleton', 'pirate skeleton', 'skeleton', 'skeleton warrior', 'undead cavebear', 'undead dragon', 'undead gladiator', 'undead mine worker', 'dracola', 'ribstride', 'teleskor', 'zanakeph', 'deathbringer', 'slim', 'bane of light', 'banshee', 'blightwalker', 'crypt shambler', 'death priest', 'death reaper', 'duskbringer', 'elder mummy', 'ghoul', 'greater death minion', 'grim reaper', 'lich', 'mummy', 'nightfiend', 'rift scythe', 'shadow tentacle', 'tomb servant', 'unbound blightwalker', 'undead jester', 'undead prospector', 'vampire', 'vampire bride', 'vampire viscount', 'vicious manbat', 'zombie', 'arachir the ancient One', 'armenius', 'arthei', 'bloom of doom', 'boreth', 'devovorga', 'devovorga', 'diblis the fair', 'gravelord Oshuran', 'koshei the deathless', 'lersatio', 'marziel', 'shadow of boreth', 'shadow of marziel', 'sir valorcrest', 'spawn of devovorga', 'the count', 'the pale count', 'the weakened count', 'vulnerable cocoon', 'zevelon duskbringer', 'cursed gladiator', 'baby dragon', 'death dragon', 'dragon', 'dragon essence', 'dragon hatchling', 'dragon lord', 'dragon lord hatchling', 'dragon servant', 'dragon warden', 'dragonking zyrtarch', 'dragonling', 'draptor', 'elder wyrm', 'fallen challenger', 'frost dragon', 'frost dragon hatchling', 'ghastly dragon', 'haunted dragon', 'ice dragon', 'somewhat beatable', 'unbeatable dragon', 'undead dragon', 'wounded cave draptor', 'wyrm', 'demodras', 'dracola', 'ethershreck', 'fury of the emperor', 'gelidrazah the frozen', 'glitterscale', 'grand mother foulscale', 'hatebreeder', 'kalyassa', 'pythius the rotten', 'scorn of the emperor', 'soul of dragonking zyrtarch', 'spite of the emperor', 'tazhadur', 'the first dragon', 'tyrn', 'wrath of the emperor', 'zanakeph', 'zorvorax', 'deathbringer', 'drasilla', 'dragon essence');
    //name can't contain:
    $words_blocked = array('gamemaster', 'game master', 'adm', 'cm', 'gm', 'tutor', 'Adm', 'reset', 'server', 'serve', 'escroto', 'noob', 'relembra', 'game-master', "game'master", '--', "''","' ", " '", '- ', ' -', "-'", "'-", 'fuck', 'sux', 'suck', 'noob', 'tutor');
    foreach($first_words_blocked as $word)
        if($word == substr($name_to_check, 0, strlen($word)))
            return false;
    if(substr($name_to_check, -1) == "'" || substr($name_to_check, -1) == "-")
        return false;
    if(substr($name_to_check, 1, 1) == ' ')
        return false;
    if(substr($name_to_check, -2, 1) == " ")
        return false;
    foreach($names_blocked as $word)
        if($word == $name_to_check)
            return false;
    for($i = 0; $i < strlen($name_to_check); $i++)
        if($name_to_check[$i-1] == ' ' && $name_to_check[$i+1] == ' ')
            return false;
    foreach($words_blocked as $word)
        if (!(strpos($name_to_check, $word) === false))
            return false;
    for($i = 0; $i < strlen($name_to_check); $i++)
        if($name_to_check[$i] == $name_to_check[($i+1)] && $name_to_check[$i] == $name_to_check[($i+2)])
            return false;
    for($i = 0; $i < strlen($name_to_check); $i++)
        if($name_to_check[$i-1] == ' ' && $name_to_check[$i+1] == ' ')
            return false;
    $temp = strspn("$name", "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM- '");
    if ($temp != strlen($name))
        return false;
    if(strlen($name) < 1)
        return false;
    if(strlen($name) > 25)
        return false;

    return true;
}

function check_rank_name($name)
{
    $name = (string) $name;
    $temp = strspn("$name", "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789-[ ] ");
    if($temp != strlen($name))
        return false;
    if(strlen($name) < 1)
        return false;
    if(strlen($name) > 60)
        return false;

    return true;
}

function check_guild_name($name)
{
    $name = (string) $name;
    $words_blocked = array('--', "''","' ", " '", '- ', ' -', "-'", "'-", '  ');
    $temp = strspn("$name", "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789-' ");
    if($temp != strlen($name))
        return false;
    if(strlen($name) < 1)
        return false;
    if(strlen($name) > 60)
        return false;

    foreach($words_blocked as $word)
        if (!(strpos($name, $word) === false))
            return false;

    return true;
}

function check_password($pass)
{
    $pass = (string) $pass;
    $temp = strspn("$pass", "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890");
    if($temp != strlen($pass))
        return false;
    if(strlen($pass) > 40)
        return false;

    return true;
}

function check_mail($email)
{
    $email = (string) $email;
    $ok = "/[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,4}/";
    return (preg_match($ok, $email))? true: false;
}

function items_on_player($characterid, $pid)
{
    new Error_Critic('', 'function <i>items_on_player</i> is deprecated. Do not use it. It used too many queries!');
}

function getReason($reasonId)
{
    return Functions::getBanReasonName($reasonId);
}

//################### DISPLAY FUNCTIONS #####################
//return shorter text (news ticker)
function short_text($text, $chars_limit) 
{
    if(strlen($text) > $chars_limit)
        return substr($text, 0, strrpos(substr($text, 0, $chars_limit), " ")).'...';
    else
        return $text;
}
//return text to news msg
function news_place()
{
    return '';
}
//set monster of week
function logo_monster()
{
    new Error_Critic('', 'function <i>logo_monster</i> is deprecated. Do not use it!');
}

// we don't want to count AJAX scripts/guild images as page views, we also don't need status
if(!ONLY_PAGE)
{
    // STATUS CHECKER
    $statustimeout = 1;
    foreach(explode("*", str_replace(" ", "", $config['server']['statusTimeout'])) as $status_var)
        if($status_var > 0)
            $statustimeout = $statustimeout * $status_var;
    $statustimeout = $statustimeout / 1000;
    $config['status'] = parse_ini_file('cache/DONT_EDIT_serverstatus.txt');
    if($config['status']['serverStatus_lastCheck']+$statustimeout < time())
    {
        $config['status']['serverStatus_checkInterval'] = $statustimeout+3;
        $config['status']['serverStatus_lastCheck'] = time();
        $statusInfo = new ServerStatus($config['server']['ip'], $config['server']['statusPort'], 1);
        if($statusInfo->isOnline())
        {
            $config['status']['serverStatus_online'] = 1;
            $config['status']['serverStatus_players'] = $statusInfo->getPlayersCount();
            $config['status']['serverStatus_playersMax'] = $statusInfo->getPlayersMaxCount();
            $h = floor($statusInfo->getUptime() / 3600);
            $m = floor(($statusInfo->getUptime() - $h*3600) / 60);
            $config['status']['serverStatus_uptime'] = $h.'h '.$m.'m';
            $config['status']['serverStatus_monsters'] = $statusInfo->getMonsters();
        }
        else
        {
            $config['status']['serverStatus_online'] = 0;
            $config['status']['serverStatus_players'] = 0;
            $config['status']['serverStatus_playersMax'] = 0;
        }
        $file = fopen("cache/DONT_EDIT_serverstatus.txt", "w");
        $file_data = '';
        foreach($config['status'] as $param => $data)
        {
    $file_data .= $param.' = "'.str_replace('"', '', $data).'"
    ';
        }
        rewind($file);
        fwrite($file, $file_data);
        fclose($file);
    }
    //PAGE VIEWS COUNTER
    $views_counter = "cache/DONT_EDIT_usercounter.txt";
    // checking if the file exists
    if (file_exists($views_counter))
    {
        $actie = fopen($views_counter, "r+"); 
        if ($actie) {
            $page_views = fgets($actie, 9); 
            $page_views++; 
            rewind($actie); 
            fputs($actie, $page_views, 9); 
            fclose($actie);
        }
    }
    else
    { 
        // the file doesn't exist, creating a new one with value 1
        $actie = fopen($views_counter, "w"); 
        $page_views = 1; 
        fputs($actie, $page_views, 9); 
        fclose($actie); 
    }
}

 

latestnews.php

Spoiler

<?php

$main_content .= '
<div class="InnerTableContainer">
    <script>
var end = new Date("07/07/2017 09:00 PM");

    var _second = 1000;
    var _minute = _second * 60;
    var _hour = _minute * 60;
    var _day = _hour * 24;
    var timer;

    function showRemaining() {
        var now = new Date();
        var distance = end - now;
        if (distance < 0) {

            clearInterval(timer);
            document.getElementById("countdown").innerHTML = "EXPIRED!";

            return;
        }
        var days = Math.floor(distance / _day);
        var hours = Math.floor((distance % _day) / _hour);
        var minutes = Math.floor((distance % _hour) / _minute);
        var seconds = Math.floor((distance % _minute) / _second);

        document.getElementById("countdown").innerHTML = days + "days ";
        document.getElementById("countdown").innerHTML += hours + "hrs ";
        document.getElementById("countdown").innerHTML += minutes + "mins ";
        document.getElementById("countdown").innerHTML += seconds + "secs";
    }

    timer = setInterval(showRemaining, 1000);
</script>
    
    <table>
        <tbody>
            <tr>
                <td>
                    <div class="TableShadowContainerRightTop">
                        <div class="TableShadowRightTop" style="background-image: url('.$layout_name.'/images/content/table-shadow-rt.gif);"></div>
                    </div>
                        <div class="TableContentAndRightShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-rm.gif);">
                            <div class="TableContentContainer">
                                <table class="TableContent" style="border: 1px solid #faf0d7;">
                                    <tbody>
                                        <tr style="background-color: #505050;">
                                        </tr>
                                            <tr class="Table" style="background-color: #d4c0a1;">
                                                <td style="width: 800; border: 1px; border-style: solid; border-color: #FAF0D7;">
                                                    <div class="NewsHeadline">
                                                        <div class="NewsHeadlineBackground" style="background-image:url(' . $layout_name . '/images/news/newsheadline_background.gif)">
                                                            <table border="0">
                                                                <tr>
                                                                    <td style="text-align: center; font-weight: bold;">
                                                                        <font color="white">Most powerful guilds</font>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </div>
                                                    </div>
                                                    
                                                <table border="0" cellspacing="3" cellpadding="4" width="100%">
                                            <tr>';
                                                foreach($SQL->query('SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, COUNT(`g`.`name`) as `frags` FROM `players` p LEFT JOIN `player_deaths` pd ON `pd`.`killed_by` = `p`.`name` LEFT JOIN `guild_membership` gm ON `p`.`id` = `gm`.`player_id` LEFT JOIN `guilds` g ON `gm`.`guild_id` = `g`.`id` WHERE `g`.`id` > 0 AND `pd`.`unjustified` = 1 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 4;') as $guild)
                                                $main_content .= '              
                                                    <td style="width: 25%; text-align: center;">
                                                        <a href="?subtopic=guilds&action=view&GuildName=' . $guild['name'] . '"><img src="/guild_image.php?id=' . $guild['id'] . '" width="64" height="64" border="0"/><br />' . $guild['name'] . '</a><br />' . $guild['frags'] . ' kills
                                                    </td>';
                                                $main_content .= '
                                                                            </tr>
                                                                        </table>
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                                </div>
                                            <div class="TableShadowContainer">
                                        <div class="TableBottomShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-bm.gif);">
                                    <div class="TableBottomLeftShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-bl.gif);"></div>
                                <div class="TableBottomRightShadow" style="background-image: url('.$layout_name.'/images/content/table-shadow-br.gif);"></div>
                            </div>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
<br />';
if(!defined('INITIALIZED'))
    exit;

$tickerSql = $SQL->query("SELECT ");
//NEWSTICKER
$time = time();
$vTick = $SQL->query("SELECT " .$SQL->fieldName('date'). " FROM " .$SQL->tableName('z_news_tickers'). " WHERE " .$SQL->fieldName('hide_ticker'). " = '0'")->fetch();
if(isset($vTick['date'])){
$news_content .= '
    <div id="NewsTicker" class="Box">
        <div class="Corner-tl" style="background-image: url('.$layout_name.'/images/content/corner-tl.gif);"></div>
        <div class="Corner-tr" style="background-image: url('.$layout_name.'/images/content/corner-tr.gif);"></div>
        <div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div>
        <div class="BorderTitleText" style="background-image: url('.$layout_name.'/images/content/title-background-green.gif);"></div>
        <img class="Title" src="'.$layout_name.'/images/header/headline-newsticker.gif" alt="Contentbox headline" />
            <div class="Border_2">
                  <div class="Border_3">
                    <div class="BoxContent" style="background-image: url('.$layout_name.'/images/content/scroll.gif);">';
                    //##################### ADD NEW TICKER #####################
                    if($action == "newticker") {
                        if($group_id_of_acc_logged >= $config['site']['access_tickers']) {
                            $ticker_text = stripslashes(trim($_POST['new_ticker']));
                            $ticker_icon = (int) $_POST['icon_id'];
                            if(empty($ticker_text)) {
                                $news_content .= 'You can\'t add empty ticker.';
                            }
                            else
                            {
                            if(empty($ticker_icon)) {
                                $news_icon = 0;
                            }
                    $SQL->query('INSERT INTO '.$SQL->tableName('z_news_tickers').' (date, author, image_id, text, hide_ticker) VALUES ('.$SQL->quote($time).', '.$account_logged->getId().', '.$ticker_icon.', '.$SQL->quote($ticker_text).', 0)');
                    $news_content .= '
                        <center>
                            <h2>
                                <font color="red">Added new ticker:</font>
                            </h2>
                        </center>
                        <hr/>
                        <div id="newsticker" class="Box">
                            <div id="TickerEntry-1" class="Row" onclick=\'TickerAction("TickerEntry-1")\'>
                                  <div class="Odd">
                                    <div class="NewsTickerIcon" style="background-image: url('.$layout_name.'/images/news/icon_'.$ticker['image_id'].'.gif);"></div>
                                    <div id="TickerEntry-1-Button" class="NewsTickerExtend" style="background-image: url('.$layout_name.'/images/general/plus.gif);"></div>
                                    <div class="NewsTickerText">
                                              <span class="NewsTickerDate">'.date("d/m/Y", $time).' -</span> 
                                              <div id="TickerEntry-1-ShortText" class="NewsTickerShortText">';
                    $news_content .= '
                        <a href="?subtopic=latestnews&action=deleteticker&id='.$time.'">
                            <img src="'.$layout_name.'/images/news/delete.png" border="0">
                        </a>';
                    $news_content .= short_text($ticker_text, 60).'</div>
                          <div id="TickerEntry-1-FullText" class="NewsTickerFullText">';
                    $news_content .= '<a href="?subtopic=latestnews&action=deleteticker&id='.$time.'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
                    $news_content .= $ticker_text.'
                        </div>
                    </div>
                  </div>
            </div>
        </div>
    <hr/>';
    }
}
else
{
    $news_content .= 'You don\'t have admin rights. You can\'t add new ticker.';
}
    $news_content .= '<form action="?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form>';
}
//#################### DELETE (HIDE only!) TICKER ############################
if($action == "deleteticker") {
if($group_id_of_acc_logged >= $config['site']['access_tickers']) {
header("Location: ");
$date = (int) $_REQUEST['id'];
$SQL->query('UPDATE '.$SQL->tableName('z_news_tickers').' SET hide_ticker = 1 WHERE '.$SQL->fieldName('date').' = '.$date.';');
$news_content .= '<center>News tickets with <b>date '.date("j F Y, g:i a", $date).'</b> has been deleted.<form action="?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center></div></div>
    </div>
    <div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div>
    <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image: url('.$layout_name.'/images/content/corner-bl.gif);"></div></div>
    <div class="CornerWrapper-b"><div class="Corner-br" style="background-image: url('.$layout_name.'/images/content/corner-br.gif);"></div></div>
  </div>';
}
else
{
$news_content .= '<center>You don\'t have admin rights. You can\'t delete tickers.<form action="?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form></center>';
}
}
//show tickers if any in database or not blocked (tickers limit = 0)
$tickers = $SQL->query('SELECT * FROM `z_news_tickers` WHERE hide_ticker != 1 ORDER BY date DESC LIMIT 5;');
$number_of_tickers = 3;
if(is_object($tickers)) {
foreach($tickers as $ticker) {
if(is_int($number_of_tickers / 2))
        $color = "Odd";
else
        $color = "Even";
$tickers_to_add .= '<div id="TickerEntry-'.$number_of_tickers.'" class="Row" onclick=\'TickerAction("TickerEntry-'.$number_of_tickers.'")\'>
  <div class="'.$color.'">
    <div class="NewsTickerIcon" style="background-image: url('.$layout_name.'/images/news/icon_'.$ticker['image_id'].'.gif);"></div>
    <div id="TickerEntry-'.$number_of_tickers.'-Button" class="NewsTickerExtend" style="background-image: url('.$layout_name.'/images/general/plus.gif);"></div>
    <div class="NewsTickerText">
      <span class="NewsTickerDate">'.date("j M Y", $ticker['date']).' - </span>
      <div id="TickerEntry-'.$number_of_tickers.'-ShortText" class="NewsTickerShortText">';
//if admin show button to delete (hide) ticker
if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
$tickers_to_add .= '<a href="?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
}
$tickers_to_add .= short_text($ticker['text'], 60).'</div>
      <div id="TickerEntry-'.$number_of_tickers.'-FullText" class="NewsTickerFullText">';
//if admin show button to delete (hide) ticker
if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
$tickers_to_add .= '<a href="?subtopic=latestnews&action=deleteticker&id='.$ticker['date'].'"><img src="'.$layout_name.'/images/news/delete.png" border="0"></a>';
}
$tickers_to_add .= $ticker['text'].'</div>
    </div>
  </div>
</div>';
$number_of_tickers++;
}
}
}

//adding news
if($action == "newnews") {
if($group_id_of_acc_logged >= $config['site']['access_news']) {
$text = ($_REQUEST['text']);
$char_id = (int) $_REQUEST['char_id'];
$post_topic = stripslashes(trim($_REQUEST['topic']));
$smile = (int) $_REQUEST['smile'];
$news_icon = (int) $_REQUEST['icon_id'];
if(empty($news_icon)) {
$news_icon = 0;
}
if(empty($post_topic)) {
$an_errors[] .= 'You can\'t add news without topic.';
}
if(empty($text)) {
$an_errors[] .= 'You can\'t add empty news.';
}
if(empty($char_id)) {
$an_errors[] .= 'Select character.';
}
//execute query
if(empty($an_errors)) {
$SQL->query("INSERT INTO `z_forum` (`id` ,`first_post` ,`last_post` ,`section` ,`replies` ,`views` ,`author_aid` ,`author_guid` ,`post_text` ,`post_topic` ,`post_smile` ,`post_date` ,`last_edit_aid` ,`edit_date`, `post_ip`, `icon_id`) VALUES ('NULL', '0', '".time()."', '1', '0', '0', '".$account_logged->getId()."', '".(int) $char_id."', ".$SQL->quote($text).", ".$SQL->quote($post_topic).", '".(int) $smile."', '".time()."', '0', '0', '".$_SERVER['REMOTE_ADDR']."', '".$news_icon."')");
$thread_id = $SQL->lastInsertId();
$SQL->query("UPDATE `z_forum` SET `first_post`=".(int) $thread_id." WHERE `id` = ".(int) $thread_id);//show added data
$main_content .= '<form action="index.php?subtopic=latestnews" METHOD=post><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></form>';
}
else
{
//show errors
$main_content .= '<div class="SmallBox" >  <div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="ErrorMessage" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
foreach($an_errors as $an_error) {
    $main_content .= '<li>'.$an_error;
}
$main_content .= '</div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/>';
//okno edycji newsa z wpisanymi danymi przeslanymi wczesniej
$main_content .= '<form action="index.php?subtopic=latestnews&action=newnews" method="post" ><table border="0"><tr><td bgcolor="D4C0A1" align="center"><b>Select icon:</b></td><td><table border="0" bgcolor="F1E0C6"><tr><td><img src="'.$layout_name.'/images/news/icon_0.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_1.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_2.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_3.gif" width="20"></td><td><img src="'.$layout_name.'/images/news/icon_4.gif" width="20"></td></tr><tr><td><input type="radio" name="icon_id" value="0" checked="checked"></td><td><input type="radio" name="icon_id" value="1"></td><td><input type="radio" name="icon_id" value="2"></td><td><input type="radio" name="icon_id" value="3"></td><td><input type="radio" name="icon_id" value="4"></td></tr></table></td></tr><tr><td align="center" bgcolor="F1E0C6"><b>Topic:</b></td><td><input type="text" name="topic" maxlenght="50" style="width: 300px" value="'.$post_topic.'"></td></tr><tr><td align="center" bgcolor="D4C0A1"><b>News<br>text:</b></td><td bgcolor="F1E0C6"><textarea name="text" rows="6" cols="60">'.$text.'</textarea></td></tr><tr><td width="180"><b>Character:</b></td><td><select name="char_id"><option value="0">(Choose character)</option>'.$str.'</select></td></tr><tr><td><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></form><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><img class="ButtonText" id="CancelAddNews" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="location.href=\'index.php?subtopic=latestnews\';" alt="CancelAddNews" /></div></div></td></tr></table>';
}
}
else
{
$main_content .= 'You don\'t have site-admin rights. You can\'t add news.';}
}

if(!empty($tickers_to_add)) {
//show table with tickers

if($group_id_of_acc_logged >= $config['site']['access_admin_panel'] && $action!=newticker)
$news_content .= '<script type="text/javascript">
var showednewticker_state = "0";
function showNewTickerForm()
{
if(showednewticker_state == "0") {
document.getElementById("newtickerform").innerHTML = \'<form action="?subtopic=latestnews&action=newticker" method="post" ><table border="0"><tr><td bgcolor="D4C0A1" align="center"><b>Select icon:</b></td><td><table border="0" bgcolor="F1E0C6"><tr><td><img src="images/news/icon_0.gif" width="20"></td><td><img src="images/news/icon_1.gif" width="20"></td><td><img src="images/news/icon_2.gif" width="20"></td><td><img src="images/news/icon_3.gif" width="20"></td><td><img src="images/news/icon_4.gif" width="20"></td></tr><tr><td><input type="radio" name="icon_id" value="0" checked="checked"></td><td><input type="radio" name="icon_id" value="1"></td><td><input type="radio" name="icon_id" value="2"></td><td><input type="radio" name="icon_id" value="3"></td><td><input type="radio" name="icon_id" value="4"></td></tr></table></td></tr><tr><td align="center" bgcolor="D4C0A1"><b>New<br>ticker<br>text:</b></td><td bgcolor="F1E0C6"><textarea name="new_ticker" rows="3" cols="45"></textarea></td></tr><tr><td><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></form><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><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/_sbutton_cancel.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div></td></tr></table>\';
document.getElementById("jajo").innerHTML = \'\';
showednewticker_state = "1";
}
else {
document.getElementById("newtickerform").innerHTML = \'\';
document.getElementById("jajo").innerHTML = \'<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><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/addticker.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div>\';
showednewticker_state = "0";
}
}
</script><div id="newtickerform"></div><div id="jajo"><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><img class="ButtonText" id="AddTicker" src="'.$layout_name.'/images/buttons/addticker.gif" onClick="showNewTickerForm()" alt="AddTicker" /></div></div></div><hr/>';
//add tickers list
$news_content .= $tickers_to_add;
//koniec
$news_content .= '</div>
      </div>
    </div>
    <div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div>
    <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image: url('.$layout_name.'/images/content/corner-bl.gif);"></div></div>
    <div class="CornerWrapper-b"><div class="Corner-br" style="background-image: url('.$layout_name.'/images/content/corner-br.gif);"></div></div>
  </div>';
}
//NEWSTICKER END

//featured article
//sem creditos do autor, apenas postado por Dhenyz Shady no X-tibia.
///Queries ///
$query = $SQL->query('SELECT `name`,`id`,`level`,`experience`,`group_id` FROM `players` WHERE `group_id` < 2 ORDER BY `level` DESC LIMIT 1;')->fetch(); 
$query2 = $SQL->query('SELECT `id`, `name` FROM `players` ORDER BY `id` DESC LIMIT 1;')->fetch();
$housesfree = $SQL->query('SELECT COUNT(*) FROM `houses` WHERE `owner`=0;')->fetch();
$housesrented = $SQL->query('SELECT COUNT(*) FROM `houses` WHERE `owner`=1;')->fetch();
$players = $SQL->query('SELECT COUNT(*) FROM `players` WHERE `id`>0;')->fetch();
$accounts = $SQL->query('SELECT COUNT(*) FROM `accounts` WHERE `id`>0;')->fetch();
$banned = $SQL->query('SELECT COUNT(*) FROM `account_bans` WHERE `account_id`>0;')->fetch();
$guilds = $SQL->query('SELECT COUNT(*) FROM `guilds` WHERE `id`>0;')->fetch();

///End Queries ///
$news_content .= '
    <div id="FeaturedArticle" class="Box">
                    <div class="Corner-tl" style="background-image:url(./layouts/tibiacom/images/content/corner-tl.gif);"></div>
                    <div class="Corner-tr" style="background-image:url(./layouts/tibiacom/images/content/corner-tr.gif);"></div>
                    <div class="Border_1" style="background-image:url(./layouts/tibiacom/images/content/border-1.gif);"></div>
                    <div class="BorderTitleText" style="background-image:url(./layouts/tibiacom/images/content/title-background-green.gif);"></div>
                    <img id="ContentBoxHeadline" class="Title" src="./layouts/tibiacom/images/header/headline-featuredarticle.gif" alt="Contentbox headline" />
                    <div class="Border_2">
                        <div class="Border_3">
                            <div class="BoxContent" style="background-image:url(./layouts/tibiacom/images/content/scroll.gif);">
                                <div id="TeaserThumbnail">
                                    <a href="index.php?subtopic=createaccount">
                                        <img src="/images/featuredthumb_3720.jpg" width="150" height="100" border=0 alt="" />
                                    </a>
                                </div>
                                
                                <div id="TeaserText">
                                <div style="position: relative; top: -9px; margin-bottom: 10px;"></br>
                                <b><font size="5px"><center><b><font style="text-decoration: inherit; text-shadow:#000 1px -1px 2px, #000 -1px 1px 2px, #000 1px 1px 2px, #000 -1px -1px 2px" size="1px" color="white">| IP: <font color="#00FF00">seu-global.com</font> / Port: <font color="#00FF00">7171</font> / Client: <font color="#00FF00">10 ~ 11.0</font> / Client Proprio: </font><font size="2px"><a href="?subtopic=downloads">DOWNLOAD</a></b></font></center><br></b><font size="2px">Seja bem vindo ao <b><font color="green">seu-global.com</font></b>, servidor feito especialmente para jogadores que gostam de um bom servidor. Oferecemos: <b>Prey System</b>, <b>Imbuing System</b>, quests, outfits, ORAMOND FULL, <b>Anti-entrosa system</b>, eventos e miss&otilde;es tudo para proporcionar a voces jogadores uma gameplay mais envolvente.<br><br><br><br>    
     
     
                                    </div>
                                </div>        
                            <fieldset><legend><font face=tahoma>Curta nossa FanPage Oficial!</font></legend>
<div class="fb-like" data-href="https://www.facebook.com/nareviaMMORPG" data-layout="standard" data-action="like" data-show-faces="false" data-share="true"></div>
                            
                            
                            </div>


                        
                        
                        </div>
                    

                    
                    
                    </div>                    
                    <div class="Border_1" style="background-image:url(./layouts/tibiacom/images/content/border-1.gif);"></div>
                    <div class="CornerWrapper-b"><div class="Corner-bl" style="background-image:url(./layouts/tibiacom/images/content/corner-bl.gif);"></div></div>
                    <div class="CornerWrapper-b"><div class="Corner-br" style="background-image:url(./layouts/tibiacom/images/content/corner-br.gif);"></div></div>
    </div>

';
//Fim do featured Article
        
function replaceSmile($text, $smile)
{
    $smileys = array(
                        ':p' => 1, 
                        ':eek:' => 2, 
                        ':rolleyes:' => 3, 
                        ';)' => 4, 
                        ':o' => 5, 
                        ':D' => 6,  
                        ':(' => 7, 
                        ':mad:' => 8,
                        ':)' => 9,
                        ':cool:' => 10
                    );
    if($smile == 1)
        return $text;
    else
    {
        foreach($smileys as $search => $replace)
            $text = str_replace($search, '<img src="layouts/tibiarl/images/forum/smile/'.$replace.'.gif" />', $text);
        return $text;
    }
}

function replaceAll($text, $smile)
{
    $rows = 0;
    while(stripos($text, '

') !== false && stripos($text, '

') !== false )
    {
        $code = substr($text, stripos($text, '

')+6, stripos($text, '

') - stripos($text, '

') - 6);
		        if(!is_int($rows / 2)) { $bgcolor = 'ABED25'; } else { $bgcolor = '23ED25'; } $rows++;
		        $text = str_ireplace('[code]'.$code.'

', '<i>Code:</i><br /><table cellpadding="0" style="background-color: #'.$bgcolor.'; width: 480px; border-style: dotted; border-color: #CCCCCC; border-width: 2px"><tr><td>'.$code.'</td></tr></table>', $text);


    }
    $rows = 0;
    while(stripos($text, '
') !== false && stripos($text, '
') !== false )
    {
        $quote = substr($text, stripos($text, '
')+7, stripos($text, '
') - stripos($text, '
') - 7);

        if(!is_int($rows / 2)) { $bgcolor = 'AAAAAA'; } else { $bgcolor = 'CCCCCC'; } $rows++;
        $text = str_ireplace('
    }
    $rows = 0;
    while(stripos($text, '') !== false && stripos($text, '') !== false )
    {
        $url = substr($text, stripos($text, '')+5, stripos($text, '') - stripos($text, '') - 5);
        $text = str_ireplace(''.$url.'', '<a href="'.$url.'" target="_blank">'.$url.'</a>', $text);
    }
    while(stripos($text, '[player]') !== false && stripos($text, '[/player]') !== false )
    {
        $player = substr($text, stripos($text, '[player]')+8, stripos($text, '[/player]') - stripos($text, '[player]') - 8);
        $text = str_ireplace('[player]'.$player.'[/player]', '<a href="?subtopic=&name='.urlencode($player).'">'.$player.'</a>', $text);
    }
     while(stripos($text, '[letter]') !== false && stripos($text, '[/letter]') !== false )
    {
        $letter = substr($text, stripos($text, '[letter]')+8, stripos($text, '[/letter]') - stripos($text, '[letter]') - 8);
        $text = str_ireplace('[letter]'.$letter.'[/letter]', '<img src="images/letters/letter_martel_'.$letter.'.gif">', $text);
    }
    while(stripos($text, ') !== false && stripos($text,') !== false )
    {
        $img = substr($text, stripos($text, ')+5, stripos($text,') - stripos($text, '') - 5);
        $text = str_ireplace('.$img.', '<img src="'.$img.'">', $text);
    }
    while(stripos($text, '') !== false && stripos($text, '') !== false )
    {
        $b = substr($text, stripos($text, '')+3, stripos($text, '') - stripos($text, '') - 3);
        $text = str_ireplace(''.$b.'', '<b>'.$b.'</b>', $text);
    }
    while(stripos($text, '') !== false && stripos($text, '') !== false )
    {
        $i = substr($text, stripos($text, '')+3, stripos($text, '') - stripos($text, '') - 3);
        $text = str_ireplace(''.$i.'', '<i>'.$i.'</i>', $text);
    }
    while(stripos($text, '') !== false && stripos($text, '') !== false )
    {
        $u = substr($text, stripos($text, '')+3, stripos($text, '') - stripos($text, '') - 3);
        $text = str_ireplace(''.$u.'', '<u>'.$u.'</u>', $text);
    }
    return replaceSmile($text, $smile);
}

function showPost($topic, $text, $smile)
{
    $text = nl2br($text);
    $post = '';
    if(!empty($topic))
        $post .= '<b>'.replaceSmile($topic, $smile).'</b>';
    $post .= replaceAll($text, $smile);
    return $post;
}

if($group_id_of_acc_logged >= $config['site']['access_admin_panel'] && $action != 'newnews')
    {
        $main_content .= '
            <font style="font-size: 16px; font-weight: bold; margin-left: 20px;">Adding News</font>
            <form action="index.php?subtopic=latestnews&action=newnews" method="post" >
                <table border="0">
                    <tr>
                        <td bgcolor="D4C0A1" align="center"><b>Select icon:</b></td>
                        <td>
                            <table border="0">
                                <tr bgcolor="F1E0C6">
                                    <td><img src="'.$layout_name.'/images/news/icon_0.gif" width="20"></td>
                                    <td><img src="'.$layout_name.'/images/news/icon_1.gif" width="20"></td>
                                    <td><img src="'.$layout_name.'/images/news/icon_2.gif" width="20"></td>
                                    <td><img src="'.$layout_name.'/images/news/icon_3.gif" width="20"></td>
                                    <td><img src="'.$layout_name.'/images/news/icon_4.gif" width="20"></td>
                                </tr>
                                <tr bgcolor="D4C0A1">
                                    <td><input type="radio" name="icon_id" value="0" checked="checked"></td>
                                    <td><input type="radio" name="icon_id" value="1" /></td>
                                    <td><input type="radio" name="icon_id" value="2" /></td>
                                    <td><input type="radio" name="icon_id" value="3" /></td>
                                    <td><input type="radio" name="icon_id" value="4" /></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                <tr>
                    <td align="center" bgcolor="F1E0C6"><b>Topic:</b></td>
                    <td><input type="text" name="topic" maxlenght="50" style="width: 300px" ></td>
                </tr>
                <tr>
                    <td align="center" bgcolor="D4C0A1"><b>News<br>text:</b></td>';
                //Tiny Editor
                $main_content .= '
                    <script type="text/javascript" src="'.$layout_name.'/tiny_mce/tiny_mce.js"></script>
                    <script type="text/javascript">
                        tinyMCE.init({
                            // General options
                            mode : "textareas",
                            theme : "advanced",
                            plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks",
                    
                            // Theme options
                            theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
                            theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,link,unlink,anchor,image,cleanup,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
                            theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,ltr,rtl",
                            theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft,visualblocks",
                            theme_advanced_toolbar_location : "top",
                            theme_advanced_toolbar_align : "left",
                            theme_advanced_statusbar_location : "bottom",
                            theme_advanced_resizing : true,
                    
                            // Example content CSS (should be your site CSS)
                            content_css : "css/content.css",
                    
                            // Drop lists for link/image/media/template dialogs
                            template_external_list_url : "lists/template_list.js",
                            external_link_list_url : "lists/link_list.js",
                            external_image_list_url : "lists/image_list.js",
                            media_external_list_url : "lists/media_list.js",
                    
                            // Style formats
                            style_formats : [
                                {title : \'Bold text\', inline : \'b\'},
                                {title : \'Red text\', inline : \'span\', styles : {color : \'#ff0000\'}},
                                {title : \'Red header\', block : \'h1\', styles : {color : \'#ff0000\'}},
                                {title : \'Example 1\', inline : \'span\', classes : \'example1\'},
                                {title : \'Example 2\', inline : \'span\', classes : \'example2\'},
                                {title : \'Table styles\'},
                                {title : \'Table row 1\', selector : \'tr\', classes : \'tablerow1\'}
                            ],
                    
                            // Replace values for the template plugin
                            template_replace_values : {
                                username : "Some User",
                                staffid : "991234"
                            }
                        });
                    </script>';
                $main_content .= '
                    <td bgcolor="F1E0C6">
                        <textarea name="text" id="elm1" rows="6" cols="60"></textarea>
                    </td>
                </tr>
                <tr>
                    <td width="180"><b>Character:</b></td>
                    <td>
                        <select name="char_id">
                           <option value="0">(Choose character)</option>';
                            foreach($account_logged->getPlayers() as $player)
                            {
                             $main_content .= '<option value="'.$player->getID().'">'.$player->getName().'</option>';
                            }       
                            $main_content .= '       
                          </select>
                    </td>
                </tr>
                <tr>
                    <td>
                        <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>
            </form>
        </td>
    </tr>
</table>
<hr/>';
}


    $last_threads = $SQL->query('SELECT ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_text') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_topic') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('icon_id') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_smile') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('replies') . ', ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('post_date') . ' FROM ' . $SQL->tableName('players') . ', ' . $SQL->tableName('z_forum') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('author_guid') . ' AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('section') . ' = 1 AND ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('first_post') . ' = ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('id') . ' ORDER BY ' . $SQL->tableName('z_forum') . '.' . $SQL->fieldName('last_post') . ' DESC LIMIT ' . $config['site']['news_limit'])->fetchAll();
    
    //Here start news
    if(isset($last_threads[0]))
    {
        foreach($last_threads as $thread)
        {
            $main_content .= '
                <div class="NewsHeadline">
                    <div class="NewsHeadlineBackground" style="background-image:url('.$layout_name.'/images/news/newsheadline_background.gif)">
                         <img id="ContentBoxHeadline" class="Title" src="./layouts/tibiacom/images/header/headline-news23.gif" alt="Contentbox headline" />
                    </div>
                </div>
                <table style=\'clear:both\' border=0 cellpadding=0 cellspacing=0 width=\'100%\'>
                <tr>';
            $main_content .= '
                <td style=\'padding-left:10px;padding-right:10px;\' >' . showPost('', $thread['post_text'], $thread['post_smile']) . '<p align="right"><a href="https://www.facebook.com/nareviaMMORPG/">->Veja em nossa Pagina.</a></p></td>';
        
            $main_content .= '
                <td>
                    
                </td>
            </tr>
        </table><br />';
        }
    }
    else
        $main_content .= '<h3>No news. :( </h3>';

 

'.$quote.'
', '<table cellpadding="0" style="background-color: #'.$bgcolor.'; width: 480px; border-style: dotted; border-color: #007900; border-width: 2px"><tr><td>'.$quote.'</td></tr></table>', $text);
Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Andersontatuador
      .Qual servidor ou website você utiliza como base? 
      Global Full 8.60 + Zao
      Qual o motivo deste tópico? 
      O site não esta adicionando os pontos na conta dos plays.
       
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       



    • Por A.Mokk
      .Qual servidor ou website você utiliza como base? 
      TFS 0.4
      Qual o motivo deste tópico? 
      Estou tendo um probleminha indelicado no meu site, gostaria de obter respostas aqui com voces que sao sempre muito eficientes e praticos.
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
       
    • Por thunmin
      .Qual servidor ou website você utiliza como base? 
      Canary
      Qual o motivo deste tópico? 
      Não consigo deixar ele automatico os players tem que confirmar o pagamento depois eu tenho que verificar se caiu pra depois eu confirmar e colocar as coins
      Está surgindo algum erro? Se sim coloque-o aqui. 
       
      Você tem o código disponível? Se tiver publique-o aqui: 
         
      Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 
       
    • Por Jordan422
      Faala Deuses do Tibia! Estou com um projeto sólido de um global old, mas to preso nessa parte do website viu.. Eu dou meu jeitinho mas ta chegando nas coisas avançadas que precisa daquele freelancer bacana para ajeitar umas páginas para mim! Já tenho as ideias, basta somente botar a mão na massa.. Quem estiver interessado por favor entrar em contato por mensagem aqui no Tibiaking mesmo ou preferencialmente pelo discord mythh9257 
       
    • Por moleza
      Para quem quer abrir um servidor antigo que roda em php5 e está com dificuldade com a configuração do linux, pode contratar um cpanel que contenha o php5 que facilita a configuração do site!!
       
      essa foi a minha solução!
       
      Resolvido !!
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo