![]() |
Default text to display in every first post
I'm trying to display some text which will show in every first post in every thread, but I also only want it to display in a specific forum section. The id of the forum is definitely 22 and I've already found some code which apparently should work.
Here is the code I am currently using in the template "ad_showthread_firstpost_start". Code:
<vb:if condition="$forum[forumid] == 22"> If I remove the if condition then the text displays fine, but it obviously then displays in every single thread on the site. I am testing this on a dev forum so the forums are turned off. I can't see that being an issue but thought worth mentioning in case. Any help would be much appreciated! Thanks. |
Have you tried using $thread rather than $forum ?
|
Quote:
I hadn't tried that until you just suggested it but sadly it didn't make any difference. :( |
Has anyone on here ever tried to get default text into the first post of every threads in a specific forum?
Must be someone on here! Any help on how to do it would be greatly appreciated, thanks! |
Looking at the code, you cannot do this without a using a hook.
No variables other than the adsense details are registered for that template when its created, so you need to pre-register either $forum or $thread. PHP Code:
The 'postbit_display_complete' hook should be ok to use. |
Quote:
Unfortunately I haven't done any work with hooks before so not sure where to start! Where would I find the 'postbit_display_complete' hook? Thanks again. |
Go to admincp > Plugins and Products > Add New Plugin and the hooks location is a dropdown and you will find it there.
|
Thank you guys! That worked brilliantly.
Excellent help. Really appreciate it! :) |
Is there any way to adapt this so that the text is entered into the post box while the user is typing the post?
I want to have default text in my for sale sections so users will know what is expected in terms of info. |
Go search for the Stencil Mod. That should do what you want.
|
All times are GMT. The time now is 05:21 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:
|