Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/18/2009 11:10:49 AM (18 years ago)
Author:
apeatling
Message:

Removing references to $userdata and replacing with passed user_id.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-classes.php

    r1230 r1233  
    989989
    990990        function populate( $field_id, $user_id )  {
    991                 global $wpdb, $userdata, $bp;
    992                
    993                 if ( is_null($user_id) )
    994                         $user_id = $userdata->ID;
     991                global $wpdb, $bp;
    995992               
    996993                $sql = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $field_id, $user_id );
    … …  
    10061003       
    10071004        function exists() {
    1008                 global $wpdb, $userdata, $bp;
     1005                global $wpdb, $bp;
    10091006               
    10101007                // check to see if there is data already for the user.
    1011                 $sql = $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_data} WHERE user_id = %d AND field_id = %d", $userdata->ID, $this->field_id );
     1008                $sql = $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_data} WHERE user_id = %d AND field_id = %d", $this->user_id, $this->field_id );
    10121009
    10131010                if ( !$wpdb->get_row($sql) )
    … …  
    10301027
    10311028        function save() {
    1032                 global $wpdb, $userdata, $bp;
     1029                global $wpdb, $bp;
    10331030               
    10341031                $this->last_updated = date( 'Y-m-d H:i:s' );
    … …  
    10481045
    10491046                        // Updated last site activity for this user.
    1050                         update_usermeta( $userdata->ID, 'last_activity', $this->last_updated );
     1047                        update_usermeta( $this->user_id, 'last_activity', $this->last_updated );
    10511048                       
    10521049                        return true;
Note: See TracChangeset for help on using the changeset viewer.