![]() |
Condition worked in 4.0.1, but not in 4.0.2
This was the same conditional IF command I was using on 4.0.1, upgraded and now it no longer works?
Template: Postbit Code:
<vb:if condition="(THIS_SCRIPT == showthread) AND (($post[postcount] % 5) == 0)"> Even taking out the "THIS_SCRIPT == showthread) AND" did not resolve the issue. Please help :) |
Did you try printing out the value of $post[postcount] to see what was going on? It should work. You are using the postbit template and not the postbit_legacy template, right?
|
Correct. I am using the postbit template and not postbit_legacy.
I typed in $post[postcount] in the postbit --- It put 5 "$post[postcount]" underneath the first post but not under any other posts (I'd expect it to do it under EACH post, not at the end of the first post). I replaced the $post[postcount] with {vb:raw post.postcount} and refreshed, now under the first post I see "1 2 3 4 5" --- There are 5 posts in this thread. Edit: I have also disabled all of my modifications to see if it was a mod and I am still able to produce. :( |
I just put that code into my postbit template and it shows up in post 5 and 10 of my 12 post thread. Are you sure it isn't in the page source at all?
|
Well I feel like a complete idiot. I wasn't really paying attention to the code I was putting in between those fields. I was accidentally putting a counter code in the postbit instead of the banner code. I feel completely ridiculous - I have a cold from Hell and it is totally screwing with me.
Thanks Lynne - always appreciate your help. Edit: So I put the right code in --- but the DIV attachments is spreading from post 1 to post 5 and ends with the banner, starts up again post 6 and ends with post 10... maybe I have to RE-revert my templates... *hates doing this* |
Check your code that you closed your tags correctly.
|
Thanks guys! This worked great!!
|
I tried this code with VBulletin 4.2.3 and it only shows the ad after the 5th post. What needs to change so that it shows an ad every 5th post?
Code:
<vb:if condition="(THIS_SCRIPT == showthread) AND (($post[postcount] % 5) == 0)"> |
Wow, 6.5 year old thread .....
As posted, that will generate at least two php warnings, it should be 'showthread' not showthread (i.e. with single quotes), postcount should also be [single] quoted. |
Quote:
Code:
if condition="(THIS_SCRIPT == 'showthread') AND (($post['postcount'] % 5) == 0) |
All times are GMT. The time now is 02:56 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:
|