Profile Single Pages
The User Profile section is a section of Single Pages found in concrete/single_pages/profile/. Each single page deals with a different section of the user profile. All of these single pages can be extended or overridden by copying them to the same location in the root web directory.
Here is a list of what each single page in the profile section accomplishes
This single page is responsible for rendering the profile to all users. It also displays all user attributes that have been marked as viewable on the user's profile.
This single page shows all private messages available to a user.
This single page shows the users friends, as they've been added through the site.
This single page handles editing of the user's profile .It also displays all user attributes that have been marked as editable in the user's profile.
This single page lets the user upload an avatar image and crop it.
Members Single Pages
The members search interface, if public profiles are enabled, is available at single_pages/members.php (with the controller residing at controllers/members.php). This page takes care of public member search.
The elements/profile/sidebar.php element handles the sidebar of each profile page.
Adding a Page to the Public Profile
You may add pages to the user profile section simply by adding them below the "profile/" page in the site. You can even add these through packages. The member sidebar dynamically displays these pages.
There are two classes that are used with UserInfo objects only if the site has enabled public profiles. These are private messages and the UserFriends class.
Methods - UserPrivateMessage Object
$dpm = UserPrivateMessage::getByID($discussionPrivateMessageID)
Returns UserPrivateMessage object for an ID.
Returns a text status of the message.
Mark a message as read.
Returns the User ID of the message's author.
Returns the ID of the private message.
Returns the user ID of the user who owns the message.
Returns the UserInfo object of the User who authored the message.
If the current mailbox is the "to" mailbox, returns the user the message was sent to. Otherwise, returns the author user ID.
Runs the above function but returns the object instead of the user ID.
Runs the above function but returns the username instead of the user ID or object.
Returns a message's author username.
$dpm->getMessageDateAdded($type = 'system', $mask = false)
Returns the date a message as added. Pass the date mask in the PHP date() format, if desired. If user timezones are enabled, 'user' can be substituted for 'system'.
$body = $dpm->getFormattedMessageBody()
Responsible for converting line breaks to br tags, perhaps running bbcode, as well as making the older replied-to messages gray.
Deletes a private message.
Methods - UsersFriends Object
static getUsersFriendsData($userID, $sortBy = 'uf.uDateAdded desc')
Retrieves an associative array of UsersFriends data from the UsersFriends table, ordering by the $sortBy column.
static isFriend($friendUserID, $userID)
Checks to see if the user corresponding to $friendUserID is a friend to $userID.
static addFriend($friendUserID, $userID, $status = '')
Adds a user as a friend to another user.
static removeFriend($friendUserID, $userID)
Removes a user as a friend from another user.