PDA

View Full Version : Display ACTIVE polls only


Kesomir
08-13-2004, 11:31 AM
ok after my mistake yesterday I actually used the search function first this time ;) and this hack isn't around as far as I could find.

What it does is to only pull polls to the portal if they are active, ie: not closed

OPEN forum/modules/currentpoll.php


FIND line 33


WHERE open <> 10 AND thread.pollid != 0 AND visible = 1 $notdeleted $query[pollquery]


REPLACE WITH


WHERE open <> 10 AND thread.pollid != 0 AND visible = 1 AND active = 1 $notdeleted $query[pollquery]


SAVE and UPLOAD.


This will work for any poll setting, but is particuarly useful on the RAND setting or the random poll hack to stop loads of old closed polls being dredged up.

Brian did say that he reckons adding more to this query may show a performance hit on larger websites. Shouldn't be an issue for smaller ones though even if this is the case.

Mellow
09-03-2004, 11:27 AM
Thanks man, I like.

Our Sponsors
 

1996 328ti
01-02-2005, 06:10 PM
Just what I needed. :)
Search is such a wonderful tool.

Edit: Maybe I spoke too soon.
Does this work with vB 3.0.4?

SoloX
01-17-2005, 02:03 AM
I am doing the exact thing but its still pulling the closed polls :-( .. please help.

Our Sponsors
 

SoloX
01-24-2005, 11:52 PM
anyone?

trulylowcarb
02-11-2005, 03:58 PM
Working perfectly with vb3.06 and cmps1.01 and is a must-add modification IMO.

THANKS!!

FD929
02-27-2005, 07:18 PM
I'm going to do some looking around, but it appears that even if polls time out, they still have to be physically closed through editting the poll. That is my guess at your problem. Go though and physically close all the closed polls that are still showing on your cmps and keep up on closing them and you should have any further problems.

If I find a fix I'll post again.

zachlee
05-16-2005, 11:59 AM
I changed my code per the first post to

WHERE open <> 10 AND thread.pollid != 0 AND visible = 1 AND active = 1
$notdeleted $query[pollquery]

I too, like previous posts still had 'closed' polls appearing, so I changed

AND active = 1

to

AND open = 1

And that seemed to do the trick.

-Zach