![]() |
Help with some hooks
Hello!
I've built this recursive function and put it in the hook showthread_start: PHP Code:
Can you please help? Thanks. |
If you put a function in postbit_display_start, it gets called everytime the postbit is called on the showthread page - so 15, 20 times (whatever your default is) - which is why you get told the function already exists.
|
You're right! Thanks!
So can you please tell me in which hook i should implement this function, in order to be able to use the variable "$show_ads_in_this_forum" in both SHOWTHREAD and in POSTBIT_LEGACY templates? |
postbit_legacy (or postbit) is called in the showthread template. So, I would think you would be fine just calling this in the showthread hook. Is it not working in there? You may need to change it from $forum[forumid] and $forum[parentid] to $foruminfo[whatever]. Or, you may need to use $thread instead of $forum. Play around with it a bit. (Sorry, that's the way I code, I just play around with it until it works.)
|
You could make use of vB's functions, let it do the hard work for you :p
PHP Code:
|
Why so complicated?
PHP Code:
|
Andreas, wouldn't that fail if 341 was on the top or bottom of the list?
(ie. only a comma in the end or beginning) Never mind, i should learn to read things good. ;) |
Thanks Andreas!
You helped me a lot :) |
Quote:
|
Yes saw that after i posted, hence my last line (which you did not quote;) )
|
All times are GMT. The time now is 09:14 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|