vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Parsing BBcode in 3.6.5 (https://vborg.vbsupport.ru/showthread.php?t=185729)

brakken 07-19-2008 07:08 AM

Parsing BBcode in 3.6.5
 
<a href="https://vborg.vbsupport.ru/archive/index.php/t-82693.html" target="_blank">https://vborg.vbsupport.ru/archi...p/t-82693.html</a>

When I run the text through this code it returns it unformatted. When I try to include global.php from ./forums the entire vbulletin crashes. Is there a new way to parse the bbcode, html, etc ... data in v3.6.5?

Thanks in Advance,
brakken

Opserty 07-19-2008 08:19 AM

Post the code you are using. Are you trying to parse the BBCode in a file which is not in the /forums directory?

brakken 07-19-2008 09:27 AM

Code:

$text = '[ url = http://www.tehskeen.com]tehskeen[ / url ]';

require_once(DIR . '/global.php');
require_once(DIR . '/includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$parsed_text = $parser->do_parse($text, $do_html, $do_smilies, $do_bbcode, $do_imgcode, $do_nl2br, $cachable);

echo $parsed_text;

I spaced the URL tag so it would not be parsed here.

Output is same as input - it doesn't get parsed. I am running the PHP code as a script in a content block in vbportal, but I checked the paths with the DIR statement and they are correct.

Opserty 07-19-2008 09:49 AM

You need to set the variables $do_xxxx

The easiest way is just to replace them with true/false. Like so:
PHP Code:

$parsed_text $parser->do_parse($textfalsetruetruetruetruetrue); 



All times are GMT. The time now is 06:25 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.01079 seconds
  • Memory Usage 1,715KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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