2013-11-26, 11:28:13
(This post was last modified: 2013-11-30, 19:31:10 by mrdragonraaar.)
(2013-11-21, 07:28:02)pcooper Wrote: Anyone know where I'm going wrong or is this a bug?
Apologies for this. It was a bug (and a truly bad rookie mistake on my part ). If the max id is greater than the number of links it defaulted to the max id. I stupidly set the max id to the number of links but since the id's start at 0 then the max id should be 1 less.
This is why you would get null results on occasion (only if it was getting the max id returned).
v2.0.3
I have corrected it now and also added the use of get_randlink() with no arguments.
get_randlink($min, $max) - get random link between $min and $max.
get_randlink($max) - get random link between 0 and $max.
get_randlink() - get random link between 0 and max link id.
So get_randlink(0, 9999), get_randlink(9999) and get_randlink() all do exactly the same thing if you have less than 9999 links.