Author Topic: Add-on for FaucetBOX Script  (Read 498 times)

0 Members and 1 Guest are viewing this topic.

Offline alamin

  • Administrator
  • Initiate
  • *****
  • Posts: 274
  • Country: bd
  • Gender: Male
  • Referrals: 17
Add-on for FaucetBOX Script
« on: March 22, 2017, 10:35:25 PM »
Price of Bitcoin changes everyday. So, faucet owners need to keep a balance between bitcoin price and faucet rewards because profit from ad networks depends on bitcoin price. So, I have written a few codes that will change faucet rewards as bitcoin price goes.
[Note: That's for faucetBOX script]

1. Open: /libs/service.php file
Find:
Code: You are not allowed to view links. Register or Login
public function send($to, $amount, $userip, $referral = "false") {Add after:
Code: You are not allowed to view links. Register or Login
        if($this->currency === "BTC") {
        $get_rate = file_get_contents("https://blockchain.info/tobtc?currency=USD&value=1");
        $rate_sats = $get_rate * 100000000;
        $amount = intval($amount * $rate_sats);
        }

2. Create a file named rs.php

Add these codes into it:
Code: You are not allowed to view links. Register or Login
<?php
     $get_rate 
file_get_contents("https://blockchain.info/tobtc?currency=USD&value=1");
     
$rate $get_rate 100000000;
     
$reward1 intval($rate 0.001); // your first reward in USD
     
$reward2 intval($rate 0.0025); // your second reward in USD
     
$reward3 intval($rate 0.005); // your third reward in USD
     
echo "$reward1 , $reward2 , $reward3";
?>

Note: This file is just for showing faucet rewards. If you want to add more rewards, add like this:
Code: You are not allowed to view links. Register or Login
$reward4 = intval($rate * 0.004);
$reward5 = intval($rate * 0.005);
$reward6 = intval($rate * 0.006);
Just replace 0.004, 0.005, 0.006 with your own numbers. Don't touch other things.
Then just add these $reward4 , $reward5 , $reward6 inside echo "";
Example:
Code: You are not allowed to view links. Register or Login
echo "$reward1 , $reward2 , $reward3, $reward4 , $reward5 , $reward6 ";Now upload this file anywhere and get the URL.

3. Then open /templates/default/index.php
Find:
Code: You are not allowed to view links. Register or Login
<?php echo $data["rewards"]; ?>Replace with:
Code: You are not allowed to view links. Register or Login
<?php $show_rewards file_get_contents("http://example.com/rs.php"); echo "$show_rewards"?>Note: Replace You are not allowed to view links. Register or Login with your rs.php file's URL.

4. After completing this part, go to admin panel and put rewards as USD value. Example: 0.001 for 100 satoshi.
That's it. Now everything is complete! Rewards of your faucet will be changed automatically according to bitcoin price, you won't have to worry. :)

Offline Dutchdoge

  • Newbie
  • *
  • D
  • Posts: 6
  • Country: nl
  • Referrals: 0
Re: Add-on for FaucetBOX Script
« Reply #1 on: May 07, 2017, 03:01:08 AM »
Seems nice.. any url to use for Doge?

Offline alamin

  • Administrator
  • Initiate
  • *****
  • Posts: 274
  • Country: bd
  • Gender: Male
  • Referrals: 17
Re: Add-on for FaucetBOX Script
« Reply #2 on: May 08, 2017, 10:50:11 AM »
You are not allowed to view links. Register or Login
Seems nice.. any url to use for Doge?
alts are a bit complex. it needs cryptonator.com's api.