I am looking for a block-Survey.php Tweak to return random survey instead of latest for Php Nuke 6.5. Just like this one
|
Quote:
|
*** This is for Nuke 6.0 ***
Open
~Nukehome/blocks/block-Survey.php
Find this code
$result = sql_query("SELECT pollID FROM ".$prefix."_poll_desc $querylang ORDER BY pollID DESC LIMIT 1", $dbi);
And change it to
$result = sql_query("SELECT pollID FROM ".$prefix."_poll_desc $querylang ORDER BY pollID DESC LIMIT $artrand,1", $dbi);
And Above that line insert.
mt_srand((double)microtime()*1000000);
$total = sql_num_rows(sql_query("select * from ".$prefix."_poll_desc", $dbi), $dbi);
if ($total==0)
$artrand=0;
else
$artrand = mt_rand(0,($total-1));
|