<?php
/*
 * The Offerwall.GG page for VieFaucet.
 *
 * Paste the method below into application/controllers/Offerwall.php, just
 * before the last closing bracket "}" of the class. The page is then at
 * https://YOUR-SITE/offerwall/offerwallgg
 */

    public function offerwallgg()
    {
        // Your placement's keys from offerwall.gg.
        $publicKey = 'YOUR_PUBLIC_KEY';
        $secretKey = 'YOUR_SECRET_KEY';

        // Signed, so nobody can open the wall as another user.
        $userId    = (string) $this->data['user']['id'];
        $signature = hash_hmac('sha256', 'appId=' . $publicKey . '&userId=' . $userId, $secretKey);
        $src       = 'https://offerwall.gg/wall/' . rawurlencode($publicKey)
                   . '?userId=' . rawurlencode($userId) . '&signature=' . $signature;

        $this->data['page']   = 'Offerwall.GG';
        $this->data['iframe'] = '<iframe src="' . htmlspecialchars($src, ENT_QUOTES, 'UTF-8') . '" style="width:100%;height:900px;border:0" title="Offerwall"></iframe>';
        $this->data['wait']   = 0;
        $this->render('offerwall', $this->data);
    }
