cellarius
06-07-2011, 10:00 PM
This addon allows for PHP-Code to be used in Custom BBCodes
It offers a framework for the easy integration and sharing of custom BBCodes that are based on PHP processing of the data entered by the user. It could, for example, be used to develop BBCodes that use multiple options or to poll database information. It does allow for the Admin to use PHP in the Backend - it does, of course, not allow this to forum visitors.
You need to know PHP to use this Addon to develop your own PHP based bbcodes, however it would be possible to share them as an extension to this addon.
Installation:
- install the product file - done.
Using PHP in Custom BBCodes:
Create your Custom BBCode as always, and just put your PHP into the Replacement box (where the HTML used to go).Just remember two things:
Your code needs to start with <?php
You need to return the result of your code.If you're unsure what that means, read the php manual on eval() and look at the evaltest example in the second post (https://vborg.vbsupport.ru/showpost.php?p=2205046&postcount=2).
For coders: include instead of eval
If you'd rather store the PHP for your new BBCodes in the file system for ease of development, that's possible, too:
create a folder called "custombbcodes" in your forum root
in that folder, create a php file that copies your BBCode Tag Name (ie. if your tag name is "includetest", the file needs to be called "includetest.php"). That's where your PHP goes.
in the Replacement box in the Custom BBCode Dialog, just put the word "include", nothing else
Since there's no eval() here, no need to return the result. Instead, it needs to go into $parsed.There's also an includetest example in the second post (https://vborg.vbsupport.ru/showpost.php?p=2205046&postcount=2).No Support for your PHP-Code!
### See the example BBCodes in the second post (click (https://vborg.vbsupport.ru/showpost.php?p=2205046&postcount=2))! ###
### Don't forget to click install (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=264896)! ###
(No support if you don't)
It offers a framework for the easy integration and sharing of custom BBCodes that are based on PHP processing of the data entered by the user. It could, for example, be used to develop BBCodes that use multiple options or to poll database information. It does allow for the Admin to use PHP in the Backend - it does, of course, not allow this to forum visitors.
You need to know PHP to use this Addon to develop your own PHP based bbcodes, however it would be possible to share them as an extension to this addon.
Installation:
- install the product file - done.
Using PHP in Custom BBCodes:
Create your Custom BBCode as always, and just put your PHP into the Replacement box (where the HTML used to go).Just remember two things:
Your code needs to start with <?php
You need to return the result of your code.If you're unsure what that means, read the php manual on eval() and look at the evaltest example in the second post (https://vborg.vbsupport.ru/showpost.php?p=2205046&postcount=2).
For coders: include instead of eval
If you'd rather store the PHP for your new BBCodes in the file system for ease of development, that's possible, too:
create a folder called "custombbcodes" in your forum root
in that folder, create a php file that copies your BBCode Tag Name (ie. if your tag name is "includetest", the file needs to be called "includetest.php"). That's where your PHP goes.
in the Replacement box in the Custom BBCode Dialog, just put the word "include", nothing else
Since there's no eval() here, no need to return the result. Instead, it needs to go into $parsed.There's also an includetest example in the second post (https://vborg.vbsupport.ru/showpost.php?p=2205046&postcount=2).No Support for your PHP-Code!
### See the example BBCodes in the second post (click (https://vborg.vbsupport.ru/showpost.php?p=2205046&postcount=2))! ###
### Don't forget to click install (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=264896)! ###
(No support if you don't)