Author Topic: Integration of Short Links in Dice Script  (Read 247 times)

0 Members and 2 Guests are viewing this topic.

Offline alamin

  • Administrator
  • Initiate
  • *****
  • Posts: 265
  • Country: bd
  • Gender: Male
  • Referrals: 16
Integration of Short Links in Dice Script
« on: April 27, 2017, 01:50:43 PM »
Hi mates! Today I am going to show you how to integrate short links in your dice faucet. I will use my shortener You are not allowed to view links. Register or Login here.

Firstly, download this You are not allowed to view links. Register or Login, upload it on root directory and unzip.

Open links/link.php file and find:
Code: You are not allowed to view links. Register or Login
$prolink_api = "xxx"; //ProLink API TokenAdd your You are not allowed to view links. Register or Login.
Code: You are not allowed to view links. Register or Login
$site_url = "http://example.com"; //Your site url, (no slash at ending.)Give your faucet's link here. Do not give a slash (/) after link. i.e. "You are not allowed to view links. Register or Login" or "You are not allowed to view links. Register or Login"; not "You are not allowed to view links. Register or Login" or "You are not allowed to view links. Register or Login".

Then, open your root index.php file and find:
Code: You are not allowed to view links. Register or Login
$recaptchaSecret = "xxx"; //recaptcha secret key[Here you put reCaptcha secret key.]
Add these codes after it:
Code: You are not allowed to view links. Register or Login
$extra = 50; //extra satoshi for visiting short link
function getUserIP()
{
    $client  = @$_SERVER['HTTP_CLIENT_IP'];
    $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
    $remote  = $_SERVER['REMOTE_ADDR'];

    if(filter_var($client, FILTER_VALIDATE_IP))
    {
        $getip = $client;
    }
    elseif(filter_var($forward, FILTER_VALIDATE_IP))
    {
        $getip = $forward;
    }
    else
    {
        $getip = $remote;
    }
    return $getip;
}
$userip = getUserIP();

$lnk_lnk = "links/lnk/$userip.xxx"; //link path
if (file_exists($lnk_lnk)) {
     $check_link = file_get_contents($lnk_lnk); //check status
     if ($check_link == 200) {
          $startBal += $extra;
          $msg1 = "You have received extra $extra satoshi for visiting short link.";
     }
}
$lnkmsg = "";
if (isset($_GET["lnkmsg"])) {
   $lnkmsg = $_GET["lnkmsg"];
}

Then put these codes anywhere after <body> tag to display the widget:
Code: You are not allowed to view links. Register or Login
<?php
if (isset($msg1)) {
    echo 
$msg1;
} else {
    echo 
"<b style='color: #f00; font-size: 14px;'>Visit this</b> <a href='links/link.php'><b style='color: teal; font-size: 14px;'>Short Link</b></a> and click on <b style='border: 3px solid green;'>&nbsp; Skip Ad &nbsp;</b> button to get extra <b>$extra satoshi</b> on your next claim.";
}
echo 
"<b style='color:red;'><br>$lnkmsg</b>";
?>

Now open dicegame/index.php and find:
Code: You are not allowed to view links. Register or Login
$_SESSION['cashout'] = $result["html"];Add before:
Code: You are not allowed to view links. Register or Login
function getUserIP()
{
    $client  = @$_SERVER['HTTP_CLIENT_IP'];
    $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
    $remote  = $_SERVER['REMOTE_ADDR'];

    if(filter_var($client, FILTER_VALIDATE_IP))
    {
        $getip = $client;
    }
    elseif(filter_var($forward, FILTER_VALIDATE_IP))
    {
        $getip = $forward;
    }
    else
    {
        $getip = $remote;
    }
    return $getip;
}
$userip = getUserIP();
$lnk_lnk = "../links/lnk/$userip.xxx"; //link path
if (file_exists($lnk_lnk)) {
    $status = "done";
    $m_lnk = fopen($lnk_lnk, "w");
    fwrite($m_lnk, $status);
    fclose($m_lnk);
}

That's it. Tell me if you have any problem. :)
« Last Edit: April 30, 2017, 11:00:08 PM by alamin »


Offline josh21

  • Newbie
  • *
  • j
  • Posts: 14
  • Country: au
  • Gender: Male
  • Referrals: 1
Re: Integration of Short Links in Dice Script
« Reply #1 on: April 27, 2017, 02:54:20 PM »
Whats site_url? i cant find it any where?

Offline alamin

  • Administrator
  • Initiate
  • *****
  • Posts: 265
  • Country: bd
  • Gender: Male
  • Referrals: 16
Re: Integration of Short Links in Dice Script
« Reply #2 on: April 27, 2017, 03:01:46 PM »
You are not allowed to view links. Register or Login
Whats site_url? i cant find it any where?
site_url means your website's url where you have installed dice script.
i.e. If you have installed dice script in You are not allowed to view links. Register or Login , just put $site_url = "You are not allowed to view links. Register or Login"; :)

Offline alamin

  • Administrator
  • Initiate
  • *****
  • Posts: 265
  • Country: bd
  • Gender: Male
  • Referrals: 16
Re: Integration of Short Links in Dice Script
« Reply #3 on: April 27, 2017, 03:03:03 PM »
Topic and file, both have been updated. Please read again and download again. ;D

Offline josh21

  • Newbie
  • *
  • j
  • Posts: 14
  • Country: au
  • Gender: Male
  • Referrals: 1
Re: Integration of Short Links in Dice Script
« Reply #4 on: April 27, 2017, 03:03:15 PM »
You are not allowed to view links. Register or Login
site_url means your website's url where you have installed dice script.
i.e. If you have installed dice script in You are not allowed to view links. Register or Login , just put $site_url = "You are not allowed to view links. Register or Login"; :)

oh i see you have to add that code with the api token well i  did not know that

Offline alamin

  • Administrator
  • Initiate
  • *****
  • Posts: 265
  • Country: bd
  • Gender: Male
  • Referrals: 16
Re: Integration of Short Links in Dice Script
« Reply #5 on: April 27, 2017, 03:19:51 PM »
You are not allowed to view links. Register or Login
oh i see you have to add that code with the api token well i  did not know that
Exactly, now you know that. :)

Offline alamin

  • Administrator
  • Initiate
  • *****
  • Posts: 265
  • Country: bd
  • Gender: Male
  • Referrals: 16
Re: Integration of Short Links in Dice Script
« Reply #6 on: April 30, 2017, 11:02:21 PM »
Updated