XF 1.3 BBCode for random number

Nudaii

Well-known member
would it be possible to have a bbcode that displays a random number between say 1-20?



I have seen it done before but unsure if poissible on xf .
 
ah php callbacks i haven't worked with yet with bbcode, sis there a guide someplace? i looked but couldn't find one.

also would it be possible to not have the number constantly update on every page load?

i am using it to place a random "questcard" for an rpg type game.
 
PHP:
<?php

class YourAddOn_Path
{
    public static function tagYourTag(array $tag, array $rendererStates, XenForo_BbCode_Formatter_Base $formatter)
    {
        // return some HTML (or a template object)
        return '<b>123456</b>';
    }
}

That's an incredibly simplistic example of what a BB Code callback should look like.

The file would be located in library/YourAddOn/Path.php

You can see how XenForo does its own BB Codes in XenForo/BbCode/Formatter/Base.php.
 
Top Bottom