Let's try this again...
1) Undo the hack.
2) The only viable option is to allow voting for registered users only. In config.inc.php make sure this...
// Do you want everyone to vote, or just registered users?
// 1 = everyone : 0 = registered
$config['whovote'] = 0;
...is set to 0.
That will automatically use their usernumber to track voting and not IP#'s.
There is really no possible way to allow unregistered users to vote under the circumstances mentioned in the first post.