Callback Vote Check Information


Top Games Way has a unique feature to help webmasters to reward their users for voting.

This feature can only be used by premium members due to the high volume of resources it needs.

The Callback Vote Check feature is very easy to use. There is a three step installation guide:

1.- Configure your Callback Vote URL in your User Control Panel. Our server will call that URL everytime a user votes with a valid "playerid", which you should specify in your voting code.

2.- Add the string "&playerid=your generated player id" to your voting link code. You can use a number, their account name or whatever you want. That information will be sent back to you when that user votes correctly. For example, you can use a code similar to this one to generate the voting url:

PHP Code
<?php echo '"'$playerid'"'?>

Remember to change the code to fit your needs. This code won't work as it is.

3.- Also you should add a script in your server to process the voting code. Here we provide a PHP example which you can use. You only need to add the code to give the reward to the player. The rest of the code is fully functional.

PHP Code
function VoteReward($playerid){
//Here is where you should add your reward code!!!!!!!!
    //Log to voting.log | Remove comment if you want to log votes
    //file_put_contents("voting.log", "Voting Script called. User has voted. Time: " . date("d.m.Y H:m:s", time()) . " User: " . $playerid . "\n", FILE_APPEND);
//-- You don't need to change anything below this unless you know what you're doing --
$playerid $_POST['playerid'];
if (!empty(
//check if the IP is Top Games Way's ip
if ( $_SERVER['REMOTE_ADDR'] == '' ){
//Call Vote Reward function
//Return OK for TGW server and finish
echo 'OK';