News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Question about Hook for bbc code..

Started by Ricky., August 03, 2011, 09:41:21 AM

Previous topic - Next topic

emanuele

Because most likely you are adding them the wrong way...
Multiple functions for the same hook are stored into the same variable in a comma-separated string, so: function1,function2,function3, etc.

Pay attention because if you are using any sort of cache, adding the hooks directly into the database will not change SMF until the cache of $modSettings is invalidated.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Arantor

You know, it's amazing that there isn't a function for conveniently adding hooks that will deal with caching and get the format right.

Wait, you're telling me there IS a function for doing it? And it's called add_integration_function? You don't say!
Holder of controversial views, all of which my own.


Akyhne

QuoteSMF Coding Discussion
Want help writing a modification or theme?

Arantor

So you want help with something when you're deliberately not using the facilities that are present for it... and then wonder why it doesn't work properly.

If you use the add_integration_function it will work - and will work for a reasonable number of hooked functions.
Holder of controversial views, all of which my own.


Akyhne

I guess they will. But just to test something quick, especially in MySql, I sometimes just edit the DB directly.

In this case, I just wanted quickly to add another button. There was no reason to make a mod for that.. I thought.

All Colours Sam

Quote from: Akyhne on October 29, 2012, 02:21:15 PM
I guess they will. But just to test something quick, especially in MySql, I sometimes just edit the DB directly.

In this case, I just wanted quickly to add another button. There was no reason to make a mod for that.. I thought.

There is no need to write a mod... if you want to do things quickly then you can write a simple php file, load SSI.php and then call the function, put that file on your forum root and call it whenever you need it, which is basically what SMF does when someone installs a mod with a hooks or a database file anyway.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

Advertisement: