Page 1 of 1

Poll result length?

Posted: 25. November 2015 18:06
by Jupiter
Your Portal Version: 2.1.0b1
Your phpBB Type: Standard phpBB3
MODs installed: No
Your knowledge: Basic Knowledge
Boardlink: http://www.gopherpucklive.com/forum/portal

What have you done before the problem was there?
Nothing

What have you already tryed to solve the problem?
No

Description and Message
I am wondering if I can get the CENTER POLL results to be longer? They have always been short compared to the main forum poll.

You can see what I mean here:
Portal Poll: http://www.gopherpucklive.com/forum/portal
Forum Poll: http://www.gopherpucklive.com/forum/vie ... 13&t=12715

You can see in the Forum that they results are more "pronounced". How can I get that in the portal poll?

Re: Poll result length?

Posted: 25. November 2015 18:34
by talonos
if your running the newest version of board3 portal then you can set the poll as a "Top" or "Bottom" block which would make it full width of portal. full width on "center" is not possible.

Re: Poll result length?

Posted: 25. November 2015 18:41
by Jupiter
No... That's not what I mean. I mean the actual length of the poll results. The bars are so short on portal compared to the forum.

Re: Poll result length?

Posted: 25. November 2015 18:50
by talonos
ahh ok so i've just looked at the coding quickly and i can see the difference.

Forum html shows

Code: Select all

<dd class="resultbar hidden" style="display: block;"><div style="width:100%;" class="pollbar1">31</div></dd>
<div class="pollbar1" style="width:100%;">31</div>
</dd>
and the portal html shows

Code: Select all

<dd class="resultbar"><div style="width:17%;" class="pollbar1">31</div></dd>
so from the looks of that it could be a coding error inside of your portal theme OR CSS error. that might give you an idea where to look. i'd have a look if i had more time but currently streched.

Re: Poll result length?

Posted: 25. November 2015 19:13
by Jupiter
You put me on the right track. It was in the poll.php module file.

I found this: $option_pct_txt = sprintf("%.1d%%", round($option_pct * 100));
and change it to this: $option_pct_txt = sprintf("%.1d%%", round($option_pct * 500));

Now the poll results fill the space much better.

Re: Poll result length?

Posted: 25. November 2015 19:25
by talonos
ok so looks like you might have found a coding error, good to see you got it working correctly now :)

Re: Poll result length?

Posted: 25. November 2015 19:38
by Jupiter
I don't even know if that IS the error. In the forum is is coded at * 100 too.... But I needed to alter it to * 500 to get it to work on the portal poll. Strange.

Re: Poll result length?

Posted: 25. November 2015 19:44
by talonos
ok so its a temp fix. i'll look over it when i have more time.

Re: Poll result length?

Posted: 26. November 2015 02:57
by Jupiter
Spoke too soon.... It fixed the bar length, but messed up the % amount. So back to the drawing board.

Re: Poll result length?

Posted: 26. November 2015 18:44
by Kirk
Hi
The Poll lenght is in the root/ext/board3/portal/modules/poll.php defined:

Code: Select all

$option_pct_txt = sprintf("%.1d%%", round($option_pct * 100));
100 = 100%