I have created this plugin:
class Rnd
{
var $return_data = '';
public function Rnd ()
{
global $TMPL;
if (($Min = $TMPL->fetch_param ('min')) === false
or !is_numeric ($Min))
$Min = 0;
if (($Max = $TMPL->fetch_param ('max')) === false
or !is_numeric ($Max))
$Max = 1000;
$this->return_data = mt_rand ($Min, $Max);
}
}You can use with just “{exp:rnd:rnd min="<min>" max="<max>"}”. Theoretically it should return a different number each time but that’s not true. Each time you reload the page it returns a different number but it returns the same number in the same page. Put some “{exp:rnd:rnd}” in a template and all them returns the same number.
Why?