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.

Recent Discussions on this Topic

Public Profile

Is there a way to allow each registered user to choose whether or not they are listed in the public profile pages? I guess it would also make them not searchable in that same area... Basically the idea is that if you WANT to interact with other members…

Profile page links error: "Page Not Found"

I'm trying to activate the profile pages for registered users but keep getting "Page Not Found" when accessing the pages below. URL link from the User Info add-on: my_site.com/index.php/profile/1/ URL link from the Members page: my_site.com/index.ph…

Redirect user to Profile page after submitting edits?

I've searched the forums looking for a method to accomplish this. It doesn't make much sense to just hang on the edit page after submitting the Edit form. I'd like to return the user to their profile page so they can view their displayed profile.

Add Publicly Viewable page in Profile

Hi! I'll just state the problem, keep in mind that I'm not a PHP developer. I'm creating a social network for web designers Base93.tk I need to add a page so designers can showcase their work, to do so, I added an image attribute to the editable are…