PDA

View Full Version : Hide number of votes in poll


Apexi
10-21-2014, 01:18 PM
Hi again guys.
I'm looking for a plugin or any other method to hide the number of votes in polls.
I found Sakera's Hide Poll Results, but that plugin only hide the result and not the number of voters.

Any suggestion?

fxdigi-cash
10-21-2014, 01:50 PM
Hi again guys.
I'm looking for a plugin or any other method to hide the number of votes in polls.
I found Sakera's Hide Poll Results, but that plugin only hide the result and not the number of voters.

Any suggestion?

well this is the code you want to hide:

<dl class="stats">
<dt class="totalvotes">{vb:rawphrase voters}</dt>
<dd><span class="totalvotes">{vb:raw pollinfo.numbervotes}</span>. {vb:raw pollstatus}</dd>
</dl>

you have the choice what to do. if you want to delete it then you won't see it anymore unless you make a revert for your template where you deleted this code from...OR

you can set conditional permission that allow mods and admins to see that content only...

Solved? :)

Apexi
10-21-2014, 02:05 PM
Thanks :)
But is there any way to add this change only for one sub-forum and not the entire forum?

fxdigi-cash
10-21-2014, 02:37 PM
Thanks :)
But is there any way to add this change only for one sub-forum and not the entire forum?

yes, you can also add a condition to the subforum you don't want show up at,

Show in one forum: Remember to change x

<vb:if condition="$forum[forumid] == x">Show this if forum id is x</vb:if>

Show in several forums:

<vb:if condition="in_array($forum['forumid'], array(1,2,3))">Show this to forum 1, 2 and 3</vb:if>

--------------- Added 1413906087 at 1413906087 ---------------

this is a good link for more info:

vB4 Template Conditionals List (https://vborg.vbsupport.ru/showthread.php?t=231525)

Apexi
10-21-2014, 02:59 PM
Again, thanks.
Will give it a try.

--------------- Added 1413913272 at 1413913272 ---------------

Did not work for me.
I've googled it and some claims that $forum[forumid] have to be registered to the template.

Not much more info is given.

--------------- Added 1413917060 at 1413917060 ---------------

No wonder why it doesn't work.
First of, it seems as <vb:if condition="$forum[forumid] != x"> is not supported anymore https://vborg.vbsupport.ru/showpost.php?p=2507464&postcount=399

Second. Even if i remove
<dl class="stats">
<dt class="totalvotes">{vb:rawphrase voters}</dt>
<dd><span class="totalvotes">{vb:raw pollinfo.numbervotes}</span>. {vb:raw pollstatus}</dd>
</dl>
the poll is still showing up

ozzy47
10-22-2014, 01:03 AM
Try this, and make sure you are editing the right style.

<vb:if condition="$GLOBALS[forumid] == X"></vb:if>

Apexi
10-22-2014, 07:34 AM
Try this, and make sure you are editing the right style.

<vb:if condition="$GLOBALS[forumid] == X"></vb:if>

Thanks but i i've tried that already.
I don't think it is problems with the code. As i said before, even if i remove

<dl class="stats">
<dt class="totalvotes">{vb:rawphrase voters}</dt>
<dd><span class="totalvotes">{vb:raw pollinfo.numbervotes}</span>. {vb:raw pollstatus}</dd>
</dl>

the poll is still shown. The test forum only has one template and i'm editing pollresults_table

The text "Voters: xx" is gone, but the votes is also shown next by the diagram.

--------------- Added 1413969320 at 1413969320 ---------------

After some time of testing i finally find out which one to change.
But still, <vb:if condition="$GLOBALS[forumid] == X"></vb:if> wont work