Poll Write-In Vote Hack
This is only for 3.7.x, you can find my 3.6.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.
- If you can Edit a Poll you can remove a write-in choice.
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
- Since version 3.6.8 vBulletin has had the ability to filter by product in the moderator log so you can filter the write-in votes if you chose not to have the username displayed.
Install Info:- Files edited: 0
- Templates edited: 3
- Files to install: 1
- Time to install: 5 minutes max
Install Procedure: 1. Install the Product (Download the XML file)
2. Edit Template polloptions_tableFIND
Code:
<input type="submit" class="button" value="$vbphrase[vote_now]" />
ADD ABOVE
Code:
<if condition="$pollinfo[writein]"><span style="float:$stylevar[right]"><a href="poll.php?$session[sessionurl]do=addwritein&pollid=$pollinfo[pollid]">$vbphrase[add_writein_vote]</a> </span></if>
3. Edit Template pollresults_tableFIND
Code:
<td class="tfoot" colspan="4" align="center"><span class="smallfont"><if condition="$show['multiple']">$vbphrase[multiple_choice_poll] </if>$vbphrase[voters]: <strong>$pollinfo[numbervotes]</strong>. $pollstatus</span></td>
REPLACE WITH
Code:
<td class="tfoot" colspan="4" align="center"><span class="smallfont"><if condition="$show['multiple']">$vbphrase[multiple_choice_poll] </if>$vbphrase[voters]: <strong>$pollinfo[numbervotes]</strong>. $pollstatus<if condition="$vbulletin->options['allchangevote'] OR $pollinfo[writein]"><if condition="$uservoted AND $pollinfo[active]"> <a href="poll.php?$session[sessionurl]do=changevote&pollid=$pollinfo[pollid]">$vbphrase[change_vote]</a></if></if></span></td>
4. Edit Template editpoll FIND
Code:
<if condition="$show['makeprivate']">
<fieldset class="fieldset">
<legend>$vbphrase[poll_options]</legend>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
<tr>
<td><label for="cb_public"><input type="checkbox" name="public" value="1" id="cb_public" tabindex="1" $pollinfo[public] />$vbphrase[make_votes_public]</label></td>
</tr>
</table>
</fieldset>
</if>
REPLACE WITH
Code:
<fieldset class="fieldset"><legend>$vbphrase[poll_options]</legend><table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">$addwritein<if condition="$show['makeprivate']"><tr> <td><label for="cb_public"><input type="checkbox" name="public" value="1" id="cb_public" tabindex="1" $pollinfo[public] />$vbphrase[make_votes_public]</label></td></tr></if></table></fieldset>
5. Enjoy!
Version Info:
Version 1.6:- Updated for vBulletin 3.7.x
Version 3.6.8 & Above:
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 !
(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.