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

Requested tutorial: creating a BBCode with a PHP Callback

Discussion in 'Resource and Add-on Requests' started by ForestForTrees, Jun 21, 2014.

  1. ForestForTrees

    ForestForTrees Well-Known Member

    In a thread, a while ago, @katsulynx wrote,
    I've looked all around, but I can't see an answer to that question. If anyone is up for making a tutorial on this in the resource manger in the Tips and Guides section, I bet it will get a lot of positive votes. It's core functionality and a lot of people might know how to write PHP, but might not know how to use $rendererStates or $formatter. I know I would!

    Even just having some example code with a couple of comments would be huge if someone has written one of these and has it hanging around. Add in a screenshot from the ACP, and you have a pretty solid contribution to the "Tips and Guides" section of the RM.
     
    DeltaHF likes this.
  2. katsulynx

    katsulynx Well-Known Member

    You can include the print_r($tag) and print_r($rendererStates) in your callback, to get the content of the first two variables printed out at the to of your page (unformatted but readable) for programming/debugging purpose. Genereally said, $tag seems to include the BBCode-Tag given and the text in between or an iterative stack of more children-tags if there are some nad $rendererStates seems to hold some settings of something. Haven't found out what the last one is though.
     
    ForestForTrees likes this.
  3. Laric

    Laric Active Member

    I really would need some help to get started.. a tiny addon or something that I could look at on how they do it... just as long as it uses the php callback. I have php code I need to use for my bbcodes but haven't got a clue on how to get started with the actual addon or class I need to create.
     
  4. cclaerhout

    cclaerhout Well-Known Member

Share This Page