PDA

View Full Version : Random Poll


tox
07-01-2004, 02:03 PM
Does anyone know how to have a random poll on the homepage? I want it to select any poll from the POLLs forum rather than just the latest.

thanks

Raitsa
07-01-2004, 03:01 PM
Its there already:

In Vba cmps-menu:

Poll Options
Polls Forum ID
The ID number of your polls forum. Enter 0 to disable homepage polls, or enter RAND to pull a random poll from any forum.

Our Sponsors
 

tox
07-01-2004, 04:23 PM
no, this is slightly different - I want a random poll from only one forum...

Brian
07-01-2004, 04:35 PM
In your /forum/modules/currentpoll.php find:

ORDER BY poll.pollid DESC

Replace that with:

ORDER BY RAND()

:)

Our Sponsors
 

tox
07-01-2004, 04:40 PM
excellent - thank you

Chuckie
07-01-2004, 11:10 PM
Might be a dumb ? but will this randomize only active polls?

Brian
07-02-2004, 11:15 AM
It will still pull polls that are not active and that have closed because of a time set on them. I think adding too much more to that query may create more of a server hit than it's worth (though that would mosly be an issue on larger sites), but I can give you the code if you still want it anyways.