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

Reply
 
Thread Tools
Unvote in Polls (Free Version) by BOP5 (Change your vote) Details »»
Unvote in Polls (Free Version) by BOP5 (Change your vote)
Version: 1.1.1, by BirdOPrey5 (Senior Member) BirdOPrey5 is offline
Developer Last Online: Aug 2023 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.x.x Rating:
Released: 04-02-2012 Last Update: 08-17-2013 Installs: 79
Supported Uses Plugins
Translations  

Brought to You By BirdOPrey5
www.BirdOPrey5.com


Version 1.1.1

This is a mod that lets users "unvote" from a poll. After unvoting they are free to vote again so it effectively lets them change their vote.

You can specify whether users are able to unvote from closed polls or not. (By default they are not.)

This is the FREE version. It allows all users to "unvote" from all polls in all forums.

The GOLD version is available here: Unvote in Polls GOLD by BOP5

The GOLD version has 3 additional features:
  • Restrict unvoting to specific usergroups
  • Restrict unvoting to specifc forums
  • Basic integration with points mods to reduce points or reputation after a user unvotes

This mod is compatible with all VB 3.8.x and 4.x.x versions released to date. I expect it will work with earlier VB versions as well but have not tested it.

There are several phrases for easy translation. Exact phrase info is in the info.txt file included in the zip.

Please Note:
If the "Unvote" link is "invisible" in your style (and it probably will be) add this code to your additional.css template:

Code:
#bop5unvote_link {color: blue;}
Where the "color" is any valid HTML or color code. Examples:
red, blue, green, #C0C0C0, #00FF00, etc...


Please Mark as Installed if you use this.
Donations Always Appreciated :up:

VB 4.0.3 (and other old versions) See This Post: https://vborg.vbsupport.ru/showpost....8&postcount=31

Download Now

File Type: zip Unvote in Polls by BOP5 Free v111.zip (5.1 KB, 161 views)

Screenshots

File Type: jpg unvote_settings_free.jpg (132.4 KB, 0 views)
File Type: jpg unvote_poll_vb4.jpg (75.9 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
3 благодарности(ей) от:
Gemma, SaN-DeeP, z3r0

Comments
  #22  
Old 05-01-2012, 11:15 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem, I'm sure many others had (or would have) the same question- it was completely logical.
Reply With Quote
  #23  
Old 05-06-2012, 08:54 AM
Nerror Nerror is offline
 
Join Date: Sep 2010
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great add-on! :up:

If it was possible in the Gold edition to select on a per-poll basis if the poll should have the unvote function, I'd buy it in a heartbeat. That's really the only feature I need besides the basics. Like a little checkbox (default on or off depending on settings) by the make poll public and multiple choice boxes. I don't know how hard to code that would be, but it would be an awesome addition I think.
Reply With Quote
Благодарность от:
BirdOPrey5
  #24  
Old 05-06-2012, 10:34 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the feedback Nerror. It is a pain to code that kind of checkbox but I will try to add it (to the gold version) at some point. Please watch the Gold thread for updates on the issue.
Reply With Quote
Благодарность от:
Nerror
  #25  
Old 05-15-2012, 01:30 AM
Dark Pulse Dark Pulse is offline
 
Join Date: Jun 2006
Location: Buffalo, NY
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice. Been looking for something like this.

My only qualm, and it's really a tiny one: While we have a way to adjust what color the link is, we have no way to change the color when that link is hovered on. My links change color a bit on my forums when a user passes over them (Specifically, to a slightly lighter shade of blue). Any way to set this?

The obvious solution was to try to force #bop5unvote_linkhover via additional.css, but that didn't quite work.
Reply With Quote
Благодарность от:
BirdOPrey5
  #26  
Old 05-15-2012, 12:15 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Add this line as well:

Code:
#bop5unvote_link:hover {color:red;}
That will make it red when you mouse-over the link.

Change red to any color or code you want.
Reply With Quote
Благодарность от:
Dark Pulse
  #27  
Old 05-17-2012, 11:14 PM
Dark Pulse Dark Pulse is offline
 
Join Date: Jun 2006
Location: Buffalo, NY
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, so I was close, but no cigar.

Thanks a bunch for that info though.
Reply With Quote
Благодарность от:
BirdOPrey5
  #28  
Old 07-26-2012, 06:42 PM
masonox masonox is offline
 
Join Date: Feb 2008
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wonderful! Just what I was looking for, 5 stars.
Reply With Quote
Благодарность от:
BirdOPrey5
  #29  
Old 08-28-2012, 05:08 PM
S@NL - BlackBik's Avatar
S@NL - BlackBik S@NL - BlackBik is offline
 
Join Date: Jul 2004
Location: Netherlands
Posts: 307
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just found out that you can unvote closed polls.
Could that be changed so that you can unvote on running polls only?
When a poll is closed there is no use to unvote. But it can confuse people when users delete their vote on a voted and closed topic.

Edit:
Sorry mate. Didn't really test this right. Normal users can't delete their vote on a closed poll. I just could with my administrator account.
Please ignore this request.
Reply With Quote
  #30  
Old 08-28-2012, 07:13 PM
S@NL - BlackBik's Avatar
S@NL - BlackBik S@NL - BlackBik is offline
 
Join Date: Jul 2004
Location: Netherlands
Posts: 307
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, I did some digging.
The plugin "Unvote Option", that shows the link to unvote, is bases on the "$pollinfo['active']" variable that is pulled from the database. The problem is that this variable is only set from 1 (active) to 0 (not active) if you close a poll manually. When the poll is closed because the timeout is reached, this value is NOT changed.
So a lot of polls are closed for voting, because the start time of the poll plus the timeout is reached, but appear still active for this hack.

I've corrected this problem on my board by not checking the active state, but to calculate if the time() is smaller than the timeline plus the timeout.
See this code (red and fat are my changes):

Code:
global $vbulletin;
$polltimeout = $pollinfo['dateline'] + ($pollinfo['timeout'] * 60 * 60 * 24);
$pollactive  = time();

if ($vbulletin->options['bop5uv_en'])
{
  if ($uservoted)
  {
    if (($pollactive <= $polltimeout) OR $vbulletin->options['bop5uv_ifclosed'])
    {
      $pollstatus .= '  <a href="misc.php?do=unvote&amp;t='.$thread['threadid'].'&amp;pollid='.$pollinfo['pollid'].'" id="bop5unvote_link" title="' . $vbphrase['bop5_unvote_title'] . '">(' . $vbphrase['bop5_unvote'] . ')</a>';
    }
  }
}
Explanation:
The $pollinfo['timeout'] is set in days. That's why I convert it to seconds.
$pollactive is the date/time now in Unix timestamp.
$pollinfo['dateline'] is the date/time that the poll is created, also a Unix timestamp.

If you want to use this code, be my guest.
Reply With Quote
  #31  
Old 08-29-2012, 09:40 PM
S@NL - BlackBik's Avatar
S@NL - BlackBik S@NL - BlackBik is offline
 
Join Date: Jul 2004
Location: Netherlands
Posts: 307
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, just found out that I forgot one possibility.
When the timeout is set to 0 (never close the poll) and the poll is closed manually, this doesn't work. Because I've let the $pollinfo['active'] out of the equation and $pollactive == $polltimeout (cause $polltimeout = 0).
Have to figure out a workaround. When I solved this, I'll be back.
Not much time right now.....
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 07:13 PM.


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.05431 seconds
  • Memory Usage 2,354KB
  • Queries Executed 28 (?)
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
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (9)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (3)postbit_attachment
  • (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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete