It takes less than 5 minutes to integrate Revlum into your Claimbits Script. Let's get started.
1. To create Postback file - open system/gateways/
and create file revlum.php
, put following code in this file:
<?php
define('BASEPATH', true);
require('../init.php');
$secret = "YOUR SECRET KEY";
$userId = isset($_REQUEST['subId']) ? $db->EscapeString($_REQUEST['subId']) : null;
$survey = isset($_REQUEST['transId']) ? $db->EscapeString($_REQUEST['transId']) : null;
$reward = isset($_REQUEST['reward']) ? $db->EscapeString($_REQUEST['reward']) : null;
$payout = isset($_REQUEST['payout']) ? $db->EscapeString($_REQUEST['payout']) : null;
$action = isset($_REQUEST['status']) ? $db->EscapeString($_REQUEST['status']) : null;
$userIP = isset($_REQUEST['userIp']) ? $db->EscapeString($_REQUEST['userIp']) : '0.0.0.0';
$country = isset($_REQUEST['country']) ? $db->EscapeString($_REQUEST['country']) : null;
if (md5($userId.$survey.$reward.$secret) != $_REQUEST['signature']){
echo "ERROR: Signature doesn't match";
return;
}
if(!empty($userId) && $db->QueryGetNumRows("SELECT * FROM `completed_offers` WHERE `survey_id`='".$survey."' LIMIT 1") == 0)
{
$user = $db->QueryFetchArray("SELECT `id` FROM `users` WHERE `id`='".$userId."'");
if(!empty($user['id'])) {
$tc_points = (0.10*($payout*100));
$tc_points = ($tc_points < 1 ? 1 : number_format($tc_points, 0));
$db->Query("UPDATE `users` SET `ow_credits`=`ow_credits`+'".$reward."', `tasks_contest`=`tasks_contest`+'".$tc_points."' WHERE `id`='".$user['id']."'");
$db->Query("INSERT INTO `users_offers` (`uid`,`total_offers`,`total_revenue`,`last_offer`) VALUES ('".$user['id']."','1','".$reward."','".time()."') ON DUPLICATE KEY UPDATE `total_offers`=`total_offers`+'1', `total_revenue`=`total_revenue`+'".$reward."', `last_offer`='".time()."'");
$db->Query("INSERT INTO `completed_offers` (`user_id`,`survey_id`,`user_country`,`user_ip`,`revenue`,`reward`,`method`,`timestamp`) VALUES ('".$user['id']."','".$survey."','".$country."','".ip2long($userIP)."','".$payout."','".$reward."','Revlum','".time()."')");
}
}
echo 'ok';
?>
2. Open template/default/pages/offers
, and add the following code after some of the existing offerwalls. break;
code.
case 'revlum' :
$title = 'Revlum';
$offer_wall = '<iframe src="https://revlum.com/offerwall/YOUR API KEY/'.$data['id'].'" style="width:100%;height:690px;border:0;border-radius:5px;"></iframe>';
break;
Replace YOUR API KEY
with your Revlum API key from the app settings.
3. Scroll down and paste Revlum's Appwall link
<a href="<?php echo GenerateURL('offers&x=revlum'); ?>" class="btn btn-secondary mb-1<?php echo ($method == 'revlum' ? ' active' : ''); ?>">Revlum</a>
POSTBACK
Currency should be set in credits
Postback URL : http://yourdomain.com/system/gateways/revlum.php