Skip to main content
Topic: Known Hook addons not working right (Read 3964 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Known Hook addons not working right

Reply #15

Oh yes. The if. It should be unique for each $modsettings. Sorry about that. :)

Re: Known Hook addons not working right

Reply #16

I'll try to give you a different way to look at them hooks.

In ElkArte code you see for example:
Code: [Select]
call_integration_hook('integrate_general_mod_settings', array(&$config_vars));
You look at it because you want to add a new setting and you think WTH!

So, I'll tell you, when you see such function in the code, you can "translate" it to:
Code: [Select]
This_is_my_addond_function(&$config_vars);
This is what the code does. Really. That's all (for what matters *to you*).

A practical example.
In this addon you are adding settings, right?
And you do that with the function "GHF_Settings", correct?
So, in the install file of the addon, you have the string:
Code: [Select]
'integrate_general_mod_settings' => 'GHF_Settings|SOURCEDIR/addons/GHF.subs.php',
again, WTH?!?! :P

Let's translate it into an "English-like" thing.
In the code, where there is the
Code: [Select]
call_integration_hook('integrate_general_mod_settings', array(&$config_vars));
line, ElkArte will do this:
Code: [Select]
require_once(SOURCEDIR . '/addons/GHF.subs.php');
GHF_Settings(&$config_vars);

If you look at the string in your install file, you see the three pieces:
Code: [Select]
'integrate_general_mod_settings'
Code: [Select]
'GHF_Settings
Code: [Select]
SOURCEDIR/addons/GHF.subs.php',

Dunno if it helps explaining them or just makes things more confused. LOL
Bugs creator.
Features destroyer.
Template killer.

Re: Known Hook addons not working right

Reply #17

It helps indeed. Those with strong php knowledge and experience will understand better. For me, I just try coding to make some sense from a copy paste. :D