Newbie Spellweaver
- Joined
- Jan 27, 2012
- Messages
- 39
- Reaction score
- 4
you can use superrewards so your players will get points automaticly after paying and aswell you can get money from ppl that can't pay while they doing surveys for gold
Register an account at srpoints.com
than add an application to your srpoints account
add the postback.php to your game server
change APP KEY to yours
add to your database:
and add the iframe to templates/plus/1.tpl
and change uid=<[USER ID]> to uid=<?php echo $session->uid; ?>
and than go to the tarrifs and test the postback
hope it helps and sorry for my bad english
and thanks to advo for the postback script
Register an account at srpoints.com
than add an application to your srpoints account
add the postback.php to your game server
PHP:
<?php
// +---------------------------------------------+
// | Super Rewards Call back script WITH loging |
// +---------------------------------------------+
// | DONOT REMOVE THIS |
// +---------------------------------------------+
// | Copyright Rodney Cheney 2011-2015 |
// +---------------------------------------------+
include("GameEngine/Database.php");
$SECRET = "APP KEY"; ///this is you apps secret key get this from app info
$snuid = $_REQUEST['uid']; // this grabs the snuid from the url
$currency = $_REQUEST['new']; // this grabs amount of points to award user
$total= $_REQUEST['total']; // this grabs total points super rewards has ever sent user
$offerwallID = $_REQUEST['oid'];// this grabs the offer walls offer ID
$transactionID = $_REQUEST['id'];//this grabs the taransaction id from super rewards
$sidverify = $_REQUEST['sig']; // this grabs the hashed info for you to authenticate with
// make a hash of our own to verify authenicc transaction
$sig = md5($_REQUEST['id'] . ':' . $_REQUEST['new'] . ':' . $_REQUEST['uid'] . ':' . $SECRET);
//here we are gonna count the total points loged each time user has recived points
$sql = "SELECT SUM(`points`) as `DeadWeight` FROM `sr_log` WHERE `userID`='$snuid'";
if( !($result = mysql_query($sql)) )
{
die('Failed to query database. srlogs.');
}
$row = mysql_fetch_array($result);
$DeadWeight = $row['DeadWeight'];
// You may want to add other checks to ensure that the user exists in your system
//Check if hashed info is same as hashed info from superrewards if not do nothing.
if ($sidverify == $sig)
{
//Insert Super Rewards transaction info into your database
mysql_query("INSERT INTO sr_log SET points=$currency,total=$total,oid=$offerwallID,userID=$snuid, transID=$transactionID");
//Check if the total amount of points awarded to users is less then or the same as total from super rewards
//This will make sure you dont give more then you should.
if ($DeadWeight <= $total)
{
//If all is good Update the user with there points from the url request.
mysql_query("UPDATE ".TB_PREFIX."users SET gold = gold + ".$currency." WHERE id = '".$snuid."'");
}
echo "1";
}else{
echo "0";
}
?>
add to your database:
PHP:
DROP TABLE IF EXISTS `sr_log`;
CREATE TABLE IF NOT EXISTS `sr_log` (
`transID` int(11) NOT NULL,
`userID` int(11) NOT NULL,
`Points` int(11) NOT NULL,
`oid` varchar(255) NOT NULL,
`total` int(11) NOT NULL,
PRIMARY KEY (`transID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
and change uid=<[USER ID]> to uid=<?php echo $session->uid; ?>
and than go to the tarrifs and test the postback
hope it helps and sorry for my bad english
and thanks to advo for the postback script
Last edited: