[GESIOR2012] Items Shop Installation/Administration

Loth Gena

Roxeria 8.60 Developer
Joined
Feb 5, 2014
Messages
246
Reaction score
21
Location
UK
Gesior can you release a tutorial for old tfs 0.2? as it doesnt have globalevents, thanks
 

Lyky

Active Member
Joined
May 27, 2014
Messages
204
Reaction score
45
@Gesior.pl
Hi,
I have just installed the acc maker and enabled the module on "?subtopic=shopsystem" I'm getting following:


Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 84
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 86
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 98
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 98
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 107
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 127
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 147
Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\pages\shopsystem.php on line 147

Have I missed something? It shouldn't just error out like that should it?
 
OP
Gesior.pl

Gesior.pl

Mega Noob&LOL 2012
Joined
Sep 18, 2007
Messages
1,988
Reaction score
899
Location
PLand
@Lyky
You should disable errors and warnings in PHP.
You can try to change index.php:
Code:
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE);
To:
Code:
error_reporting(0);
Then it won't show any errors on website.

Acc. maker has a lot of 'small bugs'. Not related to security/functionality, just code isn't clean.
 

Webtimize

Pro Grammer
Joined
Oct 3, 2011
Messages
485
Reaction score
153
Location
The Netherlands
Suppressing all errors is never a great idea, especially when you're not checking logs regularly.
It's actually a PHP > 7.2 behavior, you can prevent this by applying the following fixes:

Replace shopsystem.php > line 84:

PHP:
if( is_array($offer_list['item']) && count($offer_list['item']) > 0)

Replace shopsystem.php > line 86:

PHP:
elseif( is_array($offer_list['container']) && count($offer_list['container']) > 0)

Replace shopsystem.php > line 98:

PHP:
if( (is_array($offer_list['item'] && is_array($offer_list['container'])) && (count($offer_list['item']) > 0) or (count($offer_list['container']) > 0))

Replace shopsystem.php > line 107:

PHP:
if( is_array($offer_list['item']) && (count($offer_list['item']) > 0) and ($action == 'item'))

Replace shopsystem.php > line 127:

PHP:
if( is_array($offer_list['container']) && (count($offer_list['container']) > 0) and ($action == 'container'))

Replace shopsystem.php > line 147:

PHP:
if( (is_array($offer_list['item']) && is_array($offer_list['container'])) && (count($offer_list['item']) > 0) or (count($offer_list['container']) > 0))

I have not tested this, since I am not running any AAC. It's a pretty straight forward fix, and you can compare the current line to the new line to see what's happening if you're really wondering.

> PHP: Backward incompatible changes - Manual
> PHP: count - Manual
 
Last edited:

Tecrtr

New Member
Joined
Jan 30, 2019
Messages
12
Reaction score
0
Hello, I have ots rl map tibia 10.00 with the forgotten server engine on my server vps on ovh.

How to create a store so that you can buy points and for points to buy in the store items or in the game for mounts, outfits, xb boost, etc.

Where in what file and what should I set, what script? I am asking for a specific guide.

In the picture I'm sending like shop for me after uploading ots.

I configured it as the tutorial shows:


But I do not fully understand the last part.

And I do not know if I copied those scripts well.

1. config.php looks like this when it comes to the store:

// ---- Config Shop ----
$ outfits_list = array ();
$ loyalty_title = array (50 => 'Scout', 100 => 'Sentinel', 200 => 'Steward', 400 => 'Warden', 1000 => 'Squire', 2000 => 'Warrior', 3000 => 'Keeper', 4000 => 'Guardian', 5000 => 'Sage');
$ config ['shop'] ['newitemdays'] = 1; #days to item be new in shop


and here I added:

"$ config ['site'] ['shop_system'] = true; // show server shop only 'LUA scripts of shop'

2. where to copy:

"<globalevent name =" website_shop_item_delivery "interval =" 30 "event =" script "value =" shop.lua "/>"

I copied under "<! - Others ->" in globalevents.xml

Do you need a completely different guide?
 

Attachments

Top