PDA

View Full Version : Make only one poll option?


Dulce
07-19-2009, 11:01 PM
Is there a way to allow the minimum number of poll options to one?

Right now the minimum is two and I don't know how to get around this.

HMBeaty
07-19-2009, 11:02 PM
I'm curious, why would you even need a poll if there were only one option?

Dulce
07-19-2009, 11:08 PM
to get a head count of people agreeing with the statement, while not specifically having a "no" option

HMBeaty
07-19-2009, 11:13 PM
Ah, ok. Well, I may have found how to do this. I have NOT tested this though.

In poll.php, find:
if ($question == '' OR $optioncount < 2)
And replace with:
if ($question == '' OR $optioncount < 1)
Find:
$polloptions = 2;
Replace with:
$polloptions = 1;
Find:
if ($vbulletin->GPC['pollquestion'] == '' OR $optioncount < 2)
Replace with
if ($vbulletin->GPC['pollquestion'] == '' OR $optioncount < 1)
Let me know if this works or not :)

Dulce
07-19-2009, 11:18 PM
awesome. works like a charm.

HMBeaty
07-19-2009, 11:28 PM
Awesome. Released it here (https://vborg.vbsupport.ru/showthread.php?t=218977). I'll be adding, changing things in the future on this

Marco van Herwaarden
07-20-2009, 10:12 AM
Adding a 2nd option "I don't agree" would have been much simpler and would still work after an upgrade.

Also with only 1 option, how do you know if someone simply has not voted yet, or if he means he does not agree.

Dulce
07-21-2009, 02:36 AM
Adding a 2nd option "I don't agree" would have been much simpler and would still work after an upgrade.

Also with only 1 option, how do you know if someone simply has not voted yet, or if he means he does not agree.

"I don't agree" would be similar to a no option. Basically in a specific instance I wanted to know if a minimum number of people agreed with the statement while not specifically having a "no" option to compare it to. Basically, disregarding those that answer no entirely.

Marco van Herwaarden
07-21-2009, 11:53 AM
Then just create 2 options and ignore 1. Much easier then changing the sources..

iadmirevb
09-20-2009, 10:06 PM
i've also was looking to add one option in my poll. In my case, we are offering a monthly gift to a user in the forum. We want the user to click "Yes, i would like to participate". If he doesn't click it's like saying no...

Thanks for the hack