The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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? |
#2
|
||||
|
||||
<vb:if condition="$thread['postuserid'] == $bbuserinfo['userid']">This is your thread</vb:if>
Not tested yet, but try it. |
#3
|
|||
|
|||
Didn't work
|
#4
|
|||
|
|||
Try $threadinfo instead of $thread.
|
#5
|
|||
|
|||
That didn't work either
|
#6
|
||||
|
||||
Where did you put the code into?
|
#7
|
|||
|
|||
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. |
#8
|
||||
|
||||
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} |
#9
|
|||
|
|||
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. |
#10
|
||||
|
||||
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.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|