Version: 1.5, by TomasDR
Developer Last Online: Oct 2019
Category: Miscellaneous Hacks -
Version: 3.6.8
Rating:
Released: 03-23-2007
Last Update: 12-14-2007
Installs: 96
DB Changes Uses Plugins Template Edits
No support by the author.
Poll Write-In Vote Hack
This is only for 3.6.x, you can find my 3.7.x version here.
About this hack:
I developed this hack for my board after several polls were made by members that were short on options, especially since the poll creators are sometimes biased with the poll options. I am sure you have seen the same on your boards.
This hack allows the poll creator to allow "Write-In Votes" to a poll (single or multiple). I also added the feature to change your vote if the poll is a "write-in vote" poll, you can also allow vote changes on all polls through an admin option (ver 1.2+). This will allow a user to change their vote if they discover a better poll option written in by another user, or if they want to add one or more write-in votes to a multiple choice poll.
An admin/moderator/etc. who has permission to edit a poll can change a poll to make it a write-in poll or not. (ver 1.3+)
The cancel/change vote feature works with single and multiple choice polls.
This is my first hack but please don't let that scare you away, this is a very basic hack.
Permission Overview:
There are very few permission checks with my hack;
If you can create a poll, you can make it a write-in vote poll.
If you can vote on the poll, you can add a write-in vote to a write-in poll.
If the poll is closed you cannot change your vote or add a write-in vote of course.
You cannot add a write-in vote to a non write-in vote poll.
Permission Settings:
Located in vBulletin Options "Poll and Thread Rating Options" section.
Allow users to change their votes in ANY poll. (Default NO)
Show the username after a write-in vote. (Default Yes) * If NO a log entry is written to the moderator log as per a request, see pic below
Added a requested feature (please see screenshot) so now the username is recorded after a write-in vote.
Added an error/permission check for max poll options that is set in vBulletin options by the admin so a write-in poll cannot exceed that number.
Added two new error messages reflecting the max poll option error & a specialized error message for entering a blank write-in vote.
Version 1.2:
Added the feature (suggested by bchertov) to be able to allow your users to change their vote in all polls. This is now a vBulletin Option located in the Setting Group Poll and Thread Rating Options the option is Allow Users to Change Their Votes in ALL Polls as a Yes/No, if set for 'No' they will still be able to change their vote in Write-in polls as before. NOTE: The template edit has changed for the template pollresults_table with this version!
Fixed the bug reported by A_V concerning poll max options being set for zero/unlimited.
Added the Write-in permission check along with the vB option for allowing users to change votes in the plugin Change write-in poll vote.
Version 1.3:
Added the requested feature to allow changing the Write-In option when Editing Polls. Note: There is an additional template (editpoll) to edit with this new version.
Version 1.4:
Added the ability to turn off the username added after a write-in vote.
Added logging to the moderator log if the username addition is turned off per a request.
Version 1.5:
Found a bug if you allow the "Unregistered / Not Logged In" group to vote in polls. If they change their vote they will change all guest's votes. You only need to upgrade if you allow Unregistered users the ability to vote in polls.
Version 3.6.8:
vBulletin 3.6.8 has the ability to filter by product in the moderator log. This is the only difference between the xml files.
Please post your comments or suggestions for this hack. I will read ALL posts.
PLEASE CLICK INSTALL! (You will get an email when a new version is released.)
Pictures:
Showing the "Write-In" checkbox under Miscellaneous Options when creating a poll.
Showing the poll with the link to add a write-in vote.
Showing the screen to add a write-in vote.
Showing the new poll with the new write-in vote and the link to Change your vote.
Showing the new feature (ver 1.1) where the username is placed after the write-in vote.
Showing the moderator log entry.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
And put // in front of the first $optionvalue. It comments out the username part and doesnt show it when the poll options are added.
If anyone has any idea how to make it so that only admins can see the name of who added it, please let me know...
Sorry as mentioned had some family issues. Yes that's how you remove the name. As for allowing admins only to see the name that would be much more difficult since as you see all I was doing was changing the actual text of the write-in choice to add the username to the text of choice.
It's very possible it might be available in 3.7 since 3.7 will be recording a history of edits in posts.
I've installed this on 3.6.8 and I'm having a problem with votes disappearing on write-in polls.
I haven't narrowed down exactly when it happens, but it's definitely happening.
I installed a test board with 3.6.8PL2 and installed my product with no problems. What other add-ons are you running?
The only template that has changed (that this product uses) between 3.5.5 & 3.6.8 is "editpoll" which was a non-mandatory change in 3.6.6 that included an option check so you could add options when editing a poll if you exceeded the poll limit.
There is a permission check within the Plugin for that, I just didn't add the IF Conditional to the template where the link is added, so no one can change their vote after it's closed even though they will see the link.
Quote:
Originally Posted by zetetic
I've installed this on 3.6.8 and I'm having a problem with votes disappearing on write-in polls.
I haven't narrowed down exactly when it happens, but it's definitely happening.
Like the idea of this hack--would be extremely useful. To be clear before install, have the above issues been addressed/fixed?
I installed a test board with 3.6.8PL2 and installed my product with no problems. What other add-ons are you running?
The only template that has changed (that this product uses) between 3.5.5 & 3.6.8 is "editpoll" which was a non-mandatory change in 3.6.6 that included an option check so you could add options when editing a poll if you exceeded the poll limit.
I'm sorry I can't be more helpful but I'm running a brazillion other add-ons and I don't really have the time to do any testing right now. To be clear though, the issue I had was votes disappearing altogether. Like I voted for one poll item and wrote in another, then when I checked the thread the following day my write-in poll item was still there but my vote for the other poll item was gone.
I'm sorry I can't be more helpful but I'm running a brazillion other add-ons and I don't really have the time to do any testing right now. To be clear though, the issue I had was votes disappearing altogether. Like I voted for one poll item and wrote in another, then when I checked the thread the following day my write-in poll item was still there but my vote for the other poll item was gone.
Well you cannot add a write-in vote to a poll you have voted in already, the link doesn't even appear.
You can change your vote (remove your vote) and then add a write-in vote. Could it be possible you forgot to vote again after adding the write-in vote? Unless of course you were talking about 2 different polls.
Like the idea of this hack--would be extremely useful. To be clear before install, have the above issues been addressed/fixed?
You know I forgot completely about the if conditional to make the "change vote" link disappear if a poll is closed, but as I mentioned in the original post, eventhough the link to change your vote still shows, you cannot change your vote in a closed poll, there is a permission check in the plugin. So while it wasn't really an issue I have updated the template edit so the link to change your vote will not show if the poll is closed.
As for the other issue with 3.6.8 I cannot see how my add-on could be removing a vote, I did reply to the user's problem and the way he described what happened, it could be possible that he forgot to vote again after removing his vote to add a write-in vote. I have tested it in a clean copy of 3.6.8PL2 without any issues.
Found a bug if you allow the "Unregistered / Not Logged In" group to vote in polls. If they change their vote they will change all guest's votes. You only need to upgrade if you allow Unregistered users the ability to vote in polls.