View Full Version : Miscellaneous Hacks - Unvote in Polls (Free Version) by BOP5 (Change your vote)
BirdOPrey5
04-02-2012, 10:00 PM
Brought to You By BirdOPrey5
www.BirdOPrey5.com (http://www.birdoprey5.com/mods/)
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 (http://www.birdoprey5.com/mods/showthread.php/331-Unvote-in-Polls-Gold-Premium-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:
#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.php?p=2363658&postcount=31
BirdOPrey5
04-03-2012, 03:19 PM
Reserved.
ptceuro
04-03-2012, 09:30 PM
Thank you BirdOPrey5 !
Installed
edytwinky
04-03-2012, 10:47 PM
Where do we go to change the wording unvote to "change vote"
BirdOPrey5
04-03-2012, 11:12 PM
They are all phrases and can be edited via Phrase Manager in Admin CP:
From the info.txt file:
This mod uses several phrases.
GLOBAL Phrases:
bop5_ unvote - Unvote (used for the actual link)
bop5_ unvote_ title - This will remove your vote(s) in this poll. (Used for the tool-tip on mouse-over of the link)
Front End Redirect Messages:
bop5_ uv_ unvoted - You have successfully unvoted. (Used to show a message after a user unvotes in a poll)
BirdOPrey5
04-04-2012, 12:17 PM
Updated version number to 1.1 to match Gold version number. No need to upgrade free version.
Pandemikk
04-04-2012, 12:42 PM
Consider adding an option to make polls private or public along with respective ugp.
Funny how features in the JIRA for years now are so simple to create yourself, isn't it?
BirdOPrey5
04-04-2012, 05:02 PM
Consider adding an option to make polls private or public along with respective ugp.
Funny how features in the JIRA for years now are so simple to create yourself, isn't it?
You can already make a public poll private by editing the poll- the opposite doesn't work, I assume for privacy reasons.
I was able to make a mod to let admins (or any usergroups) see who voted even in private polls: https://vborg.vbsupport.ru/showthread.php?t=281116
Pandemikk
04-04-2012, 05:07 PM
Well you can see who voted in a private poll in the ACP lol. Just food for thought, would be useful to be able to change a private poll to public without running a query.
GKPet
04-05-2012, 01:26 PM
Can you add option to give user the ability to only be able to un-vote once per poll?
BirdOPrey5
04-05-2012, 07:01 PM
That would require adding more fields to the database to keep track of who unvoted. It's not impossible but really a lot more effort then I intended for a mod like this.
kevius
04-06-2012, 06:01 AM
Perfect ! thank you so much !
Nirjonadda
04-30-2012, 12:53 PM
Installed Gold Version working great !
edytwinky
04-30-2012, 11:12 PM
My unvote link is currently in white coloring to where you can barely see it. How do you change the color of it?
Nirjonadda
04-30-2012, 11:41 PM
My unvote link is currently in white coloring to where you can barely see it. How do you change the color of it?
If the "Unvote" link is "invisible" in your style (and it probably will be) add this code to your additional.css template:
#bop5unvote_link {color: blue;}
Where the "color" is any valid HTML or color code. Examples:
red
blue
green
#C0C0C0
#00FF00
edytwinky
05-01-2012, 02:29 AM
It shows up. I just didn't know if I had to change it in my phrase manager
BirdOPrey5
05-01-2012, 08:29 AM
It's not Phrase Manager, it's Style Manager but so long as you get it working. :up:
I'm afraid in the default style the link is almost white on white... I did not want to setup a hard colored link because it would inevitably be wrong for some people so I included instructions to let people specify their own color (per style) should it be an issue.
Boofo
05-01-2012, 06:32 PM
I did not want to setup a hard colored link because it would inevitably be wrong for some people so I included instructions to let people specify their own color (per style) should it be an issue.
Make a style variable for the color. ;)
BirdOPrey5
05-01-2012, 08:17 PM
I didn't want to add a stylevar for this 1 small link because doing so would make the mod incompatible with VB 3.x and I am trying to limit the number of unique mods I have to support. Keeping this as a quick manual additional.css edit keeps it working for box 3.x and 4.x at the same time.
Boofo
05-01-2012, 08:23 PM
I didn't want to add a stylevar for this 1 small link because doing so would make the mod incompatible with VB 3.x and I am trying to limit the number of unique mods I have to support. Keeping this as a quick manual additional.css edit keeps it working for box 3.x and 4.x at the same time.
True. My bad.
BirdOPrey5
05-01-2012, 11:15 PM
No problem, I'm sure many others had (or would have) the same question- it was completely logical.
Nerror
05-06-2012, 08:54 AM
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. :)
BirdOPrey5
05-06-2012, 10:34 AM
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.
Dark Pulse
05-15-2012, 01:30 AM
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. :)
BirdOPrey5
05-15-2012, 12:15 PM
Add this line as well:
#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.
Dark Pulse
05-17-2012, 11:14 PM
Ah, so I was close, but no cigar.
Thanks a bunch for that info though. :)
masonox
07-26-2012, 06:42 PM
wonderful! Just what I was looking for, 5 stars.
S@NL - BlackBik
08-28-2012, 05:08 PM
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.
S@NL - BlackBik
08-28-2012, 07:13 PM
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):
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&t='.$thread['threadid'].'&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.
S@NL - BlackBik
08-29-2012, 09:40 PM
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.....
Frans72
09-08-2012, 12:53 PM
The misc.php plugin part does not redirect after unvoting on vb403. No idea if it works on vb4.1 but 4.03 needs to eval that code and needs the array() construct removed.
vb403 works: eval(print_standard_redirect('bop5_uv_unvoted', true, true));
//vb403 fails: print_standard_redirect(array('bop5_uv_unvoted'), true, true);
Thanks for the mod none the less, 'cos it works nicely now :)
BirdOPrey5
09-11-2012, 11:19 AM
Thanks for posting the fix. :)
It does work on newer versions as is.
Kirk Fitzgerald
11-06-2012, 04:12 PM
You're a godsend, thank you very much for this Mod', an absolute life saver, brilliant, and it works perfectly. :)
WorldCraft
12-24-2012, 12:42 AM
Not working on my vB 4.2.0 PL2. Unvote link does not display and no permission error is given if I try to manually access misc.php?do=unvote. Can I request an update?
Embarrassing, I didn't notice I had to manually enable the mod in Options. Working now hehe.:o
DirtRider
01-10-2013, 06:00 AM
Could you have not just added a button for the gold version as I hate having to manually edit anything
BirdOPrey5
01-12-2013, 02:09 PM
A button for what? The "Unvote" link?
DirtRider
01-12-2013, 03:56 PM
Yeah then you would not need to do manual edits at all
DirtRider
03-31-2013, 06:30 AM
I have upgraded my forum to 4.2 now this mod no longer works
BirdOPrey5
04-09-2013, 12:54 PM
Well it does work on 4.2.0 in general.
Are you sure the link isn't just invisible because it's white on white? Did you do the template edit to additional.css to fix that?
Dwarden
04-13-2013, 06:23 AM
using it on 4.2.0 pl3 , but yes I needed to improve the templates to make it visible on all our skins ...
bchertov
08-06-2013, 03:50 PM
Works great in 4.1.12. Thanks!
aboayoy
08-13-2013, 03:24 PM
thank you
iraqiboy90
08-13-2013, 03:42 PM
Why is the unvote button still working when the poll does a time-close. Only manual closing results in the unvote button disappearing.
BirdOPrey5
08-17-2013, 11:21 AM
Did you try refreshing the page after the poll closed?
BirdOPrey5
08-18-2013, 12:27 PM
Never mind, I see it's a bug. Will fix soon.
BirdOPrey5
08-18-2013, 01:17 PM
Updated to 1.1.1 - Fixes bug where unvote option still visible on expired (closed) polls.
Bubble #5
08-19-2013, 05:33 PM
Great hack BOP :up:
Any way it can be expanded to include "thread rating" votes?
BirdOPrey5
08-19-2013, 10:48 PM
Will look into thread ratings, it would be a separate mod, not really related to poll votes. Will announce here though if I make something.
Bubble #5
08-19-2013, 10:53 PM
Thank you BOP. As always, appreciate it :up:
BirdOPrey5
08-19-2013, 11:06 PM
So it seems if you go to Admin CP -> Settings -> Options -> Poll and Thread Rating Options, the last setting is "Allow Thread Rating Vote Changes" and it can be set to YES, and users can change their vote.
Is Unvote really necessary in this case or was change the vote all you needed?
Bubble #5
08-19-2013, 11:18 PM
Nope, that was it :up:
Never even noticed that setting before. Must have got lost in the multitude of settings :p
THANKS BOP, Appreciate it :up:
MattGarner
10-06-2013, 07:21 AM
Updated to 1.1.1 - Fixes bug where unvote option still visible on expired (closed) polls.
Still seems to allow members to unvote even if the poll has been closed?
BirdOPrey5
10-06-2013, 06:16 PM
You sure product manager reports version 1.1.1? What version of VB you running?
MattGarner
11-25-2013, 09:16 PM
You sure product manager reports version 1.1.1? What version of VB you running?
Sorry for late reply, just tried it again and it does show 1.1.1 in the product manager. The VB version is 4.2.2
JesWhite
11-24-2014, 04:59 PM
very good addon...
but i have a problem..
i'm using Show a Poll In FORUMHOME addon for vbulletin 4.2.1...
your addon working fine on showthreads...
but my not working forumhome to showresults...
this addon's codes here...i think this is not hard for you...
thanks..
BirdOPrey5
11-29-2014, 03:15 PM
You're not allowed to redistribute code- especially not one from a hack site.
I'm sorry but I don't have time right now to try and get it to work with other mods.
eboggs_jkvl
12-09-2017, 01:04 PM
Bumped into a problem. My site was http and I recently went to https. Now the "number of voted " total, that allowed you to hover over and click has stopped that ability. The only way to see who voted is to go into the admin CP and look. I really need it to be as it was and allow the thread starter and any reader of the thread to see who voted by clicking on the number of votes.
OR......
Is the ability to see who voted only available to the admin? If that is true, then bummer, I want the voters to see how they voted and who voted.
Any words of wisdom?
BirdOPrey5
12-09-2017, 02:12 PM
In order for everyone to see who voted what way it has to be designated a "public poll" when it is created. That isn't changed by this mod. A public poll will have a disclaimer that anyone can see how you voted. That's always how VB polls worked.
eboggs_jkvl
12-09-2017, 02:18 PM
Well crap!!! I thought I had checked Public poll. I just made a test and you're correct. Old people do dumb things!
Thanks. Sorry to bother...
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.