9
I thought this thing about random quotes was already solved...
Well, since it seems I was wrong, here are two ideas:
1) Check the first user contribute note
here. It deals with rand() generating the same number over and over again.
2) You might want to try editing the
random_quote_show function contained in the file
random_quote.php in your module so it reads like this:
Quote:
function random_quote_show() {
global $xoopsDB;
$block = array();
$result = $xoopsDB -> query("SELECT count(*) from ".$xoopsDB -> prefix('citas'));
list($totalquotes) = $xoopsDB -> fetchRow($result);
$show = rand (1, $totalquotes);
$result2 = $xoopsDB->query("SELECT texto, autor FROM ".$xoopsDB->prefix("citas")." WHERE id=".$show);
list($texto, $autor)= $xoopsDB->fetchRow($result);
$block['texto']=$texto;
$block['autor']=$autor;
return $block;
}
The code is a bit longer than the original, but might work better.
Cheers.