Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2009
    Posts
    187
    Thanks
    16
    Thanked 8 Times in 8 Posts

    BBCode Parser Extension

    Okay I am using the PHP Extension (Found Here) 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:
    PHP Code:
    $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:
    PHP Code:
    $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..
    Last edited by Jazz914; 09-13-2009 at 06:54 PM. Reason: Spelling corrections

  • #2
    Regular Coder
    Join Date
    Jul 2009
    Posts
    187
    Thanks
    16
    Thanked 8 Times in 8 Posts
    If no-one understands what I mean let me know i'll explain a little more...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •