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

Shop system Znote AAC

dchampag

Intermediate OT User
Joined
Jul 15, 2008
Messages
772
Reaction score
102
Location
USA
Hey there otland,

I am using the latest Znote AAC, I added this function for the shop system so that I can add items to shop through database.


PHP:
function get_shop_offers() {
    return mysql_select_multi("SELECT `type`, `itemid`, `count`, `description`, `points` FROM `znote_shop`;");
}

This is working for the tables and shop list, but I am unable to purchase the first item on the list, I cannot figure out why. I am not getting any errors in my log, every other item purchase works as it should. What would be the difference between adding items to the table category_items from this function versus config.php shop_offers? When the items are added to config['shop_offers'], there is no issues. Thank you!

Website link is as follows
 
Bump. Can anyone explain to me why the table generated from this MySQL script is causing issues for the first item, but not when using the manual table in config?
 
UPDATE, I was able to dump the variables from the array and see that the array key was initiating with 0 instead of 1 and that was the only difference. the solution for this is as follows if anyone has this issue.

PHP:
if ($shop['useDB'] === true) {
    $shop_list = get_shop_offers();
    array_unshift($shop_list, "phoney");
    unset($shop_list[0]);
} else {
    $shop_list = $config['shop_offers'];
}
 

Similar threads

Back
Top