This is the documentation for concrete5 version 5.6 and earlier. View Current Documentation

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

controllers/profile/controller.php, single_pages/profile/view.php

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.

controllers/messages.php, single_pages/messages.php

This single page shows all private messages available to a user.

controllers/friends.php, single_pages/friends.php

This single page shows the users friends, as they've been added through the site.

controllers/edit.php, single_pages/edit.php

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.

controllers/avatar.php, single_pages/avatar.php

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.

Profile Elements

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.

Profile Classes

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.

$dpm->getMessageStatus()

Returns a text status of the message.

$dpm->markAsRead()

Mark a message as read.

$dpm->getMessageAuthorID()

Returns the User ID of the message's author.

$dpm->getMessageID()

Returns the ID of the private message.

$dpm->getMessageUserID()

Returns the user ID of the user who owns the message.

$dpm->getMessageAuthorObject()

Returns the UserInfo object of the User who authored the message.

$dpm->getMessageRelevantUserID()

If the current mailbox is the "to" mailbox, returns the user the message was sent to. Otherwise, returns the author user ID.

$dpm->getMessageRelevantUserObject()

Runs the above function but returns the object instead of the user ID.

$dpm->getMessageRelevantUserName()

Runs the above function but returns the username instead of the user ID or object.

$dpm->getMessageAuthorName()

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.

$dpm->delete()

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.

Loading Conversation