You can take a look at the plugin I use myself.
PHP Code:
<?php
$forcepages = explode(',', $plugins->settings['voting']['config']['forcevote_pages']);
//isset are faster than in_array!
if(isset($forcepages[PAGE])) {
$url = 'http://votingapi.com/validate.php?user=' . $this->plugins['voting']['config']['thehabbos_username'] . '&ip=' . $_SERVER['REMOTE_ADDR'];
$context = stream_context_create(array('http' => array('timeout' => 5)));
$data = @file_get_contents($url, 0, $context);
if(!$data || !is_numeric($data)) {
echo "<!-- [ERROR] System Failure in voting system. -->";
} elseif($data == 3) {
$url = $plugins->filter(str_replace("/", "!", $this->plugins['voting']['config']['return_page']));
header("Location: http://votingapi.com/vote.php?username=" . $this->plugins['voting']['config']['thehabbos_username'] . "&api=" . $url);
exit;
}
}
?>
Works great, theres no need for a class to check if a user has voted or not, and then force the visitor to vote!
I can offer personal help fixing/installing this if you are in need, just PM me.