vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   vBulletin conditionals in BB Code templates (https://vborg.vbsupport.ru/showthread.php?t=230089)

Silviu 12-13-2009 08:56 AM

vBulletin conditionals in BB Code templates
 
1 Attachment(s)
Hello everyone,

Recently we've decided to implement Google Ads in our forums and, as a first step, we used this hack - https://vborg.vbsupport.ru/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 in attachment #1:

The problem is represented by the quote table width, which by default is 100%. If we were to change this to, say, 76%, the issue would be solved - see attachment #2.

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

So, the two main questions are:

1. Can vBulletin conditionals even be used in BB Code templates?
2. If so / not, is there any way to overcome this problem? :confused:

Lynne 12-13-2009 02:34 PM

I don't know if conditions can be used in bbcode. The thing is, if you are caching the posts, then I think the bbcode is already parsed in the cached post and so a condition won't work.

Also, setting it to 76% may make it work on *your* browser, set at the width *you* have it set at, but it won't necessarily work on all browsers. I don't know that modificaiton, but maybe you can do something to the image code to make the text wrap around it instead?


All times are GMT. The time now is 01:33 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.00994 seconds
  • Memory Usage 1,713KB
  • 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
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete