PDA

View Full Version : Poll Voting Percentage Problem


hasidoo
05-01-2012, 10:00 AM
Hi all,

In my forum,when someone voted in a multiple choice poll, it displays as follows;
138135

The percentages are allocated as 100% for each option.

But I need it to be like this:
138136

(i.e. as an overall percentage for the whole poll)

I guess my problem is clear to all of you. Anyone knows how to get the result I wanted? Please help me with this..

kh99
05-01-2012, 07:03 PM
I think all you need to do is find this block of code:

else if ($pollinfo['multiple'])
{
$option['percentraw'] = ($value < $pollinfo['voters']) ? $value / $pollinfo['voters'] * 100 : 100;
}



and remove it or comment it out (by putting // at the beginning of each line). Unfortunately for some reaosn it appears in three different files: poll.php, showthread.php, and forumrunner/get_thread.php (assuming you have vb4.1.12 or later), so it needs to be done in each place.

hasidoo
05-07-2012, 03:41 PM
I think all you need to do is find this block of code:

else if ($pollinfo['multiple'])
{
$option['percentraw'] = ($value < $pollinfo['voters']) ? $value / $pollinfo['voters'] * 100 : 100;
}



and remove it or comment it out (by putting // at the beginning of each line). Unfortunately for some reaosn it appears in three different files: poll.php, showthread.php, and forumrunner/get_thread.php (assuming you have vb4.1.12 or later), so it needs to be done in each place.

thank you very much. I'll try this

hantousha
04-22-2014, 03:53 PM
Great. Fix Works to fix the issue with VB 3.8 percentage calculation in multiple votes. When the Mod Multiple Votes is installed.