Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
show-topic
Prgram Hooks, How to?
Avatar
derixc
Philippines
Member
Free Members
sp_UserOfflineSmall Offline
Oct 6, 2008 - 7:46 pm

Aside from the online help, is there anybody here who can help me how to use the program hooks the newbie way? 😀

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 6, 2008 - 8:07 pm

depends on what you want to do...   the hooks are located in various key spots of the forum code...  if you edit the sf-hook-template.php (or in v4, edit sf-hook-template.txt and rename to sf-hook-template.php) and find the hook you want to utilize...  simply add your code into one of the current hooks... each hook is commented as to when its called...

Avatar
derixc
Philippines
Member
Free Members
sp_UserOfflineSmall Offline
Oct 6, 2008 - 8:42 pm

Got it! I just need to insert it between the ' ' of the return statement right?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Oct 7, 2008 - 3:41 am

same answer really... depends what you want to do.

If you just want to display a string of text then yes, you could put it between the quotes in the return statement. Whatever does get returned will display but perhaps a hint of what you want might help us anwser better.

andy-signature.png
YELLOW
SWORDFISH
Avatar
derixc
Philippines
Member
Free Members
sp_UserOfflineSmall Offline
Oct 7, 2008 - 4:32 pm

At first, it will be for adsense...second, probably some small reminders for the forum itself. For adsense, I just need to insert the whole script isn't?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Oct 7, 2008 - 5:13 pm

I don't have a clue. I don't use it so I do not know what they give you I'm afraid

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 7, 2008 - 8:01 pm

yes, I believe you want the whole javascript code...  I think it just echos it out, so you should be good...   for the messages, just the text you want output, though I would check the custom tab on the spf manage options panel first as you may be able to do that there...

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Oct 8, 2008 - 2:59 am

Yopu must not 'echo' anything in the hooks. Always return it.

andy-signature.png
YELLOW
SWORDFISH
Avatar
derixc
Philippines
Member
Free Members
sp_UserOfflineSmall Offline
Oct 8, 2008 - 6:32 am

Yellow Swordfish said:

Yopu must not 'echo' anything in the hooks. Always return it.


I'm confuse...does it mean that I can't place the entire code directly? 😐

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 8, 2008 - 7:11 am

Andy means, dont use a php echo statement anywhere in the hook... that you want to return a string to be output from the hook...  either return a variable that contains the string or the string itself...

in your case, you can set a variable to the google adsense code (inside " ") and return the variable...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626