View Single Post
  #3  
Old 12-03-2009, 03:35 AM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

BB Code For Tables

Here's how I made the bb code in the BB Code Manager:
[table%] = <div><table width={option}>{param}</table></div>

[tr] = <tr>{param}</tr>

[td%] = <td width={option} valign = "top">{param}</td>

[td] = <td valign = "top">{param}</td>
Be sure to set "Use {option}" to yes where appropriate and "Disable BB Code Within This BB Code" to no.

These tags work fine (except as noted in my previous post) so long as you use them properly. But as one of my forum members was quick to demonstrate, you can make a mess of thread layout if you don't close all the tags. I solved the problem with a template modification, which I'll describe in my next post.

--------------- Added [DATE]1259818896[/DATE] at [TIME]1259818896[/TIME] ---------------

Template Modification

To solve problems caused by improper use of my table tags I created a cordon sanitaire to prevent the html from the bb code from messing up the thread layout. All it is is a table around the message area. Any unclosed table tags within a table cell are not executed.

To create the cordon sanitaire go to the postbit template and scroll down about 40% to find this:
<!-- message -->
<div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
$post[message]
</div>
<!-- / message -->
Place the following modifications above and below as follows:

<table cellpadding = "0" width ="100%">
<tr>
<if condition="$show['moderated']">
<td class="alt2" width="100%" id="td_post_$post[postid]">
<else />
<td class="alt1" width="100%" id="td_post_$post[postid]">
</if>


<!-- message -->
<div id="post_message_$post[postid]">
$ad_location[ad_showthread_firstpost_start]
$post[message]
</div>
<!-- / message -->
</td></tr>
<tr>
<if condition="$show['moderated']">
<td class="alt2" width="100%" id="td_post_$post[postid]">
<else />
<td class="alt1" width="100%" id="td_post_$post[postid]">
</if>
Now scroll about 90% down and modify as follows:
<!-- / controls -->
</div>
</td></tr></table>
<!-- message, attachments, sig -->

</td>
</tr>
</table>
$template_hook[postbit_end]
--------------- Added [DATE]1259819120[/DATE] at [TIME]1259819120[/TIME] ---------------

Quote:
Originally Posted by Lynne View Post
There is actually another thread about this exact issue. I don't remember what the solution was, but you may want to do a search for it.
Oops, my bad! I'll have a look. Thanks.

--------------- Added [DATE]1259896866[/DATE] at [TIME]1259896866[/TIME] ---------------

I think this is the thread you were referring to: https://vborg.vbsupport.ru/showthrea...ighlight=table.

It doesn't actually offer a solution but directs to BB Code [table], which isn't quite what I want.

Still looking for help!
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01892 seconds
  • Memory Usage 1,780KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete