Class: member
Source Location: /lib/member.inc.php
Class member
Inherited Properties, Constants, and Methods
Method Summary
| string |
avatar() |
Returns the HTML code to show a member's avatar. |
| long |
create() |
Creates a new account and returns the member ID for further processing. |
| string |
customFieldValue() |
Gets the value of a custom profile field for a given member. If $userID is ommitted, the last known member id is used. |
| bool |
delete() |
Deletes a Member. |
| mixed |
displayname2id() |
Gets the Member ID associated with a Display Name. |
| mixed |
email2id() |
Gets the Member ID associated with a Member Email. |
| array |
friendsList() |
Returns information on the current user's contacts. |
| array |
getList() |
Lists the board's members. |
| string |
icon() |
Returns a member's icon in HTML |
| mixed |
id2displayname() |
Gets the Member Display Name associated with a Member ID. |
| mixed |
id2name() |
Gets the Member Name associated with a Member ID. |
| array |
info() |
Grabs detailed information of a member. |
| bool |
isAdmin() |
Returns whether a member can access the board's Admin CP. |
| bool |
isLoggedIn() |
Returns whether a member is logged in. |
| bool |
isSuperMod() |
Returns whether a member is a super moderator. |
| array |
listCustomFields() |
Grab a list of custom profile fields, and their properties. |
| bool |
login() |
Login a user. |
| mixed |
name2id() |
Gets the Member ID associated with a Member Name. |
| int |
numNewPosts() |
Returns the number of new posts of the currently logged in member since its last visit. |
| string |
photo() |
Returns HTML code for member's photo. |
| int |
pips() |
Returns the amount of pips a member has. |
| string |
rawSig() |
Get member's sig in BBCode |
| bool |
updateSig() |
Update the current member's signature |
Methods
bool addFriend(
int
$userID
)
|
|
Adds a friend
Parameters:
|
int |
$userID: |
Member ID to be added |
API Tags:
| Return: | true on success, otherwise false |
| Access: | public |
Information Tags:
| Author: | Matthias Reuter |
| Since: | 2.0 |
| Sample: |
|
string avatar(
[
$member = false], int
$userID
)
|
|
Returns the HTML code to show a member's avatar.
Parameters:
|
int |
$userID: |
User ID. If $userID is ommited, the last known member id is used. |
|
|
$member: |
|
API Tags:
| Return: | HTML Code for member's avatar, or false on failure |
| Access: | public |
Information Tags:
long create(
string
$userName, string
$password, string
$email, [array
$customFields = array()], [boolean
$validate = false], [string
$displayName = ''], [
$useBanFilter = false]
)
|
|
Creates a new account and returns the member ID for further processing.
Parameters:
|
string |
$userName: |
Username |
|
string |
$password: |
In plain text. Will be encrypted with md5() |
|
string |
$email: |
Mail |
|
array |
$customFields: |
Optional values for the (existing) custom profile fields. |
|
boolean |
$validate: |
Whether to put the user in the validation group |
|
string |
$displayName: |
Display name |
|
|
$useBanFilter: |
|
API Tags:
| Return: | New Member ID or false on failure |
| Access: | public |
Information Tags:
string customFieldValue(
int
$fieldID, [int
$userID = false]
)
|
|
Gets the value of a custom profile field for a given member. If $userID is ommitted, the last known member id is used.
Parameters:
|
int |
$fieldID: |
Field ID (number) to retrieve. |
|
int |
$userID: |
Member ID to read the custom profile field from. |
API Tags:
| Return: | Value of memberid's custom profile field field-id |
| Access: | public |
Information Tags:
bool delete(
mixed
$userIDs, [string
$password = false]
)
|
|
Deletes a Member.
Parameters:
|
mixed |
$userIDs: |
Member(s) to be deleted. int for single member id, or array for a list of ids |
|
string |
$password: |
Plaintext password of currently logged in member for more security |
API Tags:
| Return: | true on success, false on failure |
| Access: | public |
Information Tags:
mixed displayname2id(
mixed
$names
)
|
|
Gets the Member ID associated with a Display Name.
Parameters:
|
mixed |
$names: |
Member Names. If you pass an array with names, the function also returns an array with each name beeing the key and the ID as its value. If a member name could not be found, the value will be set to false. |
API Tags:
| Return: | Single Member ID, assoc. array with id/name pairs, or false if the name(s) could not be found |
| Access: | public |
Information Tags:
mixed email2id(
mixed
$emails
)
|
|
Gets the Member ID associated with a Member Email.
Parameters:
|
mixed |
$emails: |
Member Emails. If you pass an array with emails, the function also returns an array with each email beeing the key and the ID as its value. If a member email could not be found, the value will be set to false. |
API Tags:
| Return: | Single Member ID, assoc. array with id/email pairs, or false if the email(s) could not be found |
| Access: | public |
Information Tags:
| Author: | Matthias Reuter |
| Since: | 2.0 |
| Sample: |
|
array friendsList(
[bool
$userID = false], [bool
$details = false], [bool
$unapproved = false]
)
|
|
Returns information on the current user's contacts.
Parameters:
|
bool |
$userID: |
Member-ID to get friends of this member. If not set, friends of currently logged in member will be listed. |
|
bool |
$details: |
Detailed Member Information, default: false |
|
bool |
$unapproved: |
List unapproved friends, default: false |
API Tags:
| Return: | Friends Informations |
| Access: | public |
Information Tags:
| Author: | Matthias Reuter |
| Since: | 2.0 |
| Sample: |
|
array getList(
[array
$options = array('order' => 'asc', 'start' => '0', 'limit' => '30', 'orderby' => 'name', 'group' => '*')]
)
|
|
Lists the board's members.
Parameters:
|
array |
$options: |
Overwrites default behaviour of SQL query. The following options can be used to overwrite the default query results. 'order' default: 'asc' 'start' default: '0' start with first record 'limit' default: '30' no. of members per page 'orderby' default: 'name' other keys see below 'group' default: '*' all groups. You can specifiy a number or list of numbers Sort keys: any field from ibf_members or ibf_groups. To avoid trouble ordering by a field 'xxx', use m.XXX or g.XXX as the full qualified fieldname, not just 'xxx'. |
API Tags:
| Return: | Members |
| Access: | public |
Information Tags:
string icon(
[
$userID = false], int
$ID
)
|
|
Returns a member's icon in HTML
Parameters:
|
int |
$ID: |
Member's ID |
|
|
$userID: |
|
API Tags:
| Return: | HTML for member's icon |
| Access: | public |
Information Tags:
mixed id2displayname(
mixed
$userIDs
)
|
|
Gets the Member Display Name associated with a Member ID.
Parameters:
|
mixed |
$userIDs: |
Member IDs. If you pass an array with IDs, the function also returns an array with each ID beeing the key and the member name as its value. If a member ID could not be found, the value will be set to false. |
API Tags:
| Return: | Single member name, assoc. array with name/id pairs, or false if the ID(s) could not be found |
| Access: | public |
Information Tags:
mixed id2name(
mixed
$userIDs
)
|
|
Gets the Member Name associated with a Member ID.
Parameters:
|
mixed |
$userIDs: |
Member Ids. If you pass an array with IDs, the function also returns an array with each ID beeing the key and the member name as its value. If a member ID could not be found, the value will be set to false. |
API Tags:
| Return: | Single member name, assoc. array with name/id pairs, or false if the ID(s) could not be found |
| Access: | public |
Information Tags:
array info(
[int
$userID = false]
)
|
|
Grabs detailed information of a member.
Parameters:
|
int |
$userID: |
User ID. If $userID is ommited, the last known member id is used. |
API Tags:
| Return: | Member Information, or false on failure |
| Access: | public |
Information Tags:
Redefinition of:
- ipbwi::info()
- informations about the current IPBWI and PHP installation
bool isAdmin(
[int
$userID = false]
)
|
|
Returns whether a member can access the board's Admin CP.
Parameters:
|
int |
$userID: |
User ID. If $userID is ommited, the last known member id is used. |
API Tags:
| Return: | Whether currently logged in member can access ACP |
| Access: | public |
Information Tags:
bool isLoggedIn(
[int
$userID = false]
)
|
|
Returns whether a member is logged in.
Parameters:
|
int |
$userID: |
User ID. If $userID is ommited, the last known member id is used. |
API Tags:
| Return: | Whether currently logged in member is a Super Moderator |
| Access: | public |
Information Tags:
bool isSuperMod(
[int
$userID = false]
)
|
|
Returns whether a member is a super moderator.
Parameters:
|
int |
$userID: |
User ID. If $userID is ommited, the last known member id is used. |
API Tags:
| Return: | Whether currently logged in member is a Super Moderator |
| Access: | public |
Information Tags:
array listCustomFields(
)
|
|
Grab a list of custom profile fields, and their properties.
API Tags:
| Return: | custom profile fields and properties, otherwise false |
| Access: | public |
Information Tags:
array listOnlineMembers(
[bool
$detailed = false], [bool
$formatted = false], [bool
$show_anon = false], [string
$order_by = 'running_time'], [string
$order = 'DESC'], [string
$separator = ', ']
)
|
|
Get an array of online members.
Parameters:
|
bool |
$detailed: |
if true, function returns multi-dimensional array containing the result of get_advinfo() for each member. Default false - simple list. |
|
bool |
$formatted: |
if true, function will return an html list (string) of display names, each linked to each member's personal profile. Default false - returns array. |
|
bool |
$show_anon: |
if true, function will ignore logged-in member's anonymity choice. Default false - normal board action. |
|
string |
$order_by: |
choose what to order the results by - choose from 'member_name', 'member_id', 'running_time', 'location'. Default "running_time". |
|
string |
$order: |
choose what order to order the results in. Options are ascending; 'ASC', or descending; 'DESC'. Default 'DESC'. |
|
string |
$separator: |
- if $formatted set to true, this string will go between each linked display name. Default ', '. |
API Tags:
| Return: | online member list |
| Access: | public |
Information Tags:
array listRandomMembers(
[int
$limit = 5], [string
$where = false]
)
|
|
Get an array of random members.
Parameters:
|
int |
$limit: |
How many Member should be returned? default: 5 |
|
string |
$where: |
For advanced requests: SQL-Statement to filter the output |
API Tags:
| Return: | Random Members |
| Access: | public |
Information Tags:
bool login(
string
$userName, string
$password, [integer
$cookie = true], [integer
$anon = false], [integer
$sticky = true]
)
|
|
Login a user.
Parameters:
|
string |
$userName: |
Member's Username |
|
string |
$password: |
Member's Password |
|
integer |
$cookie: |
Default: true=Use cookie to save login session, false=no cookies |
|
integer |
$anon: |
Default: false=Keep user anonymous on forums, true=keep anon. |
|
integer |
$sticky: |
Default: true='Remember Me' cookie, false=auto log off when session expires |
API Tags:
| Return: | true on success, otherwise false |
| Access: | public |
Information Tags:
| Author: | CTiga <crouchintiga@comcast.net> |
| Author: | Jan Ecker <info@Jan-Ecker.eu> |
| Author: | DigitalisAkujin |
| Author: | Matthias Reuter |
| Author: | Pita <peter@randomnity.com> |
| Author: | Cow <khlo@global-centre.com> |
| Since: | 2.0 |
| Sample: |
Important Cookie Settings of your Board These Settings should be choosed to make a login on your website possible: Cookie Domain: .your-domain.com Cookie Name Prefix: {blank} Cookie Path: {blank} If you want to get the login work on subdomains, you have to turn off "Create a stronghold auto-log in cookie" in your Cookie-Settings of your Board. This function sends http-headers, so you have to call it before any output is sent to the browser. |
Logout a user.
API Tags:
| Return: | true on success, otherwise false |
| Access: | public |
Information Tags:
mixed name2id(
mixed
$names
)
|
|
Gets the Member ID associated with a Member Name.
Parameters:
|
mixed |
$names: |
If you pass an array with names, the function also returns an array with each name beeing the key and the ID as its value. If a member name could not be found, the value will be set to false. |
API Tags:
| Return: | Single Member ID, assoc. array with id/name pairs, or false if the name(s) could not be found |
| Access: | public |
Information Tags:
Returns the number of new posts of the currently logged in member since its last visit.
API Tags:
| Return: | Number of posts since last visit |
| Access: | public |
Information Tags:
string photo(
[int
$userID = false], [bool
$thumb = false]
)
|
|
Returns HTML code for member's photo.
Parameters:
|
int |
$userID: |
User ID. If $userID is ommited, the last known member id is used. |
|
bool |
$thumb: |
true to activate thumbnail, otherwise false (default) |
API Tags:
| Return: | HTML code for member photo |
| Access: | public |
Information Tags:
int pips(
[int
$ID = false]
)
|
|
Returns the amount of pips a member has.
Parameters:
API Tags:
| Return: | Member Pips Count |
| Access: | public |
Information Tags:
string rawSig(
[int
$userID = false]
)
|
|
Get member's sig in BBCode
Parameters:
|
int |
$userID: |
Member ID to read the signature from. |
API Tags:
| Return: | Member Code in BBCode. |
| Access: | public |
Information Tags:
bool removeFriend(
int
$userID
)
|
|
Removes a friend
Parameters:
|
int |
$userID: |
Member ID to be deleted |
API Tags:
| Return: | true on success, otherwise false |
| Access: | public |
Information Tags:
| Author: | Matthias Reuter |
| Since: | 2.0 |
| Sample: |
|
bool updateAvatar(
[string
$fieldName = 'avatar_new'], [
$deleteAvatar = false]
)
|
|
Update current member's avatar.
Parameters:
|
string |
$fieldName: |
Name of the input upload field which contains avatar file |
|
|
$deleteAvatar: |
|
API Tags:
| Return: | true on success, otherwise false |
| Access: | public |
Information Tags:
| Author: | Matthias Reuter |
| Since: | 2.01 |
| Sample: |
|
bool updateCustomField(
int
$ID, string
$newValue, [bool
$bypassPerms = false], [bool
$memberID = false]
)
|
|
Updates the value of a custom profile field.
Parameters:
|
int |
$ID: |
Custom Profile field's ID |
|
string |
$newValue: |
New Value for the field |
|
bool |
$bypassPerms: |
Default: false=use board permissions to allow update, true=bypass permissions |
|
bool |
$memberID: |
Member ID where the custom profile field should be updated. If no ID is delivered, the currently logged in user will be updated. |
API Tags:
| Return: | true on success, otherwise false |
| Access: | public |
Information Tags:
bool updateMember(
[array
$update = array()], [int
$userID = false], [int
$bypassPerms = false]
)
|
|
Update properties of a member's record.
Parameters:
|
array |
$update: |
Associative array with fieldnames and values to update The following fields can be used in the $update array: - members_display_name
- avatar_location
- avatar_type
- avatar_size
- aim_name
- icq_number
- location
- signature
- website
- yahoo
- interests
- msnname
- integ_msg
- title
- allow_admin_mails
- hide_email
- email_pm
- skin
- language
- view_sigs
- view_img
- view_avs
- view_pop
- bday_day
- bday_month
- bday_year
- dst_in_use
- email
- pp_member_id
- pp_profile_update
- pp_bio_content
- pp_last_visitors
- pp_comment_count
- pp_rating_hits
- pp_rating_value
- pp_rating_real
- pp_friend_count
- pp_main_photo
- pp_main_width
- pp_main_height
- pp_thumb_photo
- pp_thumb_width
- pp_thumb_height
- pp_gender
- pp_setting_notify_comments
- pp_setting_notify_friend
- pp_setting_moderate_comments
- pp_setting_moderate_friends
- pp_setting_count_friends
- pp_setting_count_comments
- pp_setting_count_visitors
- pp_profile_views
|
|
int |
$userID: |
The Member ID to update |
|
int |
$bypassPerms: |
Default: false=use board permissions to allow update, true=bypass permissions |
API Tags:
| Return: | true on success, otherwise false |
| Access: | public |
Information Tags:
bool updatePassword(
string
$newPass, [string
$userID = false], [string
$currentPass = false]
)
|
|
Changes a user's password.
Parameters:
|
string |
$newPass: |
The new Member's password |
|
string |
$userID: |
The Member's ID. If not set, the currently logged in member will be updated. |
|
string |
$currentPass: |
Current password check for more security |
API Tags:
| Return: | true on success, otherwise false |
| Access: | public |
Information Tags:
bool updatePhoto(
[
$fieldName = false], [
$deletePhoto = false]
)
|
|
Update current member's photograph.
Parameters:
|
|
$fieldName: |
|
|
|
$deletePhoto: |
|
API Tags:
| Return: | true on success, otherwise false |
| Access: | public |
Information Tags:
bool updateSig(
string
$newSig
)
|
|
Update the current member's signature
Parameters:
|
string |
$newSig: |
New signature text. HTML allowed as per board settings. |
API Tags:
| Return: | true on success, otherwise false |
| Access: | public |
Information Tags:
|
|