I just installed this.
It works well but needed some pottering with for my needs.
Basically my client wants to be able to use this in a restricted area for polls above and beyond the normal "What type of soup is your favourite" i.e. as a portal to allow nationwide members to vote for a committee etc.
My simple solution was to remove the IP address bit of the code and replace it with the user instead. This was simple, and to avoid breaking anything the table is still named as it was by the original author.
So basically
$useraddy = userIP();
$results = $modx->db->select('*', $iptable, 'ipaddress=\'' . $useraddy . '\' AND pollid=' . $_POST['poll_pollid'], '');
has been replaced with
if ($useip == true) {
$results = $modx->db->select('*', $iptable, 'ipaddress=\'' . $theUser . '\' AND pollid=' . $_POST['poll_pollid'], '');
which required that I added a new variable after the comment //setup initial variables
$currentWebUser = $modx->getWebUserInfo($modx->getLoginUserID());
$theUser = $currentWebUser['username'];
Beyonds as how I had gone this far...I replaced the default $ovmessage to
$ovmessage = (isset ($ovmessage)) ? $ovmessage : 'A vote has already been submitted by '.$theUser.' for this poll.<br />If you think this is incorrect please contact <a href="[~106~]">the administrators</a>';
I also found having a vote button a little odd...if I’m not allowed to vote anyway so I moved the if statement that checks if $novote isset from line 143
One point that I have not mentioned is that the polls is restricted anyway. i have added no functionality to test that in the pollvote snippet.
Hope this saves someone a couple of minutes sometime.
@fruitwerks My example seems to be working but is in a restricted area. Do you just want to take a look or are you having problems?
Thanks to the author for saving me a long long time setting this up!
All the best,
Taff