プロフィール・シングルページ

ユーザープロフィールに関するシングルページは concrete/single_pages/profile/ 以下にみつかります。それぞれのシングルページはそれぞれに異なるユーザープロフィールのセクションについて扱っています。これらのシングルページは、ルートディレクトリの同じ位置にコピーすることで、オーバーライドして拡張することができます。

下記にプロフィール・セクションのシングルページの一覧を示します。

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.

メンバー・シングルページ

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.

公開プロフィールにページを追加する

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クラス

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.

メソッド - UsersFriendsオブジェクト

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.


原文:Profile