ClaimBits Integration

ClaimBits is a new type of Crypto Faucet which brings plenty of different features together into a complete system.

Monlix integration is pretty easy - 1 file, 1 line of code, and that’s it! Less than 5 minutes and you can bring Monlix offerwall to your users.

Postback file - open system/gateways/ and create file monlix.php, put following code in this file:


<?php
define('BASEPATH', true);
require('../init.php');
// UPDATE SECRET KEY
$secret = "YOUR SECRET HASH";
$userId = isset($_REQUEST['userid']) ? $db->EscapeString($_REQUEST['userid']) : null;
$survey = isset($_REQUEST['transactionid']) ? $db->EscapeString($_REQUEST['transactionid']) : 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;
// validate signature
if ($secret != $db->EscapeString($_REQUEST['secret'])) {
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()."'");
if(filter_var($userIP, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
$db->Query("INSERT INTO `completed_offers` (`user_id`,`survey_id`,`user_country`,`user_ip`,`revenue`,`reward`,`method`,`timestamp`) VALUES ('".$user['id']."','".$survey."','".$country."','777','".$payout."','".$reward."','Monlix','".time()."')");
} else {
$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."','Monlix','".time()."')");
}
}
echo "OK";
}
?>

Change $secret = "YOUR SECRET HASH"; - replace YOUR SECRET HASH by your secret key from Monlix dashboard, after that just save and close the file.

Done, postback created! Now is time for iframe integration.

Open template/default/pages/offers.php, and add the following code after some of the existing offerwalls.

case 'monlix':
$title = 'Monlix';
$offer_wall = '<iframe src="https://offers.monlix.com/?appid=YOURAPPCODE&userid='.$data['id'].'" style="width: 100%; height: 800px; margin: 0; padding: 0; border: 0;" /></iframe>';
break;
💡

Replace YOURAPPCODE by API key from Monlix dashboard.


Scroll down and insert link to Monlix offerwall:

<a href="<?php echo GenerateURL('offers&x=monlix'); ?>" class="btn btn-secondary mb-1<?php echo ($method == 'monlix' ? ' active' : ''); ?>">Monlix</a>

And save, that is all!

How to set site on monlix.com?


Currency should be credits

Postback URL should be https://yourdomain.com/system/gateways/monlix.php?userid={{userId}}&transactionid={{transactionId}}&reward={{rewardValue}}&payout={{payout}}&status={{status}}&userip={{userIp}}&country={{countryCode}}&secret={{secretKey}}

Tip

Add link to main menu - open template/default/common/header.php and insert link to menu:

<a class="dropdown-item" href="<?=GenerateURL('offers&x=monlix')?>"><i class="fa fa-list-ol fa-fw"></i> Monlix</a>