I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

Customize referral system

dashed-slug.net Forums Faucet extension support Customize referral system

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #4409
    Anonymous
    Inactive

    Hi 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.

    #4414
    alexg
    Keymaster

    Unfortunately 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

    #4431
    Anonymous
    Inactive

    Thanks Alex!!!

    #4604
    Anonymous
    Inactive

    is that something we can call from the wordpress and if so how?

    #4606
    alexg
    Keymaster

    User meta is accessible with the WordPress function get_user_meta().

    #4611
    Anonymous
    Inactive

    yes i knew that but i meant is there a easy way maybe via php to use

    wallets-faucet-referrer-id

    say i want to give a user 10 coins for logging in?

    #4615
    alexg
    Keymaster

    There 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

    #4620
    Anonymous
    Inactive

    that 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?

    #4623
    alexg
    Keymaster

    The claim.php file in the faucet code uses the wallets_api_move action 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

    #4630
    Anonymous
    Inactive

    thanks i really like the notify if funds are low in the claim.php!

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.