![]() |
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. PHP Code:
PHP Code:
|
It should be <vb:else /> not <vb:else/> Other than that, I don't see anything wrong.
|
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? |
I really don't know as I never use the ad templates.
|
OK.. replace that template name with 'navbar' then. :)
|
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.
|
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. |
I would guess something like this:
PHP Code:
|
Hello, I'm running vb 3.7 and I've used this code to display specific ads for specific thread:
Code:
<if condition="$thread['threadid'] == '12345'">Specific Ad for Thread #12345 I need to get work thi conditional into a custom template called by SHOWTHREAD template, so I've inserted into SHOWTHREAD template this: PHP Code:
and this plugin: Product:Vbulletin Name: showthread_specads Code: Quote:
I suppose there 's something to change here : Code:
<if condition="$thread['threadid'] == '12345'">Specific Ad for Thread #12345 Does anyone could help me ,please? |
HTML Code:
<vb:if condition="$threadinfo['threadid'] == '12345'"> |
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! :up: |
Yes, this forums is for vB 4, hehe.
|
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? |
Is the $thread variable registered for use in that template? Try using $GLOBALS instead.
|
Quote:
I have tryied a few different variations on your suggestion but still cannot get it working --------------- Added [DATE]1345954389[/DATE] at [TIME]1345954389[/TIME] --------------- 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 |
In case I save somebody the time to do the research:
PHP Code:
For CMS articles I used: PHP Code:
|
All times are GMT. The time now is 09:19 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:
|