![]() |
BB Code
I want to add a new BB Code and handle it with PHP
Ive been looking through the BB Code include file and I really dont understand how its working Heres what I want to do: Take a string of links, each link on one line. Then convert that into an array: PHP Code:
But Im reallly lost.:o |
To add a BB code processed by a custom callback, you need to define it in a plugin at bbcode_fetch_tags.
|
Ive got that far but I dont know what to do from there.
|
And you know what is passed to your callback function?
|
What do you mean?
|
What are you putting in the plugin @ bbcode_fetch_tags?
|
I havent done anything yet. Thats what Im saying, Im completly lost.
Could you give a brief explanation/tutorial of how to add custom BB Codes as a plugin? |
|
Ok this is what ive started off with.
bbcode_create: PHP Code:
PHP Code:
Quote:
|
Look carefully at the plugin example @ bbcode_fetch_tags (especially at what value is what).
|
Does the callback have to direct to an external file?
|
Look at the plugin:
PHP Code:
|
callback/external_callback depending which way you do it.
|
You change "external_callback"... "callback" only calls methods that are defined in the class.
|
Ok, I dont really understand. Do I have to use 'callback' somewhere within the function?
|
Read the entire bits of code I posted. Find the correlations between "external_callback" and defined function names.
|
The callback has to correlate with the function name. Which mine does :\
|
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.
|
bbcode_fetch_tags:
PHP Code:
PHP Code:
PHP Code:
Can I not simply do a return like that? Do I have to do it with a class? |
Look at the comments on the handle_external() method in class_bbcode.php. ;)
|
Im really lost, its not making sense. Its like its not detecting the callback. :|
Also, is this possible with the BB Code parser in vB. I know there are some limitations. $string would have to be the bit picked up between the tags. I dont want to be doing this then realise its not possible :p PHP Code:
|
Use the code I posted in the other thread, and modify:
You do not need to do anything else - that is - don't modify "callback". |
She lives! Thank you so much. That made lots more sense lol.
|
All times are GMT. The time now is 09:42 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:
|