View Single Post
block-Survey .php - Random Survey Tweak (for nuke 6.5)
Old
  (#1 (permalink))
jahangirafzal
Junior Member
 
Status: Offline
Posts: 6
Join Date: May 2003
block-Survey .php - Random Survey Tweak (for nuke 6.5) - 05-17-2003, 10:44 PM

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