vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to close all bbcode tags (https://vborg.vbsupport.ru/showthread.php?t=104646)

waza 01-06-2006 06:24 PM

How to close all bbcode tags
 
Hey,
I want to show only a peace of a post on a page.
So I cut the string to x chars, but I'm afraid If I'm going to parse it, and there are tags, where to closing part has been cut off, they'll mess up my layout.

So, is there a function in vb that closes all open bb tags that have not yet been closed?

grz,
seba

vietkieu_cz 01-06-2006 06:30 PM

vBulletin Options/vBulletin Options/BB Code Settings/Enabled Built-in BB Codes -> Yes/No :D Maybe it is

waza 01-06-2006 06:44 PM

Euh, it's not that what I'm looking for, but thx

calorie 01-06-2006 07:01 PM

Perhaps check out how thread preview is done in the process_thread_array function. Otherwise, you'll probably need to write a regexp to right trim off broken tags. Trying to close a random number of random tags, while accounting for any that get cut, isn't an easy problem, but you probably already know that. ;)

waza 01-07-2006 07:40 AM

nah, that function doesn't do that, (at least, with a first look at it).
I think I'm just going to strip the bbcode out of it and then cut it off.
Thx

calorie 01-07-2006 07:49 AM

Right, the process_thread_array function doesn't close tags, but it's an alternative approach. Done regexp to right trim off broken tags, easier than trying to close a random number of random tags, broken and all, but the thread preview approach might, might not, get you closer to what you want. :)


All times are GMT. The time now is 01:28 AM.

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.01495 seconds
  • Memory Usage 1,707KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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