Vie Faucet Integration

It takes only three steps to integrate Monlix offerwall into your VieFaucet script. Here they are.

First open file - application/controllers/wh.php and enter the following piece of code before last closing bracket (}).

💡
Do not forget to enter your secret key under variable $secretKey from the Monlix's dashboard. Otherwise, your users will not be credited properly since postback will not work.

public function monlix()
{
// UPDATE YOUR SECRET KEY
$secretKey = "";
$hold = 0;
$userId = isset($_GET['userId']) ? $this->db->escape_str($_GET['userId']) : null;
$userIp = isset($_GET['userIp']) ? $this->db->escape_str($_GET['userIp']) : "0.0.0.0";
$transactionId = isset($_GET['transactionId']) ? $this->db->escape_str($_GET['transactionId']) : null;
$reward = isset($_GET['rewardValue']) ? $this->db->escape_str($_GET['rewardValue']) : null;
$action = isset($_GET['status']) ? $this->db->escape_str($_GET['status']) : null;
$signature = isset($_GET['secretKey']) ? $this->db->escape_str($_GET['secretKey']) : null;
if ($secretKey != $signature) {
echo "ERROR: Signature doesn't match";
return;
}
$trans = $this->m_offerwall->getTransaction($transactionId, 'Monlix');
if ($action == 2) {
$this->m_offerwall->reduceUserBalance($userId, abs($reward));
$this->m_offerwall->insertTransaction($userId, 'Monlix', $userIp, $reward, $transactionId, 1, time());
echo "OK";
} else {
if (!$trans) {
if ($hold == 0) {
$offerId = $this->m_offerwall->insertTransaction($userId, 'Monlix', $userIp, $reward, $transactionId, 2, time());
$this->m_offerwall->updateUserBalance($userId, $reward);
$this->m_core->addNotification($userId, format_money($reward) . " USD from Monlix Offer #" . $offerId . " was credited to your balance.", 1);
$user = $this->m_core->get_user_from_id($userId);
$this->m_core->addExp($user['id'], $this->data['settings']['offerwall_exp_reward']);
if (($user['exp'] + $this->data['settings']['offerwall_exp_reward']) >= ($user['level'] + 1) * 100) {
$this->m_core->levelUp($user['id']);
}
} else {
$availableAt = time() + $hold * 86400;
$offerId = $this->m_offerwall->insertTransaction($userId, 'Monlix', $userIp, $reward, $transactionId, 0, $availableAt);
$this->m_core->addNotification($userId, "Your Monlix Offer #" . $offerId . " is pending approval.", 0);
}
echo "OK";
} else {
echo "DUP";
}
}
}

Second step is to add offerwall in the UI. Inside application/controllers/offerwall.php file, add this code before last closing bracket (}).

💡

Don't forget to place on proper place your API key from the dashboard under $appId variable.

public function monlix()
{
//UPDATE API KEY
$appId = '';
$this->data['page'] = 'Monlix Offerwall';
$this->data['iframe'] = '<iframe src="https://offers.monlix.com/?appid=' . $appId . '&userid=' . $this->data['user']['id'] . '" width="800" height="800" />';
$this->data['wait'] = 0;
$this->render('offerwall', $this->data);
}

Third step is to add Monlix's offerwall inside your sidebar on Vie Faucet. Go to this file application/views/user_template/template.php, and place this code above or under some of the existing offerwalls.

<li><a href="<?= site_url('offerwall/monlix') ?>" key=“t-monlix">Monlix</a></li>

How to set site on Monlix?

Postback URL should be: https://yourdomain.com/wh/monlix?userId={{userId}}&userIp={{userIp}}&transactionId={{transactionId}}&rewardValue={{rewardValue}}&status={{status}}&secretKey={{secretKey}}

💡

Tip - if you want to use HOLD function, change:


$hold = 0;
$this->data['wait'] = 0;

Number = amount of days.