• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

AAC PHP Warning: Invalid argument supplied for foreach() in

Hitman94

Member
Joined
Feb 9, 2009
Messages
88
Solutions
1
Reaction score
12
Wrong characters configuration. Try again or contact with admin. ADMIN: Edit file config/config.php

OldServ - Latestnews ::Alternative Open Tibia Server::

hey i have problem to create chcaracter gesior acc i have sample i DB
i have ubuntu 16.04 php 7.0

It seems to me that maybe something is blocking the connection to the base but I am new and I can be wrong, I am asking for help already with this 2 day

/var/log/apache2/error.log
Code:
[Sun Jul 15 13:39:00.831799 2018] [:error] [pid 19818] [client 90.155.254.160:45993] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355
[Sun Jul 15 13:44:29.820086 2018] [:error] [pid 19425] [client 46.134.66.106:5366] PHP Warning:  Invalid argument supplied for foreach() in /var/www/pages/latestnews.php on line 18
[Sun Jul 15 13:44:29.820736 2018] [:error] [pid 19425] [client 46.134.66.106:5366] PHP Warning:  Invalid argument supplied for foreach() in /var/www/pages/latestnews.php on line 286
[Sun Jul 15 13:44:29.822206 2018] [:error] [pid 19425] [client 46.134.66.106:5366] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355
[Sun Jul 15 13:44:33.591987 2018] [:error] [pid 19425] [client 46.134.66.106:5366] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/
[Sun Jul 15 13:44:36.690228 2018] [:error] [pid 19425] [client 46.134.66.106:5366] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=highscores
[Sun Jul 15 13:44:38.309885 2018] [:error] [pid 19425] [client 46.134.66.106:5366] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=highscores
[Sun Jul 15 13:45:07.610779 2018] [:error] [pid 19425] [client 46.134.66.106:1200] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=characters
[Sun Jul 15 13:45:09.616149 2018] [:error] [pid 20241] [client 46.134.66.106:4709] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement
[Sun Jul 15 13:45:12.490267 2018] [:error] [pid 19818] [client 46.134.66.106:3341] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement&action=createcharacter
[Sun Jul 15 13:46:33.179585 2018] [:error] [pid 19428] [client 46.134.66.106:2895] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement&action=createcharacter
[Sun Jul 15 13:46:35.660310 2018] [:error] [pid 20246] [client 46.134.66.106:6972] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement
[Sun Jul 15 13:46:43.537618 2018] [:error] [pid 20248] [client 46.134.66.106:6032] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement&action=manage
[Sun Jul 15 13:51:46.775606 2018] [:error] [pid 20069] [client 46.134.66.106:6115] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement
[Sun Jul 15 13:51:48.564237 2018] [:error] [pid 20069] [client 46.134.66.106:6115] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement&action=logout
[Sun Jul 15 13:51:56.236587 2018] [:error] [pid 20278] [client 46.134.66.106:1812] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement
[Sun Jul 15 13:51:59.589367 2018] [:error] [pid 20279] [client 31.184.194.109:62586] PHP Warning:  Invalid argument supplied for foreach() in /var/www/pages/latestnews.php on line 18
[Sun Jul 15 13:51:59.590014 2018] [:error] [pid 20279] [client 31.184.194.109:62586] PHP Warning:  Invalid argument supplied for foreach() in /var/www/pages/latestnews.php on line 286
[Sun Jul 15 13:51:59.591554 2018] [:error] [pid 20279] [client 31.184.194.109:62586] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355
[Sun Jul 15 13:52:14.530212 2018] [:error] [pid 20069] [client 46.134.66.106:4326] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement
[Sun Jul 15 13:52:16.326457 2018] [:error] [pid 20069] [client 46.134.66.106:4326] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement&action=logout
[Sun Jul 15 13:52:29.360537 2018] [:error] [pid 19818] [client 46.134.66.106:4979] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=createaccount
[Sun Jul 15 13:52:32.506850 2018] [:error] [pid 19818] [client 46.134.66.106:4979] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=createaccount&action=saveaccount
[Sun Jul 15 13:52:36.988555 2018] [:error] [pid 20069] [client 46.134.66.106:2669] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement
[Sun Jul 15 13:59:57.333499 2018] [mpm_prefork:notice] [pid 19422] AH00169: caught SIGTERM, shutting down
[Sun Jul 15 13:59:58.495436 2018] [mpm_prefork:notice] [pid 20415] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sun Jul 15 13:59:58.495508 2018] [core:notice] [pid 20415] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jul 15 14:00:24.098017 2018] [mpm_prefork:notice] [pid 20415] AH00169: caught SIGTERM, shutting down
[Sun Jul 15 14:00:25.297266 2018] [mpm_prefork:notice] [pid 20469] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sun Jul 15 14:00:25.297324 2018] [core:notice] [pid 20469] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jul 15 14:00:55.787122 2018] [mpm_prefork:notice] [pid 20469] AH00169: caught SIGTERM, shutting down
[Sun Jul 15 14:00:57.034202 2018] [mpm_prefork:notice] [pid 20521] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sun Jul 15 14:00:57.034268 2018] [core:notice] [pid 20521] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jul 15 14:00:57.124075 2018] [:error] [pid 20524] [client 46.134.66.106:2045] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355
[Sun Jul 15 14:01:03.996932 2018] [:error] [pid 20529] [client 46.134.66.106:6596] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement
[Sun Jul 15 14:01:14.733929 2018] [:error] [pid 20529] [client 46.134.66.106:4661] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement
[Sun Jul 15 14:01:17.284377 2018] [:error] [pid 20532] [client 46.134.66.106:3810] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement&action=createcharacter
[Sun Jul 15 14:01:42.907412 2018] [mpm_prefork:notice] [pid 20521] AH00169: caught SIGTERM, shutting down
[Sun Jul 15 14:01:44.008355 2018] [mpm_prefork:notice] [pid 20584] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sun Jul 15 14:01:44.008414 2018] [core:notice] [pid 20584] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jul 15 14:01:47.214541 2018] [:error] [pid 20587] [client 46.134.66.106:5647] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement&action=createcharacter
[Sun Jul 15 14:01:47.955826 2018] [:error] [pid 20587] [client 46.134.66.106:5647] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement&action=createcharacter
[Sun Jul 15 14:05:00.929056 2018] [mpm_prefork:notice] [pid 20584] AH00169: caught SIGTERM, shutting down
[Sun Jul 15 14:05:02.138278 2018] [mpm_prefork:notice] [pid 20662] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sun Jul 15 14:05:02.138338 2018] [core:notice] [pid 20662] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jul 15 14:05:05.002666 2018] [:error] [pid 20665] [client 46.134.66.106:6165] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement&action=createcharacter
[Sun Jul 15 14:05:05.816147 2018] [:error] [pid 20668] [client 46.134.66.106:6799] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement&action=createcharacter
[Sun Jul 15 14:05:06.456725 2018] [:error] [pid 20669] [client 46.134.66.106:6639] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement&action=createcharacter
[Sun Jul 15 14:08:48.981545 2018] [:error] [pid 20670] [client 178.73.215.171:59238] PHP Warning:  Invalid argument supplied for foreach() in /var/www/pages/latestnews.php on line 18
[Sun Jul 15 14:08:48.982108 2018] [:error] [pid 20670] [client 178.73.215.171:59238] PHP Warning:  Invalid argument supplied for foreach() in /var/www/pages/latestnews.php on line 286
[Sun Jul 15 14:08:48.983526 2018] [:error] [pid 20670] [client 178.73.215.171:59238] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355
[Sun Jul 15 14:09:13.282403 2018] [:error] [pid 20669] [client 46.134.66.106:3620] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement&action=createcharacter
[Sun Jul 15 14:09:14.131794 2018] [:error] [pid 20665] [client 46.134.66.106:4712] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement&action=createcharacter
[Sun Jul 15 14:09:15.608880 2018] [:error] [pid 20669] [client 46.134.66.106:3620] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement&action=createcharacter
[Sun Jul 15 14:09:22.845399 2018] [:error] [pid 20760] [client 46.134.66.106:3002] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement
[Sun Jul 15 14:20:44.532729 2018] [:error] [pid 20759] [client 46.134.66.106:5541] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=whoisonline
[Sun Jul 15 14:20:46.637830 2018] [:error] [pid 20759] [client 46.134.66.106:5541] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=characters
[Sun Jul 15 14:20:48.192957 2018] [:error] [pid 20759] [client 46.134.66.106:5541] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=characters
[Sun Jul 15 14:20:50.795577 2018] [:error] [pid 20836] [client 46.134.66.106:6378] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement
[Sun Jul 15 14:20:53.723818 2018] [:error] [pid 20670] [client 46.134.66.106:1198] PHP Warning:  Invalid argument supplied for foreach() in /var/www/layouts/cyber/layout.php on line 355, referer: http://195.242.117.68/?subtopic=accountmanagement&action=createcharacter
config.php
Code:
<?PHP
# Account Maker Config
$config['site']['serverPath'] = "/home/otserv/";
$config['site']['useServerConfigCache'] = false;
$config['site']['worlds'] = array(0 => 'Tibia');
$towns_list[0] = array(1 => 'Ab/dendriel', 2 => 'Kazordoon', 3 => 'Thais', 4 => 'Venore', 5 => 'Carlin', 6 => 'Ankrahmun', 7 => 'Darashia', 9 => 'Edron', 12 => 'Rookgaard', 13 => 'Port Hope');

$config['site']['outfit_images_url'] = '/outfit.php';
$config['site']['item_images_url'] = 'http://item-images.ots.me/860/';
$config['site']['item_images_extension'] = '.gif';
$config['site']['flag_images_url'] = 'http://flag-images.ots.me/';
$config['site']['flag_images_extension'] = '.png';
$config['site']['players_group_id_block'] = 3;
$config['site']['limitDeath'] = 5;
$config['site']['levelVideo'] = 150;

# Create Account Options
$config['site']['one_email'] = true;
$config['site']['create_account_verify_mail'] = false;
$config['site']['verify_code'] = false;
$config['site']['email_days_to_change'] = 7;
$config['site']['newaccount_premdays'] = 3;
$config['site']['send_register_email'] = false;

# Create Character Options
$config['site']['newchar_vocations'][0] = array(1 => 'Rook Sample');
$config['site']['newchar_towns'][0] = array(12);
$config['site']['max_players_per_account'] = 7;


$config['site']['send_emails'] = "true";
$config['site']['mail_address'] = "[email protected]";
$config['site']['smtp_enabled'] = "true";
$config['site']['smtp_host'] = "mail.softcores.net";
$config['site']['smtp_port'] = "25";
$config['site']['smtp_auth'] = "true";
$config['site']['smtp_user'] = "[email protected]";
$config['site']['smtp_pass'] = "*a!KDR8a{]o?";

