Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 27 Dec 2009, 20:17
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Real name: Ace
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.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Now, using the new syntax below, the threadid condition is never true, no matter what template I stick it in:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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
Reply With Quote
  #2  
Old 27 Dec 2009, 20:47
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
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.)
Reply With Quote
  #3  
Old 27 Dec 2009, 21:11
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Real name: Ace
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
Reply With Quote
  #4  
Old 27 Dec 2009, 23:07
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
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.)
Reply With Quote
  #5  
Old 28 Dec 2009, 00:28
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Real name: Ace
OK.. replace that template name with 'navbar' then.
__________________
vBulletin Styles (All styles compatible with 3.8.4 - Steel Blue 4.0 Available) | vBulletin Hosting
Reply With Quote
  #6  
Old 28 Dec 2009, 05:52
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
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.)
Reply With Quote
  #7  
Old 28 Dec 2009, 07:47
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Real name: Ace
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
Reply With Quote
  #8  
Old 28 Dec 2009, 16:19
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
I would guess something like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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.)
Reply With Quote
  #9  
Old 30 Mar 2010, 12:41
tintin74 tintin74 is offline
 
Join Date: Jul 2007
Hello, I'm running vb 3.7 and I've used this code to display specific ads for specific thread:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

, I've create the "showthread_specads" custom template,

and this plugin:

Product:Vbulletin
Name: showthread_specads
Code:
eval('$specads = "' . fetch_template('showthread_specads') . '";');
My custom template is called normally by showthread but if I insert into it the same conditional I've used for SHOWTHREAD template, the conditional don't work .

I suppose there 's something to change here :


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

but I don't know what.

Does anyone could help me ,please?
Reply With Quote
  #10  
Old 30 Mar 2010, 15:32
ForumsMods's Avatar
ForumsMods ForumsMods is offline
 
Join Date: Aug 2007
Real name: Adrian Sacchi

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #11  
Old 30 Mar 2010, 16:36
tintin74 tintin74 is offline
 
Join Date: Jul 2007
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!
Reply With Quote
  #12  
Old 30 Mar 2010, 23:14
ForumsMods's Avatar
ForumsMods ForumsMods is offline
 
Join Date: Aug 2007
Real name: Adrian Sacchi
Yes, this forums is for vB 4, hehe.
Reply With Quote
  #13  
Old 26 Aug 2012, 04:31
prawn_86 prawn_86 is offline
 
Join Date: Nov 2008
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
Reply With Quote
  #14  
Old 26 Aug 2012, 04:36
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
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.)
Reply With Quote
  #15  
Old 26 Aug 2012, 04:43
prawn_86 prawn_86 is offline
 
Join Date: Nov 2008
Originally Posted by Lynne View Post
Is the $thread variable registered for use in that template? Try using $GLOBALS instead.
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
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 07:27.

Layout Options | Width: Wide Color: