The MU forums have moved to WordPress.org

i have an api plugin that works in WP, but not MU (6 posts)

  1. majakat
    Member
    Posted 14 years ago #

    can anyone help me? it is api for wordpress to infusionsoft =

    i know the field users needs to be signups - but there is something else not working - if you are willing or can help please let me know!

    catheine@snapstart.com

  2. majakat
    Member
    Posted 14 years ago #

    this is the code - see, i switched it to signups - but i think the problem is it is calling the fiels 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;
  3. tmoorewp
    Member
    Posted 14 years ago #

    You can fetch the username and then use the following to get the ID:

    $user_id = get_userdatabylogin( $username );

  4. majakat
    Member
    Posted 14 years ago #

    like this?

    $theuser = $wpdb->get_row("SELECT * FROM {$wpdb->signups} WHERE user_login='{$username}'");
        $email = $theuser->user_email;
    	$user_id = get_userdatabylogin( $username );
        $wp_user_num_id = $user_id;
  5. tmoorewp
    Member
    Posted 14 years ago #

    That should work.

  6. majakat
    Member
    Posted 14 years ago #

    No luck, there are 2 sections of code written specifically for wordpress and and not mu - anyone other ideas on how i can rewrite them for mu?

    if ($_REQUEST['user_id'] != "" && $_REQUEST['user_id'] != NULL){
        $being_updated = 1;
        $theuser = $wpdb->get_row("SELECT * FROM {$wpdb->users} WHERE ID='{$_REQUEST['user_id']}'");
        $original_email = $theuser->user_email;
      }

    AND

    $theuser = $wpdb->get_row("SELECT * FROM {$wpdb->users} 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;

About this Topic