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&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.