# PAGE: whoisonline.php
$config['site']['private-servlist.com_server_id'] = 0;
/*
Server id on 'private-servlist.com' to show Players Online Chart (whoisonline.php page), set 0 to disable Chart feature.
To use this feature you must register on 'private-servlist.com' and add your server.
Format: number, 0 [disable] or higher
*/

$config['site']['quests'] = array('Trolls' => 800201,'Globins' => 800202,'Rotworms' => 800203,'Cyclops' => 800204,'Dwarf Guards' => 800205,'Orc Warlords' => 800206,'Dwarfs' => 800207,'Orcs' => 800208,'Tarantulas' => 800209,'Demon Skeletons' => 800210,'Minotaurs' => 800211,'Necromancers' => 800212,'Carniphilas' => 800213,'Apes' => 800214,'Fire Elementals' => 800215,'Dragons' => 800216,'Pandas' => 800217,'Giant Spiders' => 800218,'Hydras' => 800219,'Serpent Spawns' => 800220,'Behemoths' => 800221,'Crocodiles' => 800222,'Demons' => 800223,'Terror Birds' => 800224,'Larvas' => 800225,'Humans' => 800226,'Scarabs' => 800227,'Vampires' => 800228,'Ancient Scarabs' => 800229,'Heros' => 800230,'Black Knights' => 800231,'Dragon Lords' => 800232,'Warlocks' => 800233,'Lost Souls' => 800234,'Nightmares' => 800235,'Dark Torturers' => 800236,'Plaguesmiths' => 800237,'Defilers' => 800238,'Hellfire Fighters' => 800239,'Destroyers' => 800240,'Diabolic Imps' => 800241,'Hellhounds' => 800242,'Blightwalkers' => 800243,'Hand of Cursed Fates' => 800244,'Son Of Verminors' => 800245,'Juggernauts' => 800246,'Undead Dragons' => 800247,'Betrayed Wraiths' => 800248,'Phantasms' => 800249,'Ghouls' => 800250,'Lizards' => 800251,'Orc Berserkers' => 800252,'Orc Leaders' => 800253);
$config['site']['show_skills_info'] = true;
$config['site']['showQuests'] = true;
$config['site']['showVipList'] = false;
$config['site']['show_vip_storage'] = 0;

# PAGE: accountmanagement.php
$config['site']['send_mail_when_change_password'] = true;
$config['site']['send_mail_when_generate_reckey'] = true;
$config['site']['generate_new_reckey'] = true;
$config['site']['generate_new_reckey_price'] = 100;

# PAGE: guilds.php
$config['site']['guild_need_level'] = 50;
$config['site']['guild_need_pacc'] = false;
$config['site']['guild_image_size_kb'] = 50;
$config['site']['guild_description_chars_limit'] = 2000;
$config['site']['guild_description_lines_limit'] = 6;
$config['site']['guild_motd_chars_limit'] = 250;

# PAGE: adminpanel.php
$config['site']['access_admin_panel'] = 8347;
$config['site']['access_tickers'] = 8347;

# PAGE: latestnews.php
$config['site']['news_limit'] = 6;

# PAGE: killstatistics.php
$config['site']['last_deaths_limit'] = 40;

# PAGE: team.php
$config['site']['groups_support'] = array(2, 3, 4, 5, 6, 7);

# PAGE: highscores.php
$config['site']['groups_hidden'] = array(4, 5, 6);
$config['site']['accounts_hidden'] = array(1);

# PAGE: shopsystem.php
$config['site']['shop_system'] = true;
$config['site']['shopguild_system'] = false;

# PAGE: lostaccount.php
$config['site']['email_lai_sec_interval'] = 180;

# Layout Config
$config['site']['layout'] = 'cyber';
$config['site']['vdarkborder'] = '#505050';
$config['site']['darkborder'] = '#3a3738';
$config['site']['lightborder'] = '#3a3738';
$config['site']['download_page'] = false;
$config['site']['serverinfo_page'] = true;

############################
## PagSeguro/Paypal Email ##
############################
$config['pagseguro']['email'] = '[email protected]'; ## EMAIL PAGSEGURO ##
$config['paypal']['email'] = '[email protected]'; ## EMAIL PAYPAL ##
$config['pagseguro']['produtoNome'] = 'Premium Points'; //Identificação do Pontos
$config['pagseguro']['produtoValor'] = '100'; //100 = R$ 1,00 - 250 = R$ 2,50

## Formas de pagamento [1 = ativo | 0 = inativo] ##
$config['site']['pagseguro'] = 1;
$config['site']['paypal'] = 1;
$config['site']['paypalbr'] = 1;
$config['site']['caixa'] = 1;
$config['site']['bonusPoints'] = 0;

#####################
## Nome do Produto ##
#####################
$config['pagseguro']['produtoNome'] = 'Premium Points';

#############################
######### C A I X A ########
#############################
#! Informações do pagamento com caixa economica federal !#
$config['site']['CaixaCont'] = "
Preços da Loja:
15 Reais (30 points)
30 Reais (100 points)
45 Reais (150 points)

Aqui estĂŁo os passos que vocĂŞ precisa fazer: 
1. Escolha o valor desejado. 
2. Vá ate uma loterica ou qualquer lugar onde faça depositos.
3. Faça o deposito. 
4. Envie um Email para [email protected] contento Nome do Char e IMG/FOTO
do comprovante. 
5. Após a operação de 30, 100 ou 150 pontos será adicionado à sua conta. 
6. Vá ate a loja e use seus pontos.

AgĂŞncia: 4782
Operação: 013
Conta: 00003018-5
Favorecida: Bruna Carezolli

";
config.lua
Code:
    sqlType = "mysql"
    sqlHost = "127.0.0.1"
    sqlPort = 3306
    sqlUser = "root"
    sqlPass = "mypass"
    sqlDatabase = "ots1"
    sqlFile = ""
    sqlKeepAlive = 0
    mysqlReadTimeout = 10
    mysqlWriteTimeout = 10
    mysqlReconnectionAttempts = 5
    encryptionType = "sha1"



    worldId = 0
    ip = "195.242.117.68"
    worldType = "open"
    bindOnlyGlobalAddress = false
    loginPort = 7171
    gamePort = "7172"
    statusPort = 7171
    loginOnlyWithLoginServer = false
 
You should post your layout.php or show us a few snippet of what is in line 335 of your layout.php. I can't guess what is in that line :p
 
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" ng-app>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title><?PHP echo $title; ?> ::Alternative Open Tibia Server::</title>
    <meta name="author" content="Bufostudio.pl"/>
    <link rel="stylesheet" href="<?PHP echo $layout_name; ?>/_css/default.css" type="text/css" />
    <link rel="stylesheet" href="<?PHP echo $layout_name; ?>/_css/basic.css" type="text/css" />

    <link rel="icon" href="<? echo $layout_name; ?>/images/favicon.ico" type="image/x-icon">
   
    <script type="text/javascript" src="<?PHP echo $layout_name; ?>/_js/slideshow.js"></script>
    <script type="text/javascript" src="<?PHP echo $layout_name; ?>/_js/jquery-1.4.2.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.min.js"></script>
   
    <script type='text/javascript'>
        $(document).ready(function(){
        $("img.a").hover(
            function() {
                $(this).stop().animate({"opacity": "0"}, "slow");
            },
            function() {
                $(this).stop().animate({"opacity": "1"}, "slow");
            });
        });
    </script>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' type='text/javascript'></script>
<style>
#fbox-background {
    display: none;
    background: rgba(0,0,0,0.8);
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
}

#fbox-close {
    width: 100%;
    height: 100%;
}

#fbox-display {
    background: #eaeaea;
    border: 5px solid #828282;
    width: 340px;
    height: 230px;
    position: absolute;
    top: 32%;
    left: 37%;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
}

#fbox-button {
    float: right;
    cursor: pointer;
    position: absolute;
    right: 0px;
    top: 0px;
}

#fbox-button:before {
    content: "CLOSE";
    padding: 5px 8px;
    background: #828282;
    color: #eaeaea;
    font-weight: bold;
    font-size: 10px;
    font-family: Tahoma;
}

#fbox-link,#fbox-link a.visited,#fbox-link a,#fbox-link a:hover {
    color: #aaaaaa;
    font-size: 9px;
    text-decoration: none;
    text-align: center;
    padding: 5px;
}
</style>
<script type='text/javascript'>
//<![CDATA[
jQuery.cookie = function (key, value, options) {
// key and at least value given, set cookie...
if (arguments.length > 1 && String(value) !== "[object Object]") {
options = jQuery.extend({}, options);
if (value === null || value === undefined) {
options.expires = -1;
}
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setDate(t.getDate() + days);
}
value = String(value);
return (document.cookie = [
encodeURIComponent(key), '=',
options.raw ? value : encodeURIComponent(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// key and possibly options given, get cookie...
options = value || {};
var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
};
//]]>
</script>
    <?php echo $layout_header; ?>
</head>
<body>
    <div id="page">
        <div id="logo"></div>
       
        <div id="content">
            <div id="menu_top">
                <div class='img'>
                    <div class="left">
                        <div id='menu_top_home'>
                            <a href="?subtopic=latestnews">
                                <div class='fadehover'>
                                    <img src='/<?PHP echo $layout_name; ?>/_img/menu/news_1a.png' alt='<?PHP echo $title; ?> ::Soft Cores:: ' class='a' />
                                    <img src='/<?PHP echo $layout_name; ?>/_img/menu/news_1b.png' alt='<?PHP echo $title; ?> ::Soft Cores:: ' class='b' />
                                </div>
                            </a>
                        </div>
                        <div id='menu_top_acc'>
                            <a href="?subtopic=accountmanagement">
                                <div class='fadehover'>
                                    <img src='/<?PHP echo $layout_name; ?>/_img/menu/account_1a.png' alt='Account ::Soft Cores:: ' class='a' />
                                    <img src='/<?PHP echo $layout_name; ?>/_img/menu/account_1b.png' alt='Account ::Soft Cores:: ' class='b' />
                                </div>
                            </a>
                        </div>
                        <div id='menu_top_shop'>
                            <a href="?subtopic=shopsystem">
                                <div class='fadehover'>
                                    <img src='/<?PHP echo $layout_name; ?>/_img/menu/shop_1a.png' alt='Shop ::Soft Cores:: ' class='a' />
                                    <img src='/<?PHP echo $layout_name; ?>/_img/menu/shop_1b.png' alt='Shop ::Soft Cores:: ' class='b' />
                                </div>
                            </a>
                        </div>
                       
                    <div class="online">
                        <?PHP
                            $players_online = $SQL->query("SELECT COUNT(*) AS online FROM players WHERE world_id = '.$world_id.' and online = 1");
                            foreach($players_online as $players);
                           
                            if($config['status']['serverStatus_online'] == 1){
                                    echo '<center style="text-shadow: 1px 1px #2d2d2d; text-transform: uppercase;"><img src='. $layout_name .'/_img/online/online.png /><br/>                                   
                                        <a style="color:#FFF;" href="index.php?subtopic=whoisonline">Online: '.$config['status']['serverStatus_players'].' ('.($players['online']-$config['status']['serverStatus_players']).' AFK)</a><br/>
                                        UpTime: <FONT color="green"><b>'.$config['status']['serverStatus_uptime'].'</b></FONT><br/>
                                        Monsters:  '. $config['status']['serverStatus_monsters'] .'
                                        </center>';
                                    }else{
                                echo '<center style="text-shadow: 1px 1px #2d2d2d; text-transform: uppercase;"><img src='. $layout_name .'/_img/online/online.png /><br/>                                   
                                        <a style="color:#FFF;" href="index.php?subtopic=whoisonline">Online: '.$config['status']['serverStatus_players'].' ('.($players['online']-$config['status']['serverStatus_players']).' AFK)</a><br/>
                                        UpTime: <FONT color="green"><b>'.$config['status']['serverStatus_uptime'].'</b></FONT><br/>
                                        Monsters:  '. $config['status']['serverStatus_monsters'] .'
                                        </center>';}
                        ?>
                    </div>
                   
                    <div class="right">
                        <div id='menu_top_forum'>
                            <a href="?subtopic=forum">
                                <div class='fadehover'>
                                    <img src='/<?PHP echo $layout_name; ?>/_img/menu/forum_1a.png' alt='Forum ::Soft Cores:: ' class='a' />
                                    <img src='/<?PHP echo $layout_name; ?>/_img/menu/forum_1b.png' alt='Forum ::Soft Cores:: ' class='b' />
                                </div>
                            </a>
                        </div>
                        <div id='menu_top_highscores'>
                            <a href="?subtopic=highscores">
                                <div class='fadehover'>
                                    <img src='/<?PHP echo $layout_name; ?>/_img/menu/highscores_1a.png' alt='Highscores ::Soft Cores:: ' class='a' />
                                    <img src='/<?PHP echo $layout_name; ?>/_img/menu/highscores_1b.png' alt='Highscores ::Soft Cores:: ' class='b' />
                                </div>
                            </a>
                        </div>
                        <div id='menu_top_register'>
                            <a href="?subtopic=createaccount">
                                <div class='fadehover'>
                                    <img src='/<?PHP echo $layout_name; ?>/_img/menu/register_1a.png' alt='Register ::Soft Cores:: ' class='a' />
                                    <img src='/<?PHP echo $layout_name; ?>/_img/menu/register_1b.png' alt='Register ::Soft Cores:: ' class='b' />
                                </div>
                            </a>
                        </div>
                    </div>
                    </div>
                </div>
            </div>
           
            <div id="menu_left">
                <div id="menu-label">
                    <div id="icon-news"></div>
                    <div id="text-news"></div>
                </div>
                <div id="menu_links">
                    <ul>
                        <li><a href="?subtopic=latestnews">&nbsp;&raquo; Latest news</a></li>
                        <li><a href="?subtopic=archive">&nbsp;&raquo; News archive</a></li>
                    </ul>
                </div>
               
                <div class="clean_5"></div>
               
                <div id="menu-label">
                    <div id="icon-account"></div>
                    <div id="text-account"></div>
                </div>
                <div id="menu_links">
                    <ul>
                        <?PHP if($logged){
                                if($group_id_of_acc_logged >= $config['site']['access_admin_panel'])
                                    echo '<li><a href="?subtopic=phpmyadmin"><font color="red">&nbsp;&raquo; PhpMyAdmin</font></a></li>
                                <li><a href="?subtopic=shopadmin"><font color="red">&nbsp;&raquo; Shop Admin</font></a></li>';
                                if($logged)
                            echo '<li><a href="?subtopic=accountmanagement"><font color="orange"><b>Acc. Management</b></font></a></li>';
                                }else{
                            echo '<li><a href="?subtopic=accountmanagement"><b>&nbsp;&raquo; Login</b></a></li>
                                <li><a href="?subtopic=createaccount"><b>&nbsp;&raquo; Create Account</b></a></li>
                                <li><a href="?subtopic=lostaccount"><b>&nbsp;&raquo; Lost Account</b></a></li>';}?>
                                <li><a href="?subtopic=tibiarules"><b>&nbsp;&raquo; Server Rules</b></a></li>
                    </ul>
                </div>
               
                <div class="clean_5"></div>
               
                <div id="menu-label">
                    <div id="icon-community"></div>
                    <div id="text-community"></div>
                </div>
                <div id="menu_links">
                    <li><a href="?subtopic=characters">&nbsp;&raquo; Characters</a></li>
                    <li><a href="?subtopic=whoisonline">&nbsp;&raquo; Who is Online?</a></li>
                    <li><a href="?subtopic=highscores">&nbsp;&raquo; Highscores</a></li>
                    <li><a href="?subtopic=killstatistics">&nbsp;&raquo; Kill Statistics</a></li>
                    <li><a href="?subtopic=guilds">&nbsp;&raquo; Guilds</a></li>
                    <li><a href="?subtopic=wars">&nbsp;&raquo; Guild Wars</a></li>
                    <li><a href="?subtopic=forum">&nbsp;&raquo; Forum</a></li>
                    <li><a href="?subtopic=team">&nbsp;&raquo; Support</a></li>
                </div>
               
                <div class="clean_5"></div>
               
                <div id="menu-label">
                    <div id="icon-library"></div>
                    <div id="text-library"></div>
                </div>
                <div id="menu_links">
                    <li><a href="?subtopic=serverinfo">&nbsp;&raquo; Server Info</a></li>
                    <li><a href="?subtopic=tasks">&nbsp;&raquo; Task Info</a></li>
                    <li><a href="?subtopic=downloads">&nbsp;&raquo; Downloads</a></li>
                </div>
               
                <div class="clean_5"></div>
               
                <div id="menu-label">
                    <div id="icon-shop"></div>
                    <div id="text-shop"></div>
                </div>
                <div id="menu_links">
                        <li><a href="?subtopic=buypoints&system=homepay"><b><font color="red">&nbsp;&raquo; Buy Points</font></b></a></li>
                        <li><a href="?subtopic=shopsystem"><b><font color="green">&nbsp;&raquo; Shop Offers</font></b></a></li>
                        <?PHP
                            if($logged)
                                echo '<li><a href="?subtopic=shopsystem&action=show_history"><b>&nbsp;&raquo; Trans History</b></a></li>';
                        ?>
                </div>

            </div>
           
            <div id="content_text">
                <?PHP echo $main_content; ?>
            </div>
               
            <div id="menu_right">
                <div id="menu-label">
                    <div id="icon-info"></div>
                    <div id="text-info"></div>
                </div>
                        <span class="white" style="font-weight: bold;">&nbsp;&raquo; Exp: </span><i>Stage 20x</i><br/>
                        <span class="white" style="font-weight: bold;">&nbsp;&raquo; Skill: </span><i>7x</i><br/>
                        <span class="white" style="font-weight: bold;">&nbsp;&raquo; Magic: </span><i>3x</i><br/>
                        <span class="white" style="font-weight: bold;">&nbsp;&raquo; Loot: </span><i>3x</i>
           
                <div class="clean_5"></div>
           
                <div id="menu-label">
                    <div id="icon-search"></div>
                    <div id="text-search"></div>
                </div>
               
                <div class="clean_5"></div>
                    <center>
                        <FORM ACTION="?subtopic=characters" METHOD=post>
                            <INPUT NAME="name" VALUE="" class="search" SIZE=20 MAXLENGTH=29>
                            <div class="clean_5"></div>
                            <INPUT TYPE=image NAME="Submit" SRC="layouts/cyber/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18>
                        </FORM>
                    </center>
           
                <div class="clean_5"></div>
           
                <div id="menu-label">
                    <div id="icon-toplevel"></div>
                    <div id="text-toplevel"></div>
                </div>
               
                <table width="100%" border="0">
                <?PHP
                    $order = 0;
                    $number_of_people = 0;
                    $skills = $SQL->query('SELECT name,online,level,experience,vocation,promotion FROM players WHERE players.deleted = 0 AND players.group_id < '.$config['site']['players_group_id_block'].' AND name != "Account Manager" AND name != "Rook Sample" AND name != "Sorcerer Sample" AND name != "Druid Sample" AND name != "Paladin Sample" AND name != "Knight Sample" ORDER BY level DESC, experience DESC LIMIT 10;');
                        foreach($skills as $skill) {
                          $order++;
                            if(is_int($number_of_people / 2))
                                $bgcolor = $config['site']['darkborder'];
                            else
                                $bgcolor = $config['site']['lightborder'];
                                $number_of_people++;
                                $players_skill .= '<tr BGCOLOR="'.$bgcolor.'"><td align="center">'.$order.'.</td><td align="left"><B><a href="?subtopic=characters&name='.urlencode($skill['name']).'">'.($skill['online']>0 ? "<font color=\"green\">".$skill['name']."</font>" : "".$skill['name']."</font>").'</a></td> <td align="center"><font color="#7073FC"><em>LvL '.$skill['level'].'</em></font></td>';
                        }
                    echo "$players_skill";
                ?>
                </table>
               
                <div class="clean_5"></div>
               
                <div id="menu-label">
                    <div id="icon-topguilds"></div>
                    <div id="text-topguilds"></div>
                </div>
               
                <table width="100%" border="0">
                <?PHP
                    $guilds = $SQL->query('SELECT `g`.`id` AS `id`, `g`.`name` AS `name`,
                            `g`.`logo_gfx_name` AS `logo`, COUNT(`g`.`name`) as `frags`
                    FROM `killers` k
                            LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id`
                            LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id`
                            LEFT JOIN `guild_ranks` gr ON `p`.`rank_id` = `gr`.`id`
                            LEFT JOIN `guilds` g ON `gr`.`guild_id` = `g`.`id`
                    WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1
                            GROUP BY `name`
                            ORDER BY `frags` DESC, `name` ASC
                            LIMIT 0, 10;');
                            $i = 0;
                        foreach($guilds as $guild)
                        {
                        $i++;
                        echo '<tr BGCOLOR="'.$bgcolor.'">
                                <td align="center">'.$i.'. </td>
                                <td align="left">
                                    <B><a href="?subtopic=guilds&action=show&guild=' . $guild['id'] . '">' . $guild['name'] . '</a></b>
                                </td>
                                <td align="center">' . $guild['frags'] . ' kills</td>
                            </tr>';
                        }
                ?>
                </table>
            </div>
        </div>
       
        <div id="content_bot"></div>
    </div>
</body>
</html>
 
The query that is been called on $skills variable isn't working in your database, probably you don't have one of thoses columns, you should check that, but to avoid this error you can use this snippet code.

Note: I assume that is $skills, because the code that you provided there isn't nothing on line 335.
 
Foreach requires an array/object as first parameter. The query is probably returning a false or null, which cannot be looped through.
I'd suggest you dump the variable, so you can check what the query is returning.
PHP:
var_dump($guilds);

You can also wrap the foreach with an if statement, so it won't try to iterate over a null/false value;
PHP:
// This is at line 356 in layout.php
if($guild) // Returns true if there is data (or not false/null)
{
    foreach($guilds as $guild)
    {
         // the code inside the foreach
    }
}

You might want to do this for every occurrence in your error log.
 
president vankk i change my layouts.php to you paste code it's work
next error

Code:
[Mon Jul 16 01:48:55.396203 2018] [:error] [pid 21559] [client 46.134.66.106:5741] PHP Warning:  Invalid argument supplied for foreach() in /var/www/pages/latestnews.php on line 18, referer: http://195.242.117.68/?subtopic=latestnews
[Mon Jul 16 01:48:55.396928 2018] [:error] [pid 21559] [client 46.134.66.106:5741] PHP Warning:  Invalid argument supplied for foreach() in /var/www/pages/latestnews.php on line 286, referer: http://195.242.117.68/?subtopic=latestnews
[Mon Jul 16 01:49:06.527067 2018] [:error] [pid 21559] [client 46.134.66.106:2892] PHP Warning:  Invalid argument supplied for foreach() in /var/www/pages/latestnews.php on line 18, referer: http://195.242.117.68/?subtopic=accountmanagement
[Mon Jul 16 01:49:06.527892 2018] [:error] [pid 21559] [client 46.134.66.106:2892] PHP Warning:  Invalid argument supplied for foreach() in /var/www/pages/latestnews.php on line 286, referer: http://195.242.117.68/?subtopic=accountmanagement

/var/www/pages/latestnews.php
<?PHP header("Content-Type: text/html; charset=ISO-8859-1",true); date_default_ - Pastebin.com
 
Back
Top