I used this code on a vb3 forum before but for some reason can't seem to get it to work now. Instead of displaying a random image, it is displaying a random number between 1 and 6. This is the code that I'm placing within the plugin area...hook location is parse_templates
Code:
$cud = rand(1, 6);
$cudrandom[1] = '<a href="http://www.XXXXXXXX.co.uk" target="_blank"><img src="http://www.XXXXXX.com/XXXXXX.gif" alt="" border="0" /></a>';
$cudrandom[2] = '<a href="http://www.XXXXXXXX.co.uk" target="_blank"><img src="http://www.XXXXXX.com/XXXXXX.gif" alt="" border="0" /></a>';
$cudrandom[3] = '<a href="http://www.XXXXXXXX.co.uk" target="_blank"><img src="http://www.XXXXXX.com/XXXXXX.gif" alt="" border="0" /></a>';
$cudrandom[4] = '<a href="http://www.XXXXXXXX.co.uk" target="_blank"><img src="http://www.XXXXXX.com/XXXXXX.gif" alt="" border="0" /></a>';
$cudrandom[5] = '<a href="http://www.XXXXXXXX.co.uk" target="_blank"><img src="http://www.XXXXXX.com/XXXXXX.gif" alt="" border="0" /></a>';
$cudrandom[6] = '<a href="http://www.XXXXXXXX.co.uk" target="_blank"><img src="http://www.XXXXXX.com/XXXXXX.gif" alt="" border="0" /></a>';
#
Then I'm calling it on the page using $cud
Anyone have any idea what I'm doing wrong?
Thanks,
J