Changeset 1233 for trunk/bp-xprofile/bp-xprofile-classes.php
- Timestamp:
- 03/18/2009 11:10:49 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/bp-xprofile/bp-xprofile-classes.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-classes.php
r1230 r1233 989 989 990 990 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; 995 992 996 993 $sql = $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $field_id, $user_id ); … … 1006 1003 1007 1004 function exists() { 1008 global $wpdb, $ userdata, $bp;1005 global $wpdb, $bp; 1009 1006 1010 1007 // 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 ); 1012 1009 1013 1010 if ( !$wpdb->get_row($sql) ) … … 1030 1027 1031 1028 function save() { 1032 global $wpdb, $ userdata, $bp;1029 global $wpdb, $bp; 1033 1030 1034 1031 $this->last_updated = date( 'Y-m-d H:i:s' ); … … 1048 1045 1049 1046 // 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 ); 1051 1048 1052 1049 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)