Skip to:
Content
Pages
Categories
Search
Top
Bottom

can anyone help with this code?

  • Avatar of Catherine
    Catherine
    Participant

    @snapstart

    this is to tie my mu/buddy press install into my infusionsoft program, this api plugin with the standard wp – but since mu uses different tables for users, it isnt working – i did change the users to signups here in this code, but ..

    this is the code – see, i switched it to signups – but i think the problem is it is calling the field ID, and there is no field ID in the signups table – anyone have suggestions?

    $infusion_tag_id_value = get_option( 'tag_id' );

    $theuser = $wpdb->get_row("SELECT * FROM {$wpdb->signups} WHERE user_login='{$username}'");
    $email = $theuser->user_email;
    $wp_user_num_id = $theuser->ID;

    $usermeta = $wpdb->get_row("SELECT * FROM {$wpdb->usermeta} WHERE user_id='{$wp_user_num_id}' AND meta_key='wp_user_level'");
    $wp_user_level = $usermeta->meta_value;

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of buzz2050
    buzz2050
    Participant

    @buzz2050

    Hi,

    This is my first time with BP, just started off.. so pardon me in case I don’t understand your query correctly.

    I suppose, since you are using the field user_login as your where clause, you can either use signups or users table to get the user_email field. However, only users has the field ID, signups doesn’t, so aren’t you better off using users ?

    I guess since you want to tie up wpmu/bp to your plugin, so this might work:

    SELECT distinct(u.ID), u.user_email FROM {$wpdb->users} u

    LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id

    WHERE u.user_login=’{$username}’

    Thanks,

    Sib

    Avatar of Catherine
    Catherine
    Participant

    @snapstart

    this api takes new registrations and sends them to my infusionsoft database =

    all new users are written to the signups table, not the users table – that is where my problem is , thank you tho for the thoughts!

    Avatar of John James Jacoby
    John James Jacoby
    Keymaster

    @johnjamesjacoby

    @Catherine:

    Are you trying to track sign-ups, or activations?

    Until a user activates their account, they won’t have any data in the user_meta because technically they don’t have a user account yet, just a sign-up. If you look at the signup table, there is a column called “meta” which stores the signup info until they activate themselves.

    Once their account is activated, the activation moves their data from that column to the users table…

    Avatar of apoorv_moghey
    apoorv_moghey
    Participant

    @apoorv_moghey

    according to me.user meta table filled when user account activated.if u want to fetch user meta value use user_login and unserilized meta.which is an array

    .then do what u want to do the control is in ur hand.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.