vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   BB Code (https://vborg.vbsupport.ru/showthread.php?t=213876)

1Unreal 05-19-2009 06:26 AM

Does the callback have to direct to an external file?

Dismounted 05-19-2009 06:33 AM

Look at the plugin:
PHP Code:

// [VIDEO]
$tag_list['no_option']['video'] = array(
    
'callback' => 'handle_external',
    
'external_callback' => 'handle_bbcode_video',
    
'strip_empty' => true
); 

Which value do you think is the custom one?

1Unreal 05-19-2009 06:38 AM

callback/external_callback depending which way you do it.

Dismounted 05-19-2009 10:10 AM

You change "external_callback"... "callback" only calls methods that are defined in the class.

1Unreal 05-20-2009 12:15 AM

Ok, I dont really understand. Do I have to use 'callback' somewhere within the function?

Dismounted 05-20-2009 04:53 AM

Read the entire bits of code I posted. Find the correlations between "external_callback" and defined function names.

1Unreal 05-20-2009 07:02 AM

The callback has to correlate with the function name. Which mine does :\

Dismounted 05-20-2009 08:39 AM

Again, "callback" only calls methods that are defined in the class. This type of custom BB code defines a function that is global - hence the need to use "handle_external" as the callback. You specify your own callback in "external_callback". Hoping you could figure this out yourself.

1Unreal 05-20-2009 09:04 AM

bbcode_fetch_tags:
PHP Code:

// [VIDEO]
$tag_list['no_option']['video'] = array(
    
'callback' => 'handle_external',
    
'external_callback' => 'handle_bbcode_video',
    
'strip_empty' => true
); 

bbcode_create:
PHP Code:

// include our custom functions
require_once(DIR '/inc.php'); 

Contents of inc.php:
PHP Code:

<?php
function handle_bbcode_video($value)
{
        return 
'Your videos:'$value;        
}
?>

Thats what ive got. It doesnt work.

Can I not simply do a return like that? Do I have to do it with a class?

Dismounted 05-20-2009 10:20 AM

Look at the comments on the handle_external() method in class_bbcode.php. ;)


All times are GMT. The time now is 05:53 PM.

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.01766 seconds
  • Memory Usage 1,733KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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