Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 12-13-2009, 08:56 AM
Silviu's Avatar
Silviu Silviu is offline
 
Join Date: Oct 2001
Location: Bucharest, Romania
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default vBulletin conditionals in BB Code templates

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?
Attached Images
File Type: jpg Quote Issue.jpg (68.6 KB, 0 views)
File Type: jpg Quote Fixed.jpg (69.6 KB, 0 views)
Reply With Quote
  #2  
Old 12-13-2009, 02:34 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 07:48 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.05996 seconds
  • Memory Usage 2,184KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_attachment
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete