vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   external php parse bb code (https://vborg.vbsupport.ru/showthread.php?t=154426)

nhatrang 08-06-2007 06:37 AM

external php parse bb code
 
Hi guys,

currently, I'm writing sql queries to bring out pagetext from postid's... However, it has bb code in it... How can I parse bb code with an external php file?

Any kind of help would be appreciated!

Thank you so much in advance.

Dismounted 08-06-2007 06:39 AM

Look for the tutorial "Adding Editor". You can take out the part where it parses the BB Code.

nhatrang 08-06-2007 06:43 AM

where is the tutorial located? here? or vbulletin.com?

Dismounted 08-06-2007 06:47 AM

If you searched here anyway, you'd find it. I dug it out for you since I'd waste more time if I had to keep coming back.
PHP Code:

require_once(DIR '/includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletinfetch_tag_list());

$message $parser->do_parse($messagefalsetruetruetruetruefalse); 


nhatrang 08-06-2007 06:52 AM

Thank so much! Can I give you a thank you hug?

weird, this is what I got in return:

Fatal error: Class 'vBulletinHook' not found

Dismounted 08-06-2007 06:56 AM

Have you included the backend (global.php)?

nhatrang 08-06-2007 07:00 AM

sorry, I didn't know I was supposed to... You know, i find it very tough to include these files when the php files is in a whole seperate directory... what is your recommendation on doing this when your vb directory is is /news and your php files are in /files...

after adding global.php to the mix, I get init.php requirements, but that is configured inside global.php...

Dismounted 08-06-2007 07:05 AM

You need to chdir() to the forum directory, require the files, then chdir() back to the current one.

nhatrang 08-06-2007 07:31 AM

thank you so much!

nhatrang 08-22-2007 01:15 AM

is there anyway we can specify the bbcode to a set attachment/image width to display? in the forum it can display as big as it want, but with external pages, we can limit it to 400px?


All times are GMT. The time now is 11:57 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.01108 seconds
  • Memory Usage 1,723KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete