Profile API
Simple:Press makes member profile data available through a simple function call that returns an array. This array is described below.
To use the Profile API, you will need to know the WordPress User ID of the member being interrogated.
Loading The Profile Array
The following code will first determine the current user’s ID and will then create an array of that user’s profile data:
global $current_user; $userid = $current_user->ID; $profile = array(); $profile = sfc_get_profile_data( $userid );
Using The Profile Data
The table below describes the available array elements and their contents. To display a value and assuming the variable names above, the following code fragment shows the syntax required:
echo $profile['display_name']; if( isset( $profile['location'] )) echo $profile['location'];
The following table describes the available profile data elements:
| Element Name | Data Description |
|---|---|
| ID | The member's Wordpress User ID |
| user_login | The login name of the member |
| display_name | The member's display name used in all Simple_Press dispays |
| user_email | The member's email address |
| user_url | The member's website address if recorded |
| user_registered | A php datetime stamp of the original registration date of member |
| description | A short, biographical note supplied by the member |
| signature | The text component of the members signature |
| sigimage | URL to the member's signature image |
| location | The member's location |
| first_name | The member's first given name |
| last_name | The member's surname |
| photos | An array of the member's profile photograph URLs |
| pm | Set to true (1) if this member can use the Private message system |
| moderator | Set to true (1) if this member is a moderator |
| avatar | An array containing the member's avatar information - 'uploaded' contains the name of an uploaded avatar |
| posts | How many forum posts a member has made |
| feedkey | The member's RSS Feed Key string |
| aim | Member's aim ID |
| yahoo | Member's yahoo ID |
| jabber | Member's jabber-google ID |
| icq | Member's icq ID |
| msn | Member's msn ID |
| skype | Member's skype ID |
| Member's facebook ID | |
| myspace | Members myspace ID |
| Members twitter ID |
