vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Parsing custom bbcodes (https://vborg.vbsupport.ru/showthread.php?t=246655)

skizer 07-16-2010 04:07 AM

Parsing custom bbcodes
 
Hello everyone!

I wrote myself a custom img bbcode => [aimg="text"]url[/aimg]

Code:

<img src="{param}"  title="{option}" />
Works like a charm in the whole forum except on custom pages/custom userfields.
I tried to fix that with a hook, works fine with default bbcodes but not with custom ones.

//for postbit
PHP Code:

if (!is_object($bbcode_parser))
    {
        require_once(
DIR '/includes/class_bbcode.php');
        
$bbcode_parser =& new vB_BbCodeParser($GLOBALS['vbulletin'], fetch_tag_list(),true);
    }
    
$post['YOUR_FIELDNAME'] = strip_tags($post['YOUR_FIELDNAME']);
     
$post['YOUR_FIELDNAME'] = $bbcode_parser->parse($post['YOUR_FIELDNAME'],0,true); 

It seems like that the custom bbcodes aren't handled by the bbcode class.
I would appreciate any help for getting rid of this problem, thanks !

~regards skizer

//UPDATE

Its always like that, I'm searching and trying everything out that comes into my mind.
After not getting rid of it - I post for help, actually still try to getting rid of it.... and guess what?

I took a closer look at the bbcode class and saw that it handle actually even custom bbcodes - fixed up the code above (maybe other users can use it), thanks anyways :P


All times are GMT. The time now is 11:36 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.01073 seconds
  • Memory Usage 1,714KB
  • 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
  • (1)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