ST Shop

Started by Diego Andrés, June 13, 2009, 06:06:35 AM

Previous topic - Next topic

Chen Zhen

One of my members had mentioned something about this mod which I thought was a request but it seems he was trying to tell me this mod already includes integration with SMF Arcade. I just looked at the change log & can see that it was implemented back in November of 2020. I think you requested that I add custom hooks to SMF Arcade over 4 years ago which I'll assume this uses "integrate_arcade_score".

I'm not familiar with ST Shop just yet as I just installed it on a local. It doesn't seem to be adding any shop credits from arcade scores when I test it. The hook is working as it's shouting scores in EhPortal (which also uses the hook) but I can't seem to get it to work with this mod. Perhaps I'm not seeing an admin setting that needs to be set/triggered? Also I see something about including code via php file modules.. am I missing a module to get this to work with the Arcade?
 
I'll have to poke around with it to figure things out.

Nice work with this btw, I like it.. this looks like a fun mod.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Diego Andrés

Thanks.

I haven't poked around with this MOD in a while. There should be a section in the settings area with integrations and it will display arcade settings which I believe are 3.

The default values are probably zero, so all you'd need to do is set them to the desired amount of credits. Let me know if it is not longer working as expected and I'll have a look.

Quote from: Chen Zhen on June 09, 2024, 11:28:01 PMAlso I see something about including code via php file modules.. am I missing a module to get this to work with the Arcade?
No such thing for the arcade. Only the available modules (not included by default) could be loaded/uploaded manually. Perhaps you saw the one for SA Battle. Modules are just 'functional' items that offer either a functionality or a reward when used.
https://github.com/SMFTricks/ST-Shop-Modules

SMF Tricks - Free & Premium Responsive Themes for SMF.

Chen Zhen


I've set those 3 boxes but it fails to add the credits when saving scores.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Chen Zhen

I took a quick look & found the issue.
Here is a possible solution for you to get your score class to fire:
    /**
     * Arcade::defineHooks()
     *
     * Loads the hooks and languages for this addon
     */
    public static function defineHooks()
    {
        // Shop -> Admin -> Arcade settings
        if (isset($_REQUEST['action']) && isset($_REQUEST['area']) && $_REQUEST['action'] == 'admin' && $_REQUEST['area'] == 'shopsettings')
            add_integration_function('integrate_shop_addons_settings', __CLASS__ . '::settings', false);

        // Arcade -> Score submission
        if (function_exists('Arcade_who_fix'))
            add_integration_function('integrate_arcade_score', __CLASS__ . '::score', false);
    }

Arcade save types (mostly 3rd party) don't use URI's that directly go the arcade (action) page.
The site is directed to a game's high score page after the score is saved to the database.
This is why your class wasn't being fired.. The arcade will fire your class function once a score is saved to the database, Imo just use one of the Arcade's unique function identifiers as a check to see if the Arcade exists prior to adding your hook.

I haven't checked to see if the score class works 100% as intended just yet but it is working with this fix. 

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Diego Andrés

It might not even need a conditional to check if it exist. If the hook doesn't exist it should be skipped without errors because it's temporary?

SMF Tricks - Free & Premium Responsive Themes for SMF.

Chen Zhen

The code was posted just as an example. If you wanted to be more thorough you could use the condition to show the admin if the Arcade is detected or not detected in the settings.

These are just suggestions.. whatever you think will work best.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Diego Andrés

public static function defineHooks()
{
add_integration_function('integrate_shop_addons_settings', __CLASS__ . '::settings', false);
add_integration_function('integrate_arcade_score', __CLASS__ . '::score', false);
}

Should work, no need to check anything.
I will test it when I have some more time.

SMF Tricks - Free & Premium Responsive Themes for SMF.

urangeloflove

I would appreciate some help please.

Here it is:

I just installed this mod and it is so much fun to use.

I observed I can DEPOSIT any amount of money into the bank (which also is MY pocket).

But the problem is... even though on my profile, I can "SEE" that money present...

The forum DOES NOT seem to recognize I got money lol.

So that when I try to "send" someone a token of a gift or try to buy something, it keeps saying I don't have enough money.

Any fixes for this issue please?

Please see the pictures below to understand what I mean.

Anyone?

Diego Andrés

In your attachments it looks like you have negative credits, don't know how you did that, but that's probably your issue.

You can check the shop logs in the admin to see if you can spot what happened.
In any case, since you're an admin you can edit your account and manually change your credits.

SMF Tricks - Free & Premium Responsive Themes for SMF.

urangeloflove

Quote from: Diego Andrés on June 23, 2024, 02:48:55 PMIn your attachments it looks like you have negative credits, don't know how you did that, but that's probably your issue.

You can check the shop logs in the admin to see if you can spot what happened.
In any case, since you're an admin you can edit your account and manually change your credits.

Thank you so much.

Totally makes sense.

Also do forgive me, I'm a total newbie at this.

What file exactly do I edit?

Diego Andrés

You don't need to edit files.
Go to profile > account settings.
And the shop admin is in admin > shop, though you can also access from shop > admin shop.

SMF Tricks - Free & Premium Responsive Themes for SMF.

urangeloflove

Quote from: Diego Andrés on June 23, 2024, 08:02:08 PMYou don't need to edit files.
Go to profile > account settings.
And the shop admin is in admin > shop, though you can also access from shop > admin shop.
Quote from: Diego Andrés on June 23, 2024, 08:02:08 PMYou don't need to edit files.
Go to profile > account settings.
And the shop admin is in admin > shop, though you can also access from shop > admin shop.

Thank you sooooo much for your patience.

I deeply appreciate this.

urangeloflove

Thanks once again. It works perfectly now!

And it's so cool to use.

Wanted to know if there's anyway to get more or new "item modules" for the shop?

For example, can a member buy a private one on one calendly appointment?

Any repository for these extra modules?

Diego Andrés

There aren't many at the moment.
The repo is linked in the description: https://smftricks.com/index.php?board=109.0

I do take suggestions so I'll keep it in a log for future reference.

SMF Tricks - Free & Premium Responsive Themes for SMF.

urangeloflove

@Diego Andrés Officially, I have to mention that YOU and STShop ARE the reason and inspiration that have made me DECIDE to learn some PHP! Hahaha.

This mod is sooooooo coooooool.

Which is why I wanted to know if there were more "item modules" I could pretty much experiment with.

Unfortunately the link in the description which I got in your last reply wound up to a dead end.

Or is it locked away from public Access?

And if not, is there any other place I could access the repo?

I hate to bother you but I will have to coz I'm fascinated!

Do you have possibly a zipped up archive of this repo paraventure?

Diego Andrés

Try the other link: https://github.com/SMFTricks/ST-Shop-Modules

Doubt you'll find them of much use though.

SMF Tricks - Free & Premium Responsive Themes for SMF.

urangeloflove

Quote from: Diego Andrés on June 24, 2024, 11:01:50 PMTry the other link: https://github.com/SMFTricks/ST-Shop-Modules [nofollow]

Doubt you'll find them of much use though.

Thank you mighty much! You ARE a life saver.

TeamKC

Hello Diego,

We've been trying to get the modules to change user titles and the one to change another ones user titles to work, we're able to get them to be in our shop, but once we've bought them, they are set as unusable items, are we missing something to get the be able to use or is it something that wasn't fully developed yet?

I hope you can help us out here, I also put in some screen to show you what we mean exactly.

Greetings,
TeamKC.

Diego Andrés

When you select it from the list of modules, it should be labeled as usable in the database column.

What module are you using for this?

SMF Tricks - Free & Premium Responsive Themes for SMF.

TeamKC

Hello Diego,

Thank you for your quick reply. We were using the modules that are shown in the pictures I attached to my post.

We enabled it manually in our database, eventhough we checked it in the shop, but now they seem to work. Or at least Change other title works the way it should. Change Title on the other hand gives an error, it works, but it doesn't dissappear after it's used.

I'll add some more screens to show the error, and the other things that don't work the way it should.

Advertisement: