vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   PHP-processed custom bbcode (https://vborg.vbsupport.ru/showthread.php?t=151550)

Pod 07-06-2007 07:04 PM

PHP-processed custom bbcode
 
Greetings,

I'm interested to create a custom bbcode that is processed by php, instead of just substituted with some html like the control panel lets me to do.

I was inspired by this mod:

https://vborg.vbsupport.ru/showthread.php?t=68116

I thought i could just go and edit the functions_bbcodeparse.php file add a line like this one:

$bbcode = custom_processing_function($bbcode);

But looks like that file doesn't exist anymore? I'm used a new 3.6.7 PL1 install, that is unmoded (yet). I'm guessing that file has been changed since that mod was released.

Could you please tell me where I can find information on how to do this now, either by modding the code or creating a plugin?

Eikinskjaldi 07-06-2007 11:40 PM

includes/class_bbcode.php


They way I do it is

1) put a function anywhere in the file
PHP Code:

function handle_bbcode_mything($text$display='') {
//display is the tag options, text is whats in the tag


2) modify fetch_tag_list

PHP Code:

                $tag_list['option']['mything'] = array(
                        
'callback' => 'handle_bbcode_mything',
                        
'strip_empty' => true or false,
                        
'strip_space_after' => number of space to strip,
                );

                
$tag_list['nooption']['mything'] = array( 

note the option /no option is whethere there is any display value, ie is yor tag [mything]stuff[/mything] or [mything=some option]stuff[/mything]

Pod 07-07-2007 12:00 AM

Thank you very much! Exactly what I was looking for ;) :up:


All times are GMT. The time now is 02:49 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.00996 seconds
  • Memory Usage 1,721KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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