Author

Topic: A little help (regarding a faucet) ? (Read 622 times)

legendary
Activity: 1358
Merit: 1000
Bitcoiner since start, and continue to love it!
April 07, 2015, 07:23:25 AM
#9
UPDATE :

somebody can help me to fix this issue ?
i offer a nice bounty for a solution.
legendary
Activity: 1358
Merit: 1000
Bitcoiner since start, and continue to love it!
April 07, 2015, 03:09:50 AM
#8
I see a error when I click "Update server balance" from admin panel : Balance is not updated or balance is empty

But I have enough btc in my blockchain wallet.
sr. member
Activity: 476
Merit: 250
April 06, 2015, 01:56:52 PM
#7
One more question :

the max. value for "WEIGHT"  must be 100 ?

or could be 500 for example ?

there is no max. you can set whatever you want but beware more value means that the possibility of related reward will raise too.
legendary
Activity: 1358
Merit: 1000
Bitcoiner since start, and continue to love it!
April 06, 2015, 08:21:53 AM
#6
One more question :

the max. value for "WEIGHT"  must be 100 ?

or could be 500 for example ?
sr. member
Activity: 476
Merit: 250
April 06, 2015, 07:11:10 AM
#5
A dumb question maybe ... what is "0" in this case ?

http://php.net/array_fill

zero is the start index.
legendary
Activity: 1358
Merit: 1000
Bitcoiner since start, and continue to love it!
April 06, 2015, 06:47:00 AM
#4
could this be a solution ?

Quote
// Each reward entry is in the follwing format: array_fill(0,WEIGHT,REWARD) where WEIGHT is how frequently you want the REWARD to occur.
$rewards = array_merge(array_fill(0,1,500),
                       array_fill(0,10,200),
                       array_fill(0,100,150),
                       array_fill(0,100,100),
                       array_fill(0,50,75),
                       array_fill(0,50,50),
                       array_fill(0,25,25),
                       array_fill(0,20,10)
);

Yes, this is the solution.Replace in the first code  $rewards = array(1000, 2000, 3000, 4000, 5000); with that other $rewards = .... code.It should work.

Thank you @niktitan132

A dumb question maybe ... what is "0" in this case ?
legendary
Activity: 1036
Merit: 1000
April 06, 2015, 06:39:07 AM
#3
could this be a solution ?

Quote
// Each reward entry is in the follwing format: array_fill(0,WEIGHT,REWARD) where WEIGHT is how frequently you want the REWARD to occur.
$rewards = array_merge(array_fill(0,1,500),
                       array_fill(0,10,200),
                       array_fill(0,100,150),
                       array_fill(0,100,100),
                       array_fill(0,50,75),
                       array_fill(0,50,50),
                       array_fill(0,25,25),
                       array_fill(0,20,10)
);

Yes, this is the solution.Replace in the first code  $rewards = array(1000, 2000, 3000, 4000, 5000); with that other $rewards = .... code.It should work.
legendary
Activity: 1358
Merit: 1000
Bitcoiner since start, and continue to love it!
April 06, 2015, 06:24:23 AM
#2
could this be a solution ?

Quote
// Each reward entry is in the follwing format: array_fill(0,WEIGHT,REWARD) where WEIGHT is how frequently you want the REWARD to occur.
$rewards = array_merge(array_fill(0,1,500),
                       array_fill(0,10,200),
                       array_fill(0,100,150),
                       array_fill(0,100,100),
                       array_fill(0,50,75),
                       array_fill(0,50,50),
                       array_fill(0,25,25),
                       array_fill(0,20,10)
);
legendary
Activity: 1358
Merit: 1000
Bitcoiner since start, and continue to love it!
April 06, 2015, 03:37:02 AM
#1
Hi

Someone can tell me if we can set a percent of the rewards ?
(I mean  to offer  1000 satoshi = 50% , 2000 satoshi = 30%, 3000 satoshi= 10%, 4000 satoshi= 9%, 5000 satoshi = 1%) it is just a example.


Now I have :

Quote
// Array of 8 rewards in satoshis. 100,000,000 satoshis = 1 BTC

// 1 mBTC = 100,000 Satoshis

// 1 ?BTC (microbitcoin) = 100 Satoshis

$rewards = array(1000, 2000, 3000, 4000, 5000);

$minReward = min($rewards);

$maxReward = max($rewards);]

The source code for the faucet : https://gitorious.org/elbandi/minifaucet

The file where the rewards are set is : config.php

Thank you
Jump to: