Vote plugin for RevCMS
Features:
Automaticlly discover what url to be sent back to.
Automaticlly finds you user details in config.php
Forces the user to vote (no way out).
Recridts the user automatlicy to votingapi.com
(and returns to client when done voting)
If votingapi.com is offline it acts normal
Install:
Step 1:
Go to class.core.php (/app/class.core.php)
Insert this function called CheckIfVoted
(You need to change your config.php details to make it work)
Step 2:
Go to class.template.php (/app/class.template.php)
Step 3:
You can now add {votecheck} to what page you want the user to vote before he/she watches the content
Download:
If you dont want to add the codes manually you can download it here:
Cheers
-Ole
Features:
Automaticlly discover what url to be sent back to.
Automaticlly finds you user details in config.php
Forces the user to vote (no way out).
Recridts the user automatlicy to votingapi.com
(and returns to client when done voting)
If votingapi.com is offline it acts normal
Install:
Step 1:
Go to class.core.php (/app/class.core.php)
Insert this function called CheckIfVoted
PHP:
final public function CheckIfVoted($ip) {
global $_CONFIG;
$context = stream_context_create(array('http' => array('timeout' => 2)));
$data = file_get_contents('http://votingapi.com/validate.php?user=' . $_CONFIG["thehabbos"]["username"] . '&ip=' . $_SERVER["REMOTE_ADDR"], 0, $context);
if(!$data || !is_numeric($data)) {
echo "<!--[ERROR] System failure in voting system.-->";
return false;
} elseif($data == 3) {
$return = str_replace('/', '!', 'http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
header("Location: http://votingapi.com/vote.php?username=" . $_CONFIG["thehabbos"]["username"] . "&api=" . $return);
exit;
}
}
(You need to change your config.php details to make it work)
Step 2:
Go to class.template.php (/app/class.template.php)
PHP:
Find: $this->setParams('server_ip', $_CONFIG['hotel']['server_ip']);
UNDER Add this code: $this->setParams('votecheck', $core->CheckIfVoted($_SERVER['REMOTE_ADDR']));
Step 3:
You can now add {votecheck} to what page you want the user to vote before he/she watches the content
Download:
If you dont want to add the codes manually you can download it here:
You must be registered for see links
Cheers
-Ole