...

View Full Version : Resolved BBCode Parser Extension



Jazz914
09-12-2009, 11:53 PM
Okay I am using the PHP Extension (Found Here (http://us3.php.net/manual/en/function.bbcode-create.php)) and I have been using it for a while and like it more than preg_replace, str_replace etc etc.. As this is a lot more advanced, but is it possible for me to be able to store the values in a database so for example:

to hard code the bbcode I would do this:

$arrayBBCode=array(
'i'=> array('type'=>BBCODE_TYPE_NOARG, 'open_tag'=>'<i>',
'close_tag'=>'</i>', 'childs'=>'b'));

But if I wanted this in a table I would do this instead:

$arrayBBCode=array(
$fetch['html'] => array('type' => $fetch['type'],
'open_tag' => $fetch['open'],
'close_tag' => $fetch['close'],
'childs' => $fetch['childs']));

For what reason I want to do this is because: It will be so much easier to manage, I want to be able to add a permission system intergrated into my site so its easy to control via admin section and also be able to turn the bbcode on or off. I know how to do this, but I just don't know I would be able to loop through the mysql table with the array setup this php extension needs..

(I have this installed on a web server, my host is extremely awesome xD)

Although I can't figure out how to install it on a local home server lol... (If anyone knows how this would be done it would be a bonus its not vital though, I can just keep on uploading to online server for testing) I couldn't understand the installation things they link to via the php.com pages, I use easyPHP.

Edit:

Nevermind got it fixed.. to an extent but its fairly easy from here on out..

Jazz914
09-13-2009, 06:14 PM
If no-one understands what I mean let me know i'll explain a little more...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum