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

Znote AAC 1.5 (for TFS_10) problems

Guiaki

Member
Joined
Jan 3, 2011
Messages
137
Reaction score
8
Right after all configuration needed (fresh new start), supposing to run sweetly it gave me some bugs, lets share to fix them.

Bug 1 (index.php, right after opening the website):
PHP:
string(43) "SELECT `name` FROM `players` WHERE `id` = ;"
(query - SQL error)
Type: select_single (select single row from database)

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

Bug 2 (after trying to delete a character):
PHP:
string(46) "SELECT `online` FROM `players` WHERE `id` = 3;"
(query - SQL error)
Type: select_single (select single row from database)

Unknown column 'online' in 'field list'

Bug 3 (not really a bug, but doesn't show an interface, when opened a new thread, to post a new message it shows this):
PHP:
[b]Bold Text[/b], [img]Direct Image Link[/img], [center]Cented Text[/center],
[link]http://youtube.com/[/link], [color=GREEN]Green Text![/color], [*] - Dotted [/*]

Bug 4 (after trying to delete a thread in the forum):
PHP:
Warning: Invalid argument supplied for foreach() in C:\xampp2\htdocs\ZnoteAAC\forum.php on line 305

Bug 5 (after buying an item at the shop):
PHP:
Warning: mysql_result() expects parameter 1 to be resource, boolean given in C:\xampp2\htdocs\ZnoteAAC\shop.php on line 26
1: Failed to equalize your points

Those are very few bugs I have found, the website is very great and I intend to use it, so I'm posting this topic in order to fix those bugs and allow new people to fix them also.

My thoughts about fixing them:
Bug 2:
since TFS_10, there is no longer an online field at the table players, there is a new table called players_online, so there is the need for a new function there

Bug 4:
Probably something about $thread:
PHP:
foreach($threads as $thread) {
            mysql_delete("DELETE FROM `znote_forum_posts` WHERE `thread_id`='". $thread['id'] ."';");
}

Bug 5:
Probably bad query:
PHP:
$old_points = mysql_result(mysql_query("SELECT `points` FROM `znote_accounts` WHERE `account_id`='$cid';"), 0, 'points');
 
I would like to summon @Znote , sorry for bumping.
There are new mysqli functions in database/connect.php. So probably there is an error somewhere in the php code how these functions are used. I haven't had time to look through it yet!

Right after all configuration needed (fresh new start), supposing to run sweetly it gave me some bugs, lets share to fix them.

Bug 1 (index.php, right after opening the website):
PHP:
string(43) "SELECT `name` FROM `players` WHERE `id` = ;"
(query - SQL error)
Type: select_single (select single row from database)

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

The new mysqli_select_single() returns FALSE if it didn't find any data. In fetchAllNews() (which gets news to the index page) it uses some code to fetch user data from players table,
but if it does return false you will get an error (at least I think so). Replace the fetchAllNews() in engine\function\users.php to the code below to make it work with no players online! (dunno if it works with players online though)

PHP:
// NEWS
function fetchAllNews() {
   $data = mysql_select_multi("SELECT * FROM `znote_news` ORDER BY `id` DESC;");
   if ($data !== False) {
   for ($i = 0; $i < count($data); $i++) {
     echo("$hski");
     $cd = user_character_data($data[$i]['pid'], 'name');
     $data[$i]['name'] = $cd['name'];
     unset($data[$i]['pid']);
   }
   return $data;
   }
}
 
Last edited by a moderator:
Last edited:
Back
Top