XF 2.0 Updating Custom BB codes for XF 2.x

MikeMpls

Well-known member
Is there a tutorial on writing custom BB coces for XF 2.0?

If not what are the differences between 1.x & 2.x in that regard.

A custom BB code that has worked for me for years on various versions of 1.x is not giving me this message on 2.0.4:

Oops! We ran into some problems.
Callback FairUseBBC_FairUse::parseTagFairUse is invalid (error_invalid_class).

And since I am the developer, there is no support thread to post this in.
 

ozzy47

Well-known member
In order for someone to help you it would be best to post the code so they can see where the issue might be.
 

S Thomas

Well-known member
Looks like you're calling a custom class in your callback, right? Did you adapt that one to the new structure in XF2?
 

MikeMpls

Well-known member
What is the "new structure in XF2"? Or as I asked at the start, "What are the differences between 1.x & 2.x in that regard?"
 

MikeMpls

Well-known member
There is zero information via that link about custom BB codes with PHP callbacks.

I will stick with 1.5.x for now.
 

S Thomas

Well-known member
There is. If you'd read that carefully, you'd know that directory paths no longer are shortcutted with "_". So for example FairUseBBC_FairUse::parseTagFairUse
would be
FairUseBBC\FairUse::parseTagFairUse
Also, the src destination has to be changed. I guess it would be
src/addons/FairUseBBC/FairUse.php
Of course, you'd need to change classnames aswell.
 
Top