• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 Can I use BBCode to..

#1
I want to be able to type in a BBCode like this:

[MyAds=321][/MyAds]

In the backend of that BBCode, I would like to run a query which will pull my ads out of the database and then push them to the interface. The ads are basic HTML and Script.

Is that possible or should I be thinking of some other way to do this?
 

Brogan

XenForo moderator
Staff member
#2
Yes, you could do that with a PHP callback, which is one of the options when creating a custom bb code.
 

cclaerhout

Well-known member
#4
I want to be able to type in a BBCode like this:

[MyAds=321][/MyAds]

In the backend of that BBCode, I would like to run a query which will pull my ads out of the database and then push them to the interface. The ads are basic HTML and Script.

Is that possible or should I be thinking of some other way to do this?
A quick message: using DB with Bb Codes means several potential requests that can't be prevented. I've done a demo Bb Code (which is working with the Bbm) that first browses all tags to collect needed data (ie: 321 in your case), send this data to a listener (would be executed only once) in which you can make a DB request, the go back in the Bb Code callback to parse it this time.

If you're used to code, it should be ok. If you're not, just apply a permission to this Bb Code (available in the Bbm).

Good luck.