Deek
Member
So I'm making a dice roller BBCode plugin and am running into a bit of a problem, every time the page is reloaded the value is reloaded.
Is there a way to have the code only rendered once and not re-evaluated each time?
I'm following the guide at http://xenforo.com/community/thread...b-code-in-xenforo-a-comprehensive-guide.6320/ and while its a great start I know I'm missing something
Is there a way to have the code only rendered once and not re-evaluated each time?
PHP:
protected $_tags;
public function getTags()
{
$this->_tags = parent::getTags();
$this->_tags['dice'] = array(
'hasOption' => true,
'optionRegex' => '/^[0-9]+?$/i',
'callback' => array($this, 'renderTagDice')
);
return $this->_tags;
}
public function renderTagDice(array $tag, array $rendererStates)
{
$output = "A ".$tag['option']." sided die was rolled it came up: ".rand(1,$tag['option']);
return $output;
}
I'm following the guide at http://xenforo.com/community/thread...b-code-in-xenforo-a-comprehensive-guide.6320/ and while its a great start I know I'm missing something