• 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!

[Gesior 2012] TOP Edition

nice release rep+++! one problem with the shop though when purchasing outfits.

I'm using tfs 0.4 and when you purchase an outfit you constantly get an error message in the console:

[20:40:03.401] [Error - GlobalEvent Interface]
[20:40:03.404] data/globalevents/scripts/shop.lua:eek:nThink
[20:40:03.405] Description:
[20:40:03.406] (LuaInterface::luaDoCreateItemEx) Item not found

The script seems to believe it is an item. I've tried to purchase the outfit both when the char is online and offline. Anyone know how to solve it? It doesn't give the character the outfit and it crashes the server after a while.
 
BUMP! :(

nice release rep+++! one problem with the shop though when purchasing outfits.

I'm using tfs 0.4 and when you purchase an outfit you constantly get an error message in the console:

[20:40:03.401] [Error - GlobalEvent Interface]
[20:40:03.404] data/globalevents/scripts/shop.lua:eek:nThink
[20:40:03.405] Description:
[20:40:03.406] (LuaInterface::luaDoCreateItemEx) Item not found

The script seems to believe it is an item. I've tried to purchase the outfit both when the char is online and offline. Anyone know how to solve it? It doesn't give the character the outfit and it crashes the server after a while.
 
How i solve this?

Fatal error: Call to a member function fetchAll() on boolean in C:\xampp\htdocs\pages\latestnews.php on line 512


PHP:
            </form>
        </td>
    </tr>
</table>
<hr/>';
}


 512 line >>>   $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 src="'.$layout_name.'/images/news/icons/newsicon_'.$thread['icon_id'].'.gif" class="NewsHeadlineIcon" alt=\'\' />
                        <div class="NewsHeadlineDate">'.date('M m Y', $thread['post_date']).' -</div>
                        <div class="NewsHeadlineText">'.htmlspecialchars($thread['post_topic']).'</div>
                    </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']) . '<br><p align="right"><a href="?subtopic=forum&action=show_thread&id=' . $thread['id'] . '">» Comment on this news</a></p></td>';
        
            $main_content .= '
                <td>
                    <img src="'.$layout_name.'/images/global/general/blank.gif" width=10 height=1 border=0 alt=\'\' />
                </td>
            </tr>
        </table><br />';
        }
    }
    else
        $main_content .= '<h3>No news. Go forum and make new thread on board News.</h3>';
 
Adding news // forum stuff doesn't show UTF-8 characters, just LATIN one (I guess) or something else. Any idea how to fix it? It doesn't happen when you edit the page (shows char correctly), but add news or forum posts through the scripts. I just can't find it, any ideas?
 

STEP 1​

Check server configuration

Warning: foreach() argument must be of type array|object, null given in D:\xampp\htdocs\classes\configlua.php on line 54

Fatal error
: Uncaught Error: Undefined constant "yes" in D:\xampp\htdocs\classes\configlua.php(56) : eval()'d code:1 Stack trace: #0 D:\xampp\htdocs\classes\configlua.php(56): eval() #1 D:\xampp\htdocs\classes\configlua.php(20): ConfigLUA->loadFromString('accountManager ...') #2 D:\xampp\htdocs\classes\configlua.php(12): ConfigLUA->loadFromFile('C:/Users/Hp/Des...') #3 D:\xampp\htdocs\install.php(249): ConfigLUA->__construct('C:/Users/Hp/Des...') #4 {main} thrown in D:\xampp\htdocs\classes\configlua.php(56) : eval()'d code on line 1
configlua.php

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

class ConfigLUA extends Errors // NOT SAFE CLASS, LUA CONFIG CAN BE EXECUTED AS PHP CODE
{
private $config;

public function __construct($path = false)
{
if($path)
$this->loadFromFile($path);
}

public function loadFromFile($path)
{
if(Website::fileExists($path))
{
$content = Website::getFileContents($path);
$this->loadFromString($content);
}
else
{
new Error_Critic('#C-2', 'ERROR: <b>#C-2</b> : Class::ConfigLUA - LUA config file doesn\'t exist. Path: <b>' . $path . '</b>');
}
}

public function fileExists($path)
{
return Website::fileExists($path);
}

public function loadFromString($string)
{
$lines = explode("\n", $string);
if(count($lines) > 0)
foreach($lines as $ln => $line)
{
$tmp_exp = explode('=', $line, 2);
if(count($tmp_exp) >= 2)
{
$key = trim($tmp_exp[0]);
if(substr($key, 0, 2) != '--')
{
$value = trim($tmp_exp[1]);
if(is_numeric($value))
$this->config[ $key ] = (float) $value;
elseif(in_array(substr($value, 0 , 1), array("'", '"')) && in_array(substr($value, -1 , 1), array("'", '"')))
$this->config[ $key ] = (string) substr(substr($value, 1), 0, -1);
elseif(in_array($value, array('true', 'false')))
$this->config[ $key ] = ($value == 'true') ? true : false;
else
{
foreach($this->config as $tmp_key => $tmp_value) // load values definied by other keys, like: dailyFragsToBlackSkull = dailyFragsToRedSkull
$value = str_replace($tmp_key, $tmp_value, $value);
$ret = @eval("return $value;");
if((string) $ret == '') // = parser error
{
new Error_Critic('', 'ERROR: <b>#C-1</b> : Class::ConfigLUA - Line <b>' . ($ln + 1) . '</b> of LUA config file is not valid [key: <b>' . $key . '</b>]');
}
$this->config[ $key ] = $ret;
}
}
}
}
}

public function getValue($key)
{
if(isset($this->config[ $key ]))
return $this->config[ $key ];
else
new Error_Critic('#C-3', 'ERROR: <b>#C-3</b> : Class::ConfigLUA - Key <b>' . $key . '</b> doesn\'t exist.');
}

public function isSetKey($key)
{
return isset($this->config[ $key ]);
}

public function getConfig()
{
return $this->config;
}
}
 
Back
Top