![]() |
How do you script BB Code?
Okay... lets say I want to make a bbcode... [VIDEO]536[/VIDEO]
I want to parse some PHP code on this code. How would I handle this? PHP Code:
|
Okay... since no one knows how to script BB code... how about something different...
How would I make a script that examines a new post and preg_matches a thread and replaces it with content? So if someone made a post and it had: [VIDEO]536[/VIDEO]I would want it to preg_match it with: \[(VIDEO|video)](\d*)\[/(VIDEO|video)]Then of course, I would run some PHP code on the preg_match[2] returned as 536. Would this be possible? |
Quote:
You'll require two plugins for this. I posted their source as xml just because it included everything. Just pay particular attention to the hook location and the basic functions I included. This one will take the text to be posted, and submit it to a function so can it can be run through a preg_replace or similar function. Code:
<plugin active="1" executionorder="5"> Code:
<title>Plugin Title</title> |
That is not adding another BB code. You can add a proper BB code (using PHP processing) by adding your tag to the processing array and setting the callback as the external callback function. Look at the bottom of class_bbcode.php.
|
Huh? I'm confused... is there a guide somewhere?
All I want to do is have a BB Code, with a PHP function run on it. |
Quote:
|
Is there any way of doing this WITHOUT editing VB files? And I dont know what I am supposed to be looking at in class_bbcode.php.
|
Quote:
Quote:
|
Do you mind actually explaining what needs to be done? Because I still dont see what I'm supposed to be looking at.
*EDIT* ah... I think I get it now, you wanted me to see: ($hook = vBulletinHook::fetch_hook('bbcode_fetch_tags')) ? eval($hook) : false; I tried doing this... Code:
// [VIDEO] Fatal error: Call to undefined method vB_BbCodeParser::handle_bbcode_video() in /home/eightway/public_html/includes/class_bbcode.php on line 1143 How do I get it to call handle_bbcode_video in functions_videodirectory.php? --------------- Added [DATE]1231967882[/DATE] at [TIME]1231967882[/TIME] --------------- Well I figured to just use the function in the plugin itself, instead of calling a file... But I'm having trouble passing the parameter data... Code:
// [VIDEO] --------------- Added [DATE]1231974120[/DATE] at [TIME]1231974120[/TIME] --------------- Is there a guide or something that explains what all the array options in $tag_list do? |
Quote:
Hook: bbcode_fetch_tags PHP Code:
PHP Code:
PHP Code:
|
All times are GMT. The time now is 08:53 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|