• 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.4 - [TFS 0.2.13+] & [TFS 0.3.6+/0.4]

Znote there is a problem with the gallery i used the direct url and the other link but never show the pic

rNwTGm4a.jpg

The gallery should be fixed on Znote AAC 1.5_dev from github: https://github.com/Znote/ZnoteAAC

imgland.net has changed their image urls since 1.4, which broke the old system.
 
Hey Znote, gimme a hand. This is not working with 1.5, I got no clue why, I always get the msg "This server is not born yet." from line 9.
Code:
<?php
#    Online Players Records for ZnoteAAC
#    By cbrm @ otland.net

require_once 'engine/init.php'; include 'layout/overall/header.php';
echo'<h1>Online Players Records</h1>';
$record = mysql_query('SELECT * FROM `server_record` ORDER BY `record` DESC LIMIT 20;');
while ($row = mysql_fetch_assoc($record)) {$data[] = $row;}
if (empty($data)) {echo 'This server is not born yet.'; return include 'layout/overall/footer.php';}
?>

<center>
    Max amount of online players was of <?php echo $data[0]['record'] ?> players on <?php echo date("M j Y", $data[0]['timestamp']) ?>
</center>

<table>
<tr class="yellow">
    <td width="30%">
        <span style="font-weight:bold;">Players</span>
    </td>
    <td width="70%">
        <span style="font-weight:bold;">Date</span>
    </td>
</tr>

<?php
foreach($data as $record):
    echo'<tr><td>'.$record['record'].'</td>';
    echo'<td>'.date("M j Y, H:i:s T", $record['timestamp']).'</td></tr>';
endforeach;
echo'</table>'; include 'layout/overall/footer.php'; ?>

Also, I tried to change this line
Code:
<?php You have <?php echo $user_data['premdays']; ?> days remaining premium account.</p> ?>
from myaccount.php, since my servers uses `premend` (unixtime like death date) instead, but $user_data['premend'] returns nothing at all. I tried a lot of different shit and nothing worked.
 
Hey Znote, gimme a hand. This is not working with 1.5, I got no clue why, I always get the msg "This server is not born yet." from line 9.
Code:
<?php
#    Online Players Records for ZnoteAAC
#    By cbrm @ otland.net

require_once 'engine/init.php'; include 'layout/overall/header.php';
echo'<h1>Online Players Records</h1>';
$record = mysql_query('SELECT * FROM `server_record` ORDER BY `record` DESC LIMIT 20;');
while ($row = mysql_fetch_assoc($record)) {$data[] = $row;}
if (empty($data)) {echo 'This server is not born yet.'; return include 'layout/overall/footer.php';}
?>

<center>
    Max amount of online players was of <?php echo $data[0]['record'] ?> players on <?php echo date("M j Y", $data[0]['timestamp']) ?>
</center>

<table>
<tr class="yellow">
    <td width="30%">
        <span style="font-weight:bold;">Players</span>
    </td>
    <td width="70%">
        <span style="font-weight:bold;">Date</span>
    </td>
</tr>

<?php
foreach($data as $record):
    echo'<tr><td>'.$record['record'].'</td>';
    echo'<td>'.date("M j Y, H:i:s T", $record['timestamp']).'</td></tr>';
endforeach;
echo'</table>'; include 'layout/overall/footer.php'; ?>

Also, I tried to change this line
Code:
<?php You have <?php echo $user_data['premdays']; ?> days remaining premium account.</p> ?>
from myaccount.php, since my servers uses `premend` (unixtime like death date) instead, but $user_data['premend'] returns nothing at all. I tried a lot of different shit and nothing worked.

The code there that was converted by cbrm is using a deprecated php_mysql driver which is not supported in Znote AAC 1.5

To make sure scripts are always compatible throughout versions of Znote AAC, make sure to use the Znote AAC custom SQL functions.
mysql_select_single/multi
mysql_update/insert/delete

Here is a sample where I convert a few lines of that script to use the custom SQL functions, which works great in both Znote AAC 1.4 and 1.5;
I changed this:
PHP:
$record = mysql_query('SELECT * FROM `server_record` ORDER BY `record` DESC LIMIT 20;');
while ($row = mysql_fetch_assoc($record)) {$data[] = $row;}
if (empty($data)) {echo 'This server is not born yet.'; return include 'layout/overall/footer.php';}

To this:
PHP:
$records = mysql_select_multi('SELECT * FROM `server_record` ORDER BY `record` DESC LIMIT 20;');
foreach ($records as $record) $data[] = $record;

if (!$records || empty($data)) {
    echo 'This server is not born yet.';
    return include 'layout/overall/footer.php';
}

Edit:Forgot to answer your 2nd question.
Also, I tried to change this line
Code:
<?php You have <?php echo $user_data['premdays']; ?> days remaining premium account.</p> ?>
from myaccount.php, since my servers uses `premend` (unixtime like death date) instead, but $user_data['premend'] returns nothing at all.
I tried a lot of different shit and nothing worked.

First of all, if you use a standard distribution like TFS 0.2, 3/4 or 1.0. Make sure to configure that version in config.php, as it will take care of all database specific differences.

But to stay ontopic, your trying to change premdays to premend since thats what your database is using. (I am assuming you have configured Znote AAC correct, and is trying to expand compatibility to another distribution that is in your possession).

$user_data contains fetched information from the account table, it only fetches this information once in the header, and allows you to use the variables whenever you want to later in custom scripts.

To make it fetch the SQL information from `accounts.premend` instead of `accounts.premdays`, you need to alter the original parameters. Which can be done here at line 36:
https://github.com/Znote/ZnoteAAC/blob/master/engine/init.php#L36

After you have replaced 'premdays' with 'premend', the value fetched from SQL `accounts.premend` will be available in $user_data['premend']. Where the array key name is identical to SQL column name.
 
Last edited:
Thx for your time @Znote. I'm not versed in any computer related stuff, so I get hardtimes figuring out some stuff. Your changes were enough to fix the record.php, there wasn't anything more unproperly coded. And after I added premend to init.php, I'm using this line
Code:
Your premium account will last till <?php echo date("d/m/Y, H:i:s",$user_data['premend']); ?>.</p>
in myaccount.php and it's working.
 
Which table should I use, I do not have the right table, I've tested several and all give this error
http://otland.net/threads/mysql-how-to-run-a-query.177833/
Code:
CREATE TABLE IF NOT EXISTS `znote` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`version` varchar(30) NOT NULL COMMENT 'Znote AAC version',
`installed` int(10) NOT NULL,
`cached` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
INSERT INTO `znote` (`version`, `installed`) VALUES
('$version', '$time');
CREATE TABLE IF NOT EXISTS `znote_accounts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`account_id` int(11) NOT NULL,
`ip` int(10) NOT NULL,
`created` int(10) NOT NULL,
`points` int(10) DEFAULT 0,
`cooldown` int(10) DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
INSERT INTO `znote_accounts` (`account_id`, `ip`, `created`) VALUES
('1', '0', '$time');
CREATE TABLE IF NOT EXISTS `znote_news` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(30) NOT NULL,
`text` text NOT NULL,
`date` int(11) NOT NULL,
`pid` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `znote_images` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(30) NOT NULL,
`desc` text NOT NULL,
`date` int(11) NOT NULL,
`status` int(11) NOT NULL,
`image` varchar(30) NOT NULL,
`account_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `znote_paypal` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`txn_id` varchar(30) NOT NULL,
`email` varchar(255) NOT NULL,
`accid` int(11) NOT NULL,
`price` int(11) NOT NULL,
`points` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `znote_paygol` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`account_id` int(11) NOT NULL,
`price` int(11) NOT NULL,
`points` int(11) NOT NULL,
`message_id` varchar(255) NOT NULL,
`service_id` varchar(255) NOT NULL,
`shortcode` varchar(255) NOT NULL,
`keyword` varchar(255) NOT NULL,
`message` varchar(255) NOT NULL,
`sender` varchar(255) NOT NULL,
`operator` varchar(255) NOT NULL,
`country` varchar(255) NOT NULL,
`currency` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `znote_players` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`player_id` int(11) NOT NULL,
`created` int(11) NOT NULL,
`hide_char` tinyint(4) NOT NULL,
`comment` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
INSERT INTO `znote_players` (`player_id`, `created`, `hide_char`, `comment`) VALUES
('1', '$time', '0', '. . .');
CREATE TABLE IF NOT EXISTS `znote_player_reports` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`posx` int(6) NOT NULL,
`posy` int(6) NOT NULL,
`posz` int(6) NOT NULL,
`report_description` VARCHAR(255) NOT NULL,
`date` INT(11) NOT NULL,
`status` TINYINT(3) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `znote_changelog` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`text` VARCHAR(255) NOT NULL,
`time` INT(11) NOT NULL,
`report_id` INT(11) NOT NULL,
`status` TINYINT(3) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `znote_shop` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` int(11) NOT NULL,
`itemid` int(11) DEFAULT NULL,
`count` int(11) NOT NULL DEFAULT '1',
`describtion` varchar(255) NOT NULL,
`points` int(11) NOT NULL DEFAULT '10',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `znote_shop_logs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`account_id` int(11) NOT NULL,
`player_id` int(11) NOT NULL,
`type` int(11) NOT NULL,
`itemid` int(11) NOT NULL,
`count` int(11) NOT NULL,
`points` int(11) NOT NULL,
`time` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `znote_shop_orders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`account_id` int(11) NOT NULL,
`type` int(11) NOT NULL,
`itemid` int(11) NOT NULL,
`count` int(11) NOT NULL,
`time` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `znote_visitors` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ip` int(11) NOT NULL,
`value` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `znote_visitors_details` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ip` int(11) NOT NULL,
`time` int(11) NOT NULL,
`type` tinyint(4) NOT NULL,
`account_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `znote_forum` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`access` tinyint(4) NOT NULL,
`closed` tinyint(4) NOT NULL,
`hidden` tinyint(4) NOT NULL,
`guild_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
INSERT INTO `znote_forum` (`name`, `access`, `closed`, `hidden`, `guild_id`) VALUES
('Staff Board', '4', '0', '0', '0'),
('Tutors Board', '2', '0', '0', '0'),
('Discussion', '1', '0', '0', '0'),
('Feedback', '1', '0', '1', '0');
CREATE TABLE IF NOT EXISTS `znote_forum_threads` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`forum_id` int(11) NOT NULL,
`player_id` int(11) NOT NULL,
`player_name` varchar(50) NOT NULL,
`title` varchar(50) NOT NULL,
`text` text NOT NULL,
`created` int(11) NOT NULL,
`updated` int(11) NOT NULL,
`sticky` tinyint(4) NOT NULL,
`hidden` tinyint(4) NOT NULL,
`closed` tinyint(4) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `znote_forum_posts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`thread_id` int(11) NOT NULL,
`player_id` int(11) NOT NULL,
`player_name` varchar(50) NOT NULL,
`text` text NOT NULL,
`created` int(11) NOT NULL,
`updated` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `znote_deleted_characters` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`original_account_id` int(11) NOT NULL,
`character_name` varchar(255) NOT NULL,
`time` datetime NOT NULL,
`done` tinyint(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `znote_guild_wars` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`limit` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
FOREIGN KEY (`id`) REFERENCES `guild_wars` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
 
I'm getting this when I try to log in with any accounts (even after updating them)
Code:
Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 29 inC:\xampp\htdocs\engine\function\users.php on line 1385
 
I'm getting this when I try to log in with any accounts (even after updating them)
Code:
Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 29 inC:\xampp\htdocs\engine\function\users.php on line 1385

nvm, noob mistake.
 
Znote, please help! my website is not acessible to the others, only for my hoster... My Ports are open in the router, and firewall desactivated, no anti-virus!!!
I'm desperate!! PLEASE HELP
 
Hi ! i using tfs 0.3.6pl1 8.54 tibia and have this bug
[04/08/2014 19:18:55] mysql_real_query(): SELECT * FROM z_ots_comunication WHERE `type` = 'login'; - MYSQL ERROR: Table 'online.z_ots_comunication' doesn't exist (1146)

Whos can tell me why ?
 
@Znote u can help me
I'm using Datapack Realmap 10.41 and use your website, while I go to "House" in web say it

Failed to fetch data from sql->houses table.

How I fix it ? U can tell me...
 
Any ideas on how to add 10 premium days for new accounts? I couldn't find any default settings in config.php

The correct place to add the premium time is on account creation, but I don't know how to get the account id there.
This is on register.php:
Code:
echo 'Congratulations! Your account has been created. You may now login to create a character.';

and, right after it, I added:
Code:
user_account_add_premdays(account_id, 10);


I have also tried to add the premium time right after login (since it requires user information to add premium time).

I don't know much of php but, since you are not logged in yet right after creating an account, is it possible to add 10 premium days to the last account that has been created? I mean something like this:
Code:
lastaccount = accounts.size;
add_premdays(account[lastaccount], 10);

Any help?
 
Hi!
Please can you add images : fireball rune,fire field rune,fire wall rune. Ids 2301@fire field rune,2302@fireball rune,2303@fire wall rune.

When i find more i write.

Thanks.
 
@guiismiti
https://github.com/Znote/ZnoteAAC/blob/master/register.php#L95
At line 95~, you see the register data.

After:
PHP:
'email'        =>    $_POST['email'],
add:
PHP:
'premdays'       =>    10,

If that does not work or you use premend in your database instead of directly counting days, try to use timestamp instead, so:
PHP:
'premdays'       =>    time() + (10 * 24 * 3600),

Everyone:
I'm very busy these days so sorry if I don't answer all questions. If your desperate enough look through the past 20-30 pages and I have probably answered your question already. Mosts posts here are frequently asked and answered.
 
Back
Top