![]() |
Condition to show ONLY TO THREAD OWNER?
Is there a vbif condition to check if a user is the creator of the thread?
I want to put an ad on threads that show only to the user who started the thread. Something like, Code:
<vbif condition=(user_started_thread)>This is your thread!</vbif> Is there something for this? |
<vb:if condition="$thread['postuserid'] == $bbuserinfo['userid']">This is your thread</vb:if>
Not tested yet, but try it. |
Didn't work :(
|
Try $threadinfo instead of $thread.
|
That didn't work either :(
|
Where did you put the code into?
|
I'm just using it in the "under navbar" advertisement slot right now.
Once I get the conditions to work there, I'm going to try integrating it elsewhere. |
So, try it in SHOWTHREAD template, add this code
<vb:if condition="$thread['postuserid'] == $bbuserinfo['userid']">This is your thread</vb:if> or <vb:if condition="$threadinfo['postuserid'] == $bbuserinfo['userid']">This is your thread</vb:if> under {vb:raw navbar} |
would that conditional work in one template and not another? Shouldn't it work anywhere if it was going to?
Basically I'm just going to put a link under the first post of threads (probably in the postbit_legacy template) in a certain forum, and only show it to whoever created the thread. I'm just using this code inside the advertising spot to get it working in the first place, I can use other conditionals here just this one you provided isn't working. Nothing shows up at all. |
Only variables that are registered for use in a template may be used in that template. So yes, it very much depends on what template you are going to be using the condition in. Try using $post in the postbit template instead of $thread or $threadinfo.
|
All times are GMT. The time now is 11:47 PM. |
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:
|