member
[ class tree: member ] [ index: member ] [ all elements ]

Class: ipbwi_member

Source Location: /ipbwi/lib/member.inc.php

Class Overview

ipbwi
   |
   --ipbwi_member



Author(s):

  • Matthias Reuter ($LastChangedBy: matthias $)

Version:

  • $LastChangedDate: 2009-08-26 19:19:41 +0200 (Mi, 26 Aug 2009) $

Copyright:

  • 2007-2010 IPBWI development team

Variables

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: ipbwi

ipbwi::addSystemMessage()
adds a system message
ipbwi::date()
Returns textual/timestamp offsetted date by board and by member offset and DST setting.
ipbwi::getBoardVar()
gets the requested board-var
ipbwi::getLibLang()
gets the language-var from actual requested native language-bit
ipbwi::makeSafe()
filtering html-strings, e.g. for db-queries
ipbwi::printSystemMessages()
prints system messages
ipbwi::properXHTML()
filtering HTML strings
ipbwi::setLang()
Set's current SDK language
ipbwi::sysInfo()
informations about the current IPBWI and PHP installation
ipbwi::__destruct()

Class Details

[line 11]


Tags:

author:  Matthias Reuter ($LastChangedBy: matthias $)
version:  $LastChangedDate: 2009-08-26 19:19:41 +0200 (Mi, 26 Aug 2009) $
copyright:  2007-2010 IPBWI development team
link:  http://ipbwi.com/examples/member.php
since:  2.0
license:  GNU General Public License


[ Top ]


Class Variables

$myInfo =  null

[line 14]



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


method addFriend [line 1323]

bool addFriend( int $userID)

Adds a friend



Tags:

return:  true on success, otherwise false
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->addFriend(55);
access:  public


Parameters:

int   $userID   Member ID to be added

[ Top ]

method avatar [line 149]

string avatar( [int $userID = false])

Returns the HTML code to show a member's avatar.



Tags:

return:  HTML Code for member's avatar, or false on failure
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->avatar(5);
access:  public


Parameters:

int   $userID   User ID. If $userID is ommited, the last known member id is used.

[ Top ]

method create [line 362]

long create( string $userName, string $password, string $email, [array $customFields = array()], [boolean $validate = false], [string $displayName = false], [boolean $allowAdminMail = true], [boolean $allowMemberMail = false], [boolean $captchaCheck = false])

Creates a new account and returns the member ID for further processing.



Tags:

return:  New Member ID or false on failure
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->create('name''password''email@foo.com');
  2.  $ipbwi->member->create('name''password''email@foo.com'array('field_1' => 'content of field 1''field_2' => 'content of field 2')true'displayname'true);
access:  public


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   possible values: user, admin, admin_user, default: board settings
string   $displayName   Display name, default: false (username = displayname)
boolean   $allowAdminMail   Whether to allow emails from admins, default: true
boolean   $allowMemberMail   Whether to allow emails from other members, default: false
boolean   $captchaCheck   Decide if you want to protect registrations through captcha check. You have to use methods of antispam-class if you have captcha check enabled. Possible values: none, default (GD based), recaptcha. standard settings: board settings

[ Top ]

method customFieldValue [line 870]

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.



Tags:

return:  Value of memberid's custom profile field field-id
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->customFieldValue(3,55);
access:  public


Parameters:

int   $fieldID   Field ID (number) to retrieve.
int   $userID   Member ID to read the custom profile field from.

[ Top ]

method delete [line 416]

bool delete( [mixed $userIDs = false], [string $password = false])

Deletes a Member.



Tags:

return:  true on success, false on failure
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->delete(55);
  2.  $ipbwi->member->delete(array(55,22,77));
access:  public


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

[ Top ]

method displayname2id [line 258]

mixed displayname2id( mixed $names)

Gets the Member ID associated with a Display Name.



Tags:

return:  Single Member ID, assoc. array with id/name pairs, or false if the name(s) could not be found
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->displayname2id('displayname');
  2.  $ipbwi->member->displayname2id(array('displayname2','displayname2','displayname3'));
access:  public


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.

[ Top ]

method email2id [line 322]

mixed email2id( mixed $emails)

Gets the Member ID associated with a Member Email.



Tags:

return:  Single Member ID, assoc. array with id/email pairs, or false if the email(s) could not be found
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->email2id('email');
  2.  $ipbwi->member->email2id(array('email1','email2','email3'));
access:  public


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.

[ Top ]

method friendsList [line 1364]

array friendsList( [bool $userID = false], [bool $details = false], [bool $unapproved = false])

