Affiliate, what's the procedure to the Database ?

Hello,

Today i have a big question for you, maybe you can help me ? :wink:

I need to extract some informations from my database to execute a "cron job" every x minutes with another application.

To do that, i need to extract members informations like email, user ID, ect... I know i can do that with the table "wp_signups", it's not a problem...

But with the plugin "Affiliate" i need to extract the "sponsor email" or "sponsor ID" relative to each user.

So my question is :

What's the table in database when i can exctract the "sponsor email" or "sponsor ID" for each user ?
(I don't see that in "wp_affiliatedate table" who's only listing affiliates, not the complete members list)

Or maybe you know the path or the way ( i don't know the good word in english lol) used by affiliates plugin to make a registration ? What is the way on database to create an account with them informations ?

I'm using :
1/ affiliates plugin on network activation
2/ Membership activated on main blog
3/ Prosite on network
4/ Membership and Prosite are activated on affiliate plugin
5/ Buddypress for registration on main blog

Finally, a good job for me will be to extract informations by the Database for each member like this :
alias (pseudonyme) or ID / email / sponsor ID or sponsor email /

Thank you if you can help me, and i hope my explanation is clear. :slight_smile:

Cheers,
Bertrand

  • Kimberly
    • Champion of Loops

    Hello Bertrand!

    Sounds like quite an operation you have going there :slight_smile:

    I will see about getting the developer to comment on this ticket as what you are asking for is custom coding work and beyond the scope of what we can provide here in a support ticket.

    Let's see if he has any advice to help you move along forward, it may take a bit longer than a normal support ticket but we can expect him in :slight_smile:

    Best,

    Kimberly

  • slife
    • Site Builder, Child of Zeus

    Hello Dear Kimberly,

    Thank you for your speed answer, once again :wink:

    Yes, i know this is not a "normal" operation i will do, and only the developer can asking to.

    I'm waiting for his answer, no problem....

    Thank you again Kimberly :slight_smile:

    Cheers,
    Bertrand

  • Barry
    • DEV MAN’s Mascot

    To do that, i need to extract members informations like email, user ID, ect... I know i can do that with the table "wp_signups", it's not a problem...

    Use wp_users instead, as that will have the most up to date information (including any changes a user makes) the signups table will only have the information that was entered at signup.

    What's the table in database when i can exctract the "sponsor email" or "sponsor ID" for each user

    It's dependent on the addon you are using for their signup. I notice that you mention you have both pro-sites and membership addons active. Which plugin are you using to signup your users? If you can let me know that, then I can point you in the right direction to get the referring user ids.

  • Barry
    • DEV MAN’s Mascot

    I'm not using membership to signup.

    Ok, can you deactivate the membership addon for the affiliate plugin then as you don't need it (I'm going based on this "4/ Membership and Prosite are activated on affiliate plugin"

    Is pro-sites recording something if an user don't open a Blog at signup ?

    Not sure what you mean here.

  • slife
    • Site Builder, Child of Zeus

    ok Barry, Membership addon is now deactivated on affiliate plugin.
    Only pro-sites (supporter) addon is activated and debug for my checks.
    What's next ? :wink:

    About Pro-sites, i mean if a member will signup without Blog. (just to be a member), will pro-sites recording something on his table in database ?
    I thought Prosite did a recording only at the opening of a blog, but i certainly wrong :wink:

  • Barry
    • DEV MAN’s Mascot

    Ok, to get the referrer for a user you need to look in the usermeta table.
    If you look for a record with the user_id of the user you are interested in and a meta_key of "affiliate_referred_by". The meta_value will be the id of the referrer.

    I thought Prosite did a recording only at the opening of a blog, but i certainly wrong :wink:

    In the affiliate plugin, it records the referrer against both the user and the blog they created, so you can track back to the referrer on both.

  • slife
    • Site Builder, Child of Zeus

    Yesss Barry !

    I did a check with a new subscription and have a look in the table :
    user id 819 / meta key affiliate_reffered_by / meta_value = 53

    ID 53 is the good information.

    Finally you give me the good issue :
    1/ I can extract user informations in wp_users
    2/ I can now extract affiate refferer information in wp_usermeta
    3/ I can finally coding my cron_job with that way

    You're great Barry, thank you a lot, all's OK now ! :slight_smile:

    Bertrand

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.