Quote BBCode conditional for the second post in a thread

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Silviu
    Senior Member
    • May 2001
    • 163
    • 3.6.x

    Quote BBCode conditional for the second post in a thread

    Hello everyone,

    Recently we've decided to implement Google Ads in our forums and, as a first step, we used this hack - http://www.vbulletin.org/forum/showthread.php?t=222389

    Now, instead of [maxposts] == 1 we used 2, so the ad will always be displayed in the second reply on the page.

    However, there's a "snag" with the Quote BBCode, as seen below:

    Click image for larger version

Name:	Quote Issue.jpg
Views:	1
Size:	68.6 KB
ID:	3712566

    The problem is the table width, which by default is 100%. If we were to change this to 76%, the issue would be solved:

    Click image for larger version

Name:	Quote Fixed.jpg
Views:	1
Size:	69.6 KB
ID:	3712565

    The second "however" comes from the fact that we don't want to globally change the Quote BB Code, just for the second reply on every page.

    To that end, we went to

    Admin CP -> Styles & Templates -> Style Manager -> « » -> BB Code Layout Templates -> bbcode_quote

    And tried to use the following conditional for the main table:

    HTML Code:
    <if condition="$post['postcount'] % $vboptions['maxposts'] == 2">
    <table cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="76%">
    <else />
    <table cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%">
    </if>
    Unfortunately, the quote output is still always displayed with 100% width, which means that we haven't set the conditional correctly

    Any advice on how to overcome this problem would be greatly appreciated
  • Silviu
    Senior Member
    • May 2001
    • 163
    • 3.6.x

    #2
    Can someone at least tell us if it's even possible to use vB conditionals in the bb templates?

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...