![]() |
|
Thread Tools |
#1
|
||||||||
|
||||||||
threadid conditional - Not working the same?
Scenario: I want to display ads on all showthread pages (preferably in postbit), with specific ads for specific threads, and general ads for the rest.
In vB3, this was a matter of using this code wherever the ad was, and it would replace the generic ad with the specified one.
Now, using the new syntax below, the threadid condition is never true, no matter what template I stick it in:
I've tried $thread['threadid'], $threadinfo['threadid'], $post['threadid'], and all without the '' inside the []. I'm beginning to lose it. Please help.
__________________
vBulletin Styles (All styles compatible with 3.8.4 - Steel Blue 4.0 Available) | vBulletin Hosting No members have liked this post.
|
#2
|
||||
|
||||
It should be <vb:else /> not <vb:else/> Other than that, I don't see anything wrong.
__________________
Former vBulletin.org Staff Member
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before. W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) No members have liked this post.
|
#3
|
||||
|
||||
Ahh.
Thanks Lynne. ![]() Should it work in ad_global_below_navbar? If not, what variable am I meant to be checking for if I want to use that template?
__________________
vBulletin Styles (All styles compatible with 3.8.4 - Steel Blue 4.0 Available) | vBulletin Hosting No members have liked this post.
|
#4
|
||||
|
||||
I really don't know as I never use the ad templates.
__________________
Former vBulletin.org Staff Member
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before. W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) No members have liked this post.
|
#5
|
||||
|
||||
OK.. replace that template name with 'navbar' then.
![]()
__________________
vBulletin Styles (All styles compatible with 3.8.4 - Steel Blue 4.0 Available) | vBulletin Hosting No members have liked this post.
|
#6
|
||||
|
||||
If you look at the functions.php page where the navbar is rendered, the thread variable is not registered. So, you would have to preregister it if you want to use it there.
__________________
Former vBulletin.org Staff Member
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before. W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) No members have liked this post.
|
#7
|
||||
|
||||
Any chance you can help with that?
I can preregister my own custom variables, but preregistering $threadid for use on showthread.php seems to be difficult.
__________________
vBulletin Styles (All styles compatible with 3.8.4 - Steel Blue 4.0 Available) | vBulletin Hosting No members have liked this post.
|
#8
|
||||
|
||||
I would guess something like this:
Take a look in the code for where the navbar is rendered and make sure you pick a hook location that is executed before that.
__________________
Former vBulletin.org Staff Member
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before. W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) No members have liked this post.
|
#9
|
||||||||||||
|
||||||||||||
Hello, I'm running vb 3.7 and I've used this code to display specific ads for specific thread:
but if I use this conditional into the SHOWTHREAD template everything works well. I need to get work thi conditional into a custom template called by SHOWTHREAD template, so I've inserted into SHOWTHREAD template this:
, I've create the "showthread_specads" custom template, and this plugin: Product:Vbulletin Name: showthread_specads Code:
I suppose there 's something to change here :
but I don't know what. Does anyone could help me ,please? No members have liked this post.
|
#10
|
|||
|
|||
No members have liked this post.
|
#11
|
|||
|
|||
Hello , vB Style,
I think this sintax <vb:if> </vb:if> works for vb4.0 version. But the rest is OK! Thank you very much! ![]() No members have liked this post.
|
#12
|
|||
|
|||
Yes, this forums is for vB 4, hehe.
No members have liked this post.
|
#13
|
|||
|
|||
I am having the same issue. Have just upgraded to VB4 and am trying to put the following code into the ad_showthread_firstpost template:
<vb:if condition="$thread['threadid'] == 87"> <center> <b>This thread is brought to you by:</b> <br> <center> <a href="http://..../ " target="_blank">wording here </a> </center> <br> </vb:if> Can anyone see what i am doing wrong?
__________________
www.aussietravellersforum.com.au - Not just for Aussies. Share your view of the world No members have liked this post.
|
#14
|
||||
|
||||
Is the $thread variable registered for use in that template? Try using $GLOBALS instead.
__________________
Former vBulletin.org Staff Member
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before. W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) No members have liked this post.
|
#15
|
|||
|
|||
Originally Posted by Lynne
Sorry Lynne i am very green at this, do i replace $thread with $GLOBALS and leave the rest?![]()
I have tryied a few different variations on your suggestion but still cannot get it working --------------- Added 26 Aug 2012 at 05:13 --------------- Just as a side note, putting the code into the ad_showthread_firstpost_start template works when i replace thread with global. I still can't figure out how to get it showing between the 1st and 2nd post on each page
__________________
www.aussietravellersforum.com.au - Not just for Aussies. Share your view of the world No members have liked this post.
|
![]() |
«
Previous Thread
|
Next Thread
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 01:38.