dashed-slug.net › Forums › Faucet extension support › Customize referral system
- This topic has 9 replies, 3 voices, and was last updated 7 years, 1 month ago by
Anonymous.
-
AuthorPosts
-
September 13, 2018 at 7:35 pm #4409
Anonymous
InactiveHi Alex. I’m talking with a developer to customize my website. I would like to know if it is possible to use the faucet referral system to reward a user for other actions of their referrals. For example, rewarding a user if a referral completes a task. I do not want to have several referral systems on the same website.
Thank you very much.
September 14, 2018 at 10:03 am #4414alexg
KeymasterUnfortunately the referral system built into the faucet is meant to be used only by the faucet.
However, with some coding it can be used for other stuff.
The extension maintains an association of users to their referrers via a user meta value.
Every user who is referred from another user should have a user meta with name
wallets-faucet-referrer-id, and value the id of the user who referred them. You can tell this to your developer.hope this helps
kind regards
September 16, 2018 at 12:38 pm #4431Anonymous
InactiveThanks Alex!!!
September 27, 2018 at 10:02 pm #4604Anonymous
Inactiveis that something we can call from the wordpress and if so how?
September 28, 2018 at 9:28 am #4606alexg
KeymasterUser meta is accessible with the WordPress function get_user_meta().
September 28, 2018 at 5:09 pm #4611Anonymous
Inactiveyes i knew that but i meant is there a easy way maybe via php to use
wallets-faucet-referrer-idsay i want to give a user 10 coins for logging in?
October 1, 2018 at 8:49 am #4615alexg
KeymasterThere is no easy way to do this.
You could hook into whatever event you are interested in rewarding, then use get_user_meta to retrieve the referrer id. Finally, use the move action to transfer coins from one account to another.
If you are going to reward users for logging in you must rate-limit this somehow, otherwise your users will be logging in constantly. I would store the last login timestamp in another user meta and check if some time has elapsed.
kind regards
October 1, 2018 at 4:59 pm #4620Anonymous
Inactivethat was just an example
i found in the claim php a way to move funds etc.
is there a php call to move funds as well using your php api?
October 2, 2018 at 8:17 am #4623alexg
KeymasterThe
claim.phpfile in the faucet code uses thewallets_api_moveaction to perform internal transfers.This is documented here: https://wallets-phpdoc.dashed-slug.net/classes/Dashed_Slug_Wallets_PHP_API.html#method_api_move_action
October 4, 2018 at 1:22 am #4630Anonymous
Inactivethanks i really like the notify if funds are low in the claim.php!
-
AuthorPosts
- You must be logged in to reply to this topic.
