Okay, I know my addon works, as I have it installed on a few sites, but it seems whenever I install, it installs and the boxes in settings show up, but they do nothing, when enter anything into them.
After some time, it seems it just starts working, usually.
We mentioned this in another topic, where someone had a similar issue with an addon.
I think this needs to be tracked.
Thats very strange indeed. ... I'll would take a look but I'm pretty much unable to do anything until next week as I'm traveling ATM and will not be home until then :(
Moar info needed. :P
Any one of your addons? Or just some in particular? If the latter which?
Which topic? Do you remember it?
Addon is my Global Header & Footer.
As for the topic, I don't remember, but when get back to my pc, I'll look through my posts to find it.
The BBC Move topic... http://www.elkarte.net/community/index.php?topic=1750.msg18572#msg18572
The hook version or non-hook? If I am not mistaken, you didn't put div or table for your addon position. Can adding that fixes your problem?
The hooks version, hence the title.... LOL :)
That should not matter, and did not for the other sites, including the demo site, where it finally started working, after a bit of time.
That's the strange part, and it's not browser cache, either, as even others could not see what was entered, including statcounter, when added the code, it said code was not present.
Strange indeed. It could be your database problems. Or some files could be missing their contents. They happen sometimes.
Installed locally without problem....
It started working immediately after I clicked.
What version of php do you have? Maybe built-in OPcache is playing you tricks?
That one was a "slightly" different issue: http://www.elkarte.net/community/index.php?topic=1750.msg18590#msg18590
Yes, but we had thought it could be the same, at the time... LOL
Current PHP version: 5.5
Funny thing is, it installs and works on some sites, but not others.
DeadMan's site, it would not show any of what entered into the boxes, and the Addon Demo site worked after a while.
Now, doing hooks, will that install into custom themes, the way it's coded?
I just thought of that. DeadMan's site is using Silence theme, and maybe the calls the addon looks for, are not present?
EDIT:
Looks like I may have found the issue,
Install the addon, and enter something into the copyright, but not the below linktree box, and tell me what happens.
Indeed a bug... of the addon. :P
You are testing only global_mid, so if that is not inserted, nothing is shown.
You should split the "if" clock and for each one check if the corresponding setting is filled or not and add it to $gfh accordingly. ;)
Don't forget, I do not know hooks...
@ahrasis did that part for me. ;)
Fixed, and package replaced. :)
That's not really about hooks. ;)
Don't be afraid of hooks, they do not bite!! :P
No, but they can very hard to tell what the heck to do.... LOL
One look, and I'm so lost....
Buffer is like that can change BK to BurkeKnight so long BK can be found in that template. If BK is now BN in custom template, then you should change or add that into the subs file accordingly. We try to find unique elements and hook so that in won't disturb others.
It was not that, it was the if for each had to be done.
Way it was, they all were in the same if.
Oh yes. The if. It should be unique for each $modsettings. Sorry about that. :)
I'll try to give you a different way to look at them hooks.
In ElkArte code you see for example:
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:
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:
'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
call_integration_hook('integrate_general_mod_settings', array(&$config_vars));
line, ElkArte will do this:
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:
'integrate_general_mod_settings'
'GHF_Settings
SOURCEDIR/addons/GHF.subs.php',
Dunno if it helps explaining them or just makes things more confused. LOL
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