View Single Post
  #1 (permalink)  
Old 05-17-2003, 11:44 PM
jahangirafzal jahangirafzal is offline
Junior Member
 
Join Date: May 2003
Posts: 6
block-Survey .php - Random Survey Tweak (for nuke 6.5)
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));
Reply With Quote