Returns information on the current user's contacts.



Tags:

return:  Friends Informations
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->friendsList();
  2.  $ipbwi->member->friendsList(55,true,true);
access:  public


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

[ Top ]

method getList [line 1095]

array getList( [array $options = array('order' => 'asc', 'start' => '0', 'limit' => '30', 'orderby' => 'name', 'group' => '*', 'extra_groups' => false)])

Lists the board's members.



Tags:

return:  Members
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->getList();
  2.  $ipbwi->member->getList(array('order' => 'asc''start' => '0''limit' => '30''orderby' => 'name''group' => '*'));
access:  public


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
'extra_groups' default: false no extra groups. Turn to true to get extra-groups, too.

Sort keys: any field from '.$this->ipbwi->board['sql_tbl_prefix'].'members or '.$this->ipbwi->board['sql_tbl_prefix'].'groups. To avoid trouble ordering by a field 'xxx', use m.XXX or g.XXX as the full qualified fieldname, not just 'xxx'.


[ Top ]

method icon [line 970]

string icon( [ $userID = false], int $ID)

Returns a member's icon in HTML



Tags:

return:  HTML for member's icon
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->icon(55);
access:  public


Parameters:

int   $ID   Member's ID
   $userID  

[ Top ]

method id2displayname [line 290]

mixed id2displayname( mixed $userIDs)

Gets the Member Display Name associated with a Member ID.



Tags:

return:  Single member name, assoc. array with name/id pairs, or false if the ID(s) could not be found
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->id2displayname(55);
  2.  $ipbwi->member->id2displayname(55,77,99));
access:  public


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.

[ Top ]

method id2name [line 226]

mixed id2name( mixed $userIDs)

Gets the Member Name associated with a Member ID.



Tags:

return:  Single member name, assoc. array with name/id pairs, or false if the ID(s) could not be found
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->id2name(55);
  2.  $ipbwi->member->id2name(array(55,22,77));
access:  public


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.

[ Top ]

method info [line 95]

array info( [int $userID = false])

Grabs detailed information of a member.



Tags:

return:  Member Information, or false on failure
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->info(5);
access:  public


Parameters:

int   $userID   User ID. If $userID is ommited, the last known member id is used.

[ Top ]

method isAdmin [line 45]

bool isAdmin( [int $userID = false])

Returns whether a member can access the board's Admin CP.



Tags:

return:  Whether currently logged in member can access ACP
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->isAdmin(5);
access:  public


Parameters:

int   $userID   User ID. If $userID is ommited, the last known member id is used.

[ Top ]

method isLoggedIn [line 73]

bool isLoggedIn( [int $userID = false])

Returns whether a member is logged in.



Tags:

return:  Whether currently logged in member is a Super Moderator
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->isLoggedIn(5);
access:  public


Parameters:

int   $userID   User ID. If $userID is ommited, the last known member id is used.

[ Top ]

method isSuperMod [line 59]

bool isSuperMod( [int $userID = false])

Returns whether a member is a super moderator.



Tags:

return:  Whether currently logged in member is a Super Moderator
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->isSuperMod(5);
access:  public


Parameters:

int   $userID   User ID. If $userID is ommited, the last known member id is used.

[ Top ]

method listCustomFields [line 429]

array listCustomFields( )

Grab a list of custom profile fields, and their properties.



Tags:

return:  custom profile fields and properties, otherwise false
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->listCustomFields();
access:  public


[ Top ]

method listOnlineMembers [line 1152]

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.



Tags:

return:  online member list
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->listOnlineMembers();
  2.  $ipbwi->member->listOnlineMembers(true,true,true,'member_name','ASC',' - ');
access:  public


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 ', '.

[ Top ]

method listRandomMembers [line 1275]

array listRandomMembers( [int $limit = 5], [string $where = false])

Get an array of random members.



Tags:

return:  Random Members
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->listRandomMembers();
  2.  $ipbwi->member->listRandomMembers(5,'posts!=0 AND me.avatar_location != "" AND me.avatar_location != "noavatar"');
access:  public


Parameters:

int   $limit   How many Member should be returned? default: 5
string   $where   For advanced requests: SQL-Statement to filter the output

[ Top ]

method login [line 1027]

bool login( [ $user = false], [ $pw = false], [integer $cookie = true], [integer $anon = false], string $userName, string $password)

Login a user.



Tags:

return:  true on success, otherwise false
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->login(55,'password');
  2.  $ipbwi->member->login(55,'password',true,false,true);
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.
access:  public


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.
   $user  
   $pw  

[ Top ]

method logout [line 1063]

bool logout( )

Logout a user.



Tags:

return:  true on success, otherwise false
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->logout();
access:  public


[ Top ]

method name2id [line 194]

mixed name2id( mixed $names)

Gets the Member ID associated with a Member Name.



Tags:

return:  Single Member ID, assoc. array with id/name pairs, or false if the name(s) could not be found
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->name2id('name');
  2.  $ipbwi->member->name2id(array('name1','name2'));
access:  public


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.

[ Top ]

method numNewPosts [line 919]

int numNewPosts( )

Returns the number of new posts of the currently logged in member since its last visit.



Tags:

return:  Number of posts since last visit
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->numNewPosts();
access:  public


[ Top ]

method photo [line 168]

string photo( [int $userID = false], [bool $thumb = false])

Returns HTML code for member's photo.



Tags:

return:  HTML code for member photo
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->photo(5,true);
access:  public


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)

[ Top ]

method pips [line 942]

int pips( [int $ID = false])

Returns the amount of pips a member has.



Tags:

return:  Member Pips Count
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->pips(55);
access:  public


Parameters:

int   $ID   Member's ID

[ Top ]

method rawSig [line 894]

string rawSig( [int $userID = false])

Get member's sig in BBCode



Tags:

return:  Member Code in BBCode.
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->rawSig(55);
access:  public


Parameters:

int   $userID   Member ID to read the signature from.

[ Top ]

method removeFriend [line 1297]

bool removeFriend( int $userID)

Removes a friend



Tags:

return:  true on success, otherwise false
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->removeFriend(55);
access:  public


Parameters:

int   $userID   Member ID to be deleted

[ Top ]

method updateAvatar [line 729]

bool updateAvatar( [string $fieldName = 'avatar_new'], [ $deleteAvatar = false])

Update current member's avatar.



Tags:

return:  true on success, otherwise false
author:  Matthias Reuter
since:  2.01
sample:  
  1.  $ipbwi->member->updateAvatar()// use standard upload field name ('avatar_new')
  2.  $ipbwi->member->updateAvatar('input_field_name')// set upload field name
  3.  $ipbwi->member->updateAvatar(false,true)// delete the avatar
access:  public


Parameters:

string   $fieldName   Name of the input upload field which contains avatar file
   $deleteAvatar  

[ Top ]

method updateCustomField [line 652]

bool updateCustomField( int $ID, string $newValue, [bool $bypassPerms = false], [bool $memberID = false])

Updates the value of a custom profile field.



Tags:

return:  true on success, otherwise false
author:  Matthias Reuter (make it possible to update other member custom pfields) <public@pc-intern.com> http://pc-intern.com | http://straightvisions.com
since:  2.0
sample:  
  1.  $ipbwi->member->updateCustomField(2,'new value);
  2.  $ipbwi->member->updateCustomField(1,'new value,true,55);
access:  public


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.

[ Top ]

method updateMember [line 513]

bool updateMember( [array $update = array()], [int $userID = false], [int $bypassPerms = false])

Update properties of a member's record.



Tags:

return:  true on success, otherwise false
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->updateMember(array('website' => 'http://ipbwi.com''title' => 'mytitle'));
  2.  $ipbwi->member->updateMember(array('website' => 'http://ipbwi.com')55true);
access:  public


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

[ Top ]

method updatePassword [line 613]

bool updatePassword( string $newPass, [string $userID = false], [string $currentPass = false])

Changes a user's password.



Tags:

return:  true on success, otherwise false
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->updatePassword('new password');
  2.  $ipbwi->member->updatePassword('new password',55,'old password');
access:  public


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

[ Top ]

method updatePhoto [line 791]

bool updatePhoto( [ $fieldName = false], [ $deletePhoto = false])

Update current member's photograph.



Tags:

return:  true on success, otherwise false
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->updatePhoto()// use standard upload field name ('upload_photo')
  2.  $ipbwi->member->updatePhoto('photo_new')// set upload field name
  3.  $ipbwi->member->updatePhoto(false,true)// delete the photo
access:  public


Parameters:

   $fieldName  
   $deletePhoto  

[ Top ]

method updateSig [line 697]

bool updateSig( string $newSig)

Update the current member's signature



Tags:

return:  true on success, otherwise false
author:  Matthias Reuter
since:  2.0
sample:  
  1.  $ipbwi->member->updateSig('[b]my sig[/b]');
access:  public


Parameters:

string   $newSig   New signature text. HTML allowed as per board settings.

[ Top ]


Documentation generated on Sat, 23 Oct 2010 23:35:59 +0200 by phpDocumentor 1.4.3