TomasDR |
03-25-2007 11:20 PM |
Quote:
Originally Posted by bchertov
(Post 1212175)
Does this hack allow users to change their votes on any poll (if the correct options are selected)? If so that would be fabulous! It would be good if vote-change feature could selected without the write in option.
Strongly considering installing!
|
It is just for write-in polls only but I just checked my code and forgot the write-in check permission for the Change Vote plugin so realistically you could remove the highlighted blue code from the following instructions.
In the template pollresults_table
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="$pollinfo[writein]"><if condition="$uservoted"> <a href="poll.php?$session[sessionurl]do=changevote&pollid=$pollinfo[pollid]">$vbphrase[change_vote]</a></if></if></span></td>
I apologize for missing the write- in poll permission check for the change vote plugin, if you want to add the code to prevent anyone from entering the URL http://xxx.yourforum.xxx/poll.php?do...evote&pollid=# you can add the following to the plugin Change write-in poll vote
FIND
Code:
//check if poll is closed
if (!$pollinfo['active'] OR !$threadinfo['open'] OR ($pollinfo['dateline'] + ($pollinfo['timeout'] * 86400) < TIMENOW AND $pollinfo['timeout'] != 0))
{ //poll closed
eval(standard_error(fetch_error('pollclosed')));
}
ADD AFTER
Code:
if (!$pollinfo['writein'])
{
print_no_permission();
}
I will ensure that I include the permission check code in the next version, I apologize for any "smart" users you may have on the board that changes their votes with regular non write-in polls.
The permission check is definitely there for adding write ins so again no one can add a write-in vote to a non-write-in poll.
Finally I may consider making the change vote an option (for write-in's only or for all polls).
|