Back to vBulletin 3.7 Add-ons

Poll Write-In & Change Vote Hack
Mod Version: 1.6, by TomasDR

This modification is in the archives.
vB Version: 3.7.x Rating: (3 votes - 5.00 average) Installs: 50
Released: 10 Dec 2008 Last Update: 10 Dec 2008 Downloads: 167
Not Supported DB Changes Uses Plugins Template Edits Translations  

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_table
FIND
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&amp;pollid=$pollinfo[pollid]">$vbphrase[add_writein_vote]</a>&nbsp;&nbsp;</span></if>
3. Edit Template pollresults_table
FIND
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]">&nbsp;&nbsp;<a href="poll.php?$session[sessionurl]do=changevote&amp;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:
  1. Showing the "Write-In" checkbox under Miscellaneous Options when creating a poll.
  2. Showing the poll with the link to add a write-in vote.
  3. Showing the screen to add a write-in vote.
  4. Showing the new poll with the new write-in vote and the link to Change your vote.
  5. Showing the new feature (ver 1.1) where the username is placed after the write-in vote.
  6. Showing the moderator log entry.

Download

This modification is archived, downloads are still allowed.

File Type: %1$s product-poll_write_in_vote_3.7.xml (14.6 KB, 184 downloads)

Screenshots

Click image for larger version
Name:	addwritein.jpg
Views:	482
Size:	17.7 KB
ID:	90394   Click image for larger version
Name:	change.jpg
Views:	444
Size:	15.5 KB
ID:	90395   Click image for larger version
Name:	chkbox.jpg
Views:	421
Size:	13.5 KB
ID:	90396   Click image for larger version
Name:	modlog.jpg
Views:	352
Size:	19.1 KB
ID:	90397  

Click image for larger version
Name:	poll.jpg
Views:	379
Size:	16.3 KB
ID:	90398   Click image for larger version
Name:	uname.jpg
Views:	418
Size:	21.1 KB
ID:	90399  

Similar Mods

Miscellaneous Hacks Poll Write-In & Change Vote Hack vBulletin 3.6 Add-ons

vblts.ru supports vBulletin®, 2022-2024