vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Condition worked in 4.0.1, but not in 4.0.2 (https://vborg.vbsupport.ru/showthread.php?t=236617)

utahraves 02-22-2010 07:56 PM

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)">
<div class="attachments" align=center>
...
</div>
</vb:if>

The code is to display a banner after every five posts only in SHOWTHREAD (postbit shows up as private messages too).

Even taking out the "THIS_SCRIPT == showthread) AND" did not resolve the issue.
Please help :)

Lynne 02-22-2010 09:50 PM

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?

utahraves 02-22-2010 11:11 PM

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. :(

Lynne 02-23-2010 12:58 AM

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?

utahraves 02-23-2010 04:55 PM

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*

Lynne 02-23-2010 08:22 PM

Check your code that you closed your tags correctly.

cmiller1014 03-30-2010 07:37 PM

Thanks guys! This worked great!!

Curious Too 10-06-2016 11:50 AM

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)">

Paul M 10-06-2016 02:45 PM

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.

Curious Too 10-06-2016 04:56 PM

Quote:

Originally Posted by Paul M (Post 2576681)
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.

Thanks. The ad shows but does not repeat every 5 posts -- it only shows after the 5th post.

Code:

if condition="(THIS_SCRIPT == 'showthread') AND (($post['postcount'] % 5) == 0)
Is this the correct conditional for showing an ad every x number of posts?


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
  • Page Generation 0.01175 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete