Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Poll Write-In & Change Vote Hack Details »»
Poll Write-In & Change Vote Hack
Version: 1.5, by TomasDR TomasDR is offline
Developer Last Online: Oct 2019 Show Printable Version Email this Page

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
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.0:
  • Initial release of the hack
Version 1.1:
  • 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:
  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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 06-20-2007, 09:39 PM
Dennis B's Avatar
Dennis B Dennis B is offline
 
Join Date: Jul 2002
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent hack, thanks!
Reply With Quote
  #43  
Old 07-13-2007, 12:04 PM
georgeshaner georgeshaner is offline
 
Join Date: Jul 2007
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi,
this looks great.
i'm new to this, so please forgive the basic question:
when you say to download/install the xml file, what location/path do i use?
thanks so much for your efforts.
Reply With Quote
  #44  
Old 10-05-2007, 01:42 PM
gmattox gmattox is offline
 
Join Date: Jul 2003
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see this hasn't been posted on in awhile, but I need to reiterate the request of Shana. Is their a way to make it so only the admins see who added the write in? I am conducting some serious polls, and don't want the other users seeing who added it. That, or is their a way to just remove the username after it altogether?
Reply With Quote
  #45  
Old 10-05-2007, 03:57 PM
gmattox gmattox is offline
 
Join Date: Jul 2003
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, I think I figure out how to remove it on my own. In the xml file that you download, look for this line
Code:
$optionvalue = $optionvalue . " (" .$vbulletin->userinfo[username]. ")";
				$poll->set_option($optionvalue, $counter - 1,
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...
Reply With Quote
  #46  
Old 10-09-2007, 10:15 PM
fb-guy fb-guy is offline
 
Join Date: Mar 2005
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello all,

I am looking for a way of creating a year end "awards" for our members. Our community builds brick ovens, and we want to set up categories, let members nominate ovens, and them we all get to vote. At the end, we will count the votes, and send out physical awards (things we will send to the winners).

Can I do this with the Poll Write-in Hack?

What do you think?
FB
Reply With Quote
  #47  
Old 10-12-2007, 04:08 AM
zetetic's Avatar
zetetic zetetic is offline
 
Join Date: Apr 2004
Posts: 338
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #48  
Old 10-14-2007, 12:02 AM
meissenation meissenation is offline
 
Join Date: Apr 2005
Posts: 476
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very, very cool! Awesome mod!
Reply With Quote
  #49  
Old 11-07-2007, 09:52 PM
gable74 gable74 is offline
 
Join Date: May 2005
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can someone explain how and where to install the .XML file please? I try to upload it in the upload/download styles section and it give me an invalid file error. Can i just upload the .xml to a directory someplace? Thanks
Reply With Quote
  #50  
Old 11-07-2007, 10:19 PM
gable74 gable74 is offline
 
Join Date: May 2005
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

never mind, i figured it out. Had to goto "plug-ins and products"-> product manager-> upload the .xml
Reply With Quote
  #51  
Old 11-25-2007, 01:53 PM
TomasDR TomasDR is offline
 
Join Date: Feb 2006
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by fb-guy View Post
Hello all,

I am looking for a way of creating a year end "awards" for our members. Our community builds brick ovens, and we want to set up categories, let members nominate ovens, and them we all get to vote. At the end, we will count the votes, and send out physical awards (things we will send to the winners).

Can I do this with the Poll Write-in Hack?

What do you think?
FB
I have had personal family issues so sorry for the delay. Yes this will work since it allows users to add write-in votes to a poll. You would need to setup an initial poll with a couple choices first of course.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:25 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05653 seconds
  • Memory Usage 2,325KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete