• 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 - Version 1.0.1 for 0.2.x, 0.3.6 and all 0.4

NEED HELP AS QUIK AS POSSIBLE

My server is running it´s only one problem people can´t see shop in the website example you can see comunity.libary,account,forum,news but shop ain´t there how do i add shop there i looked everywhere can´t find a solution please help
 
NEED HELP AS QUIK AS POSSIBLE

My server is running it´s only one problem people can´t see shop in the website example you can see comunity.libary,account,forum,news but shop ain´t there how do i add shop there i looked everywhere can´t find a solution please help
If you use default tibia.com layout you must edit config/config.php and set shop system to true:
PHP:
# PAGE: shopsystem.php
[B]$config['site']['shop_system'] = false;
[/B]
If you use other layout then you must edit it and add somewhere link to shop page:
?subtopic=shopsystem
and to page to buy points:
?subtopic=buypoints
To add it in layout you need some HTML + CSS skills or ask someone to make it for you.
 
Create an interval (5 minutes) to create account from same ip and same thing for the characters.
It's very simple.

In pages/createaccount.php under:
PHP:
if(empty($reg_password) && !$config['site']['create_account_verify_mail'])
$reg_form_errors[] = "Please enter password to your new account.";
Paste:
PHP:
// simple config
$charactersLimitNumber = 3;
$charactersLimitTime = 300; // in seconds (=5 minutes)
// create new list of objects based on result from SQL query
$accountsMadeInFiveMinutes = new DatabaseList('Account');

// get accounts made from 'visitor' IP
$filterIP = new SQL_Filter(new SQL_Field('create_ip', 'accounts'), SQL_Filter::EQUAL, Visitor::getIP());
// get accounts made in past $charactersLimitTime seconds
$filterTime = new SQL_Filter(new SQL_Field('create_date', 'accounts'), SQL_Filter::GREATER, time() - $charactersLimitTime);
// get only accounts that 'pass' both filters
$filter = new SQL_Filter($filterIP, SQL_Filter::CRITERIUM_AND, $filterTime);

// add that filter to SQL query
$accountsMadeInFiveMinutes->setFilter($filter);

// set limit of results, we don't need to get from database 1000 accounts
// (we need one more then maximum number)
$accountsMadeInFiveMinutes->setLimit($charactersLimitNumber + 1); 

// now check if visitor made more accounts that limit
if($accountsMadeInFiveMinutes->count() > $charactersLimitNumber)
{
    $reg_form_errors[] = "You can only create " . $charactersLimitNumber . " characters per " . $charactersLimitTime . " seconds.";
}
(this code will execute only one SQL query and get only few accounts from database, don't worry about performance)

This code limits number of accounts to 3 per 5 minutes per IP.

If you limit number of accounts per X minutes and there is already limit of characters per 1 account (config/config.php) I think you don't need limit of characters per X minutes.
 
Thanks, elegant solution.


Another issue, as you would to create a method to display the sum of time online each player within the highscores?

Ussing
Code:
$player['onlinetime1'] + $player['onlinetime2'] + $player['onlinetime3'] + $player['onlinetime4'] + $player['onlinetime5'] + $player['onlinetime6'] + $player['onlinetime7'] + $player['onlinetimetoday']

classes/highscores.php
Code:
public function loadLevel()
{
$this->setClass('Highscore');
$this->addOrder(new SQL_Order(new SQL_Field('experience'), SQL_Order::DESC));
$this->addExtraField(new SQL_Field('flag', 'accounts'));
$filter = new SQL_Filter(new SQL_Field('world_id', 'players'), SQL_Filter::EQUAL, $this->worldId);
if($this->vocation != '')
$filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, new SQL_Filter(new SQL_Field('vocation', 'players'), SQL_Filter::EQUAL, $this->vocation));
if($this->highscoreConfig->isSetKey('groups_hidden'))
foreach($this->highscoreConfig->getValue('groups_hidden') as $_group_filter)
$filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, new SQL_Filter(new SQL_Field('group_id', 'players'), SQL_Filter::NOT_EQUAL, $_group_filter));
if($this->highscoreConfig->isSetKey('accounts_hidden'))
foreach($this->highscoreConfig->getValue('accounts_hidden') as $_account_filter)
$filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, new SQL_Filter(new SQL_Field('account_id', 'players'), SQL_Filter::NOT_EQUAL, $_account_filter));
$filter = new SQL_Filter(new SQL_Filter(new SQL_Field('account_id', 'players'), SQL_Filter::EQUAL, new SQL_Field('id', 'accounts')), SQL_Filter::CRITERIUM_AND, $filter);
$this->setFilter($filter);
}
 
Thanks, elegant solution.


Another issue, as you would to create a method to display the sum of time online each player within the highscores?

Ussing
Code:
$player['onlinetime1'] + $player['onlinetime2'] + $player['onlinetime3'] + $player['onlinetime4'] + $player['onlinetime5'] + $player['onlinetime6'] + $player['onlinetime7'] + $player['onlinetimetoday']
$player['onlinetime1'] + $player['onlinetime2'] + $player['onlinetime3'] ..
This code shows online time in last 7 days, not 'all' online time. All time online should be in column 'onlinetimeall'.
------------------------------------------

These columns are in table 'players', so you can edit classes/player.php and add these table columns to list:
PHP:
public static $fields = array('id', 'name', ...);
Then acc. maker will load these information for every object Player ("class Highscore extends Player").

Then you just need to sum (or maybe better get it from table column 'onlinetimeall' [there was something like that in online time counter script]) these columns in pages/highscores.php:
PHP:
...
$main_content .= '<tr>....Online time: ' . here_some_formating_function($skill->data['onlinetime1'] + $skill->data['onlinetime2 '] + ... + $skill->data['onlinetimetoday']) . ' ... </tr>';
...
or:

PHP:
...
$main_content .= '<tr>....Online time: ' . here_some_formating_function($skill->data['onlinetimeall']) . ' ... </tr>';
...
-----
$skill is instance of Player in highscores.php [name 'skill' is from ooold version of acc. maker...]
$something->data is variable that contains values loaded from database for object $something
 
$account_logged is instance of class 'Account':
https://github.com/gesior/Gesior2012/blob/TFS-1.0/classes/account.php
There are many methods you can use. Some useful 'getters':
getID() - get database ID of account
getName() - get name (login) of account
getMail() - get e-mail of account
getKey() - get recovery-key of account
getCreateIP() - get IP from which account was created (useful to remove all accounts make by IP X)
getCreateDate() - get date of account creation
getPremiumPoints() - get premium points

$account_logged->getMail()
 
Hello everyone!

I downloaded the Gesior 2012, but I have the following problem:


After installing the system of "buying points" I came across a problem
h57mhv0.png


for this reason I clicked on the link which mentions the website: http://otland.net/f479/gesior2012-items-shop-installation-administration-170654/

I could see that it was written by the same author, for this reason, I followed the tutorial to the letter (the images of the end of the post are broken), but the "Admin Shop" was still showing the "error".

I searched for many sites on the web and I found this "adminshop.php", which allowed me to add the items so much easier:


https://mega.co.nz/#!WgthXaTa!tombzlih6GbAYJe4BXIM2OY9HCnod0JU2IRgBMJTeZE
(code using the maximum characters, srry :B)


After carefully reading the code, I noticed this error on the 66 line:
TpXKFpf.png


Now, what is the error? (if they did not have another error xD!). it turns out that there are a few more columns in the SQL statement:
srHWvu7.png


If anyone knows how to fix this error, or have another "adminshop.php" that can facilitate me, I appreciate it fully.
 
Hello everyone!

I downloaded the Gesior 2012, but I have the following problem:


After installing the system of "buying points" I came across a problem


for this reason I clicked on the link which mentions the website: http://otland.net/f479/gesior2012-items-shop-installation-administration-170654/

I could see that it was written by the same author, for this reason, I followed the tutorial to the letter (the images of the end of the post are broken), but the "Admin Shop" was still showing the "error".

I searched for many sites on the web and I found this "adminshop.php", which allowed me to add the items so much easier:
https://mega.co.nz/#!WgthXaTa!tombzlih6GbAYJe4BXIM2OY9HCnod0JU2IRgBMJTeZE
(code using the maximum characters, srry :B)


After carefully reading the code, I noticed this error on the 66 line:
TpXKFpf.png


Now, what is the error? (if they did not have another error xD!). it turns out that there are a few more columns in the SQL statement:

If anyone knows how to fix this error, or have another "adminshop.php" that can facilitate me, I appreciate it fully.
This is working shop admin for Gesior2012:
http://paste.ots.me/560787/text
Works, is safe, but I'm not sure if all options work fine.
 
I have it but it won't show table with player and exp. Also "most online" has bug - it working too fast (15 minutes = 5 hours lol)
 
I have it but it won't show table with player and exp. Also "most online" has bug - it working too fast (15 minutes = 5 hours lol)

Code:
<globalevent name="history" interval="60" event="script" value="history.lua"/>
;o
 
Back
Top