本文整理匯總了PHP中Attachments::getSortedAttachments方法的典型用法代碼示例。如果您正苦於以下問題:PHP Attachments::getSortedAttachments方法的具體用法?PHP Attachments::getSortedAttachments怎麽用?PHP Attachments::getSortedAttachments使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Attachments
的用法示例。
在下文中一共展示了Attachments::getSortedAttachments方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: show
/**
* @see Page::show()
*/
public function show()
{
// check permission
if (!WCF::getUser()->getPermission('user.wantedPoster.canViewWantedPoster')) {
require_once WCF_DIR . 'lib/system/exception/PermissionDeniedException.class.php';
throw new PermissionDeniedException();
} else {
if ($this->user->ignoredUser) {
require_once WCF_DIR . 'lib/system/exception/NamedUserException.class.php';
throw new NamedUserException(WCF::getLanguage()->get('wcf.user.profile.error.ignoredUser', array('$username' => StringUtil::encodeHTML($this->user->username))));
}
}
if (WCF::getUser()->getPermission('user.wantedPoster.canViewMembersListTab') && WCF::getUser()->getPermission('user.membersList.canView')) {
HeaderMenu::setActiveMenuItem('wcf.header.menu.memberslist');
} else {
if (WCF::getUser()->getPermission('user.wantedPoster.canViewHeaderMenu')) {
HeaderMenu::setActiveMenuItem('wcf.header.menu.userWantedPoster');
}
}
require_once WCF_DIR . 'lib/page/util/menu/UserProfileMenu.class.php';
UserProfileMenu::getInstance()->userID = $this->userID;
UserProfileMenu::getInstance()->setActiveMenuItem('wcf.user.profile.menu.link.wantedPoster');
// get attachments
require_once WCF_DIR . 'lib/data/message/attachment/Attachments.class.php';
$attachments = new Attachments($this->userID, 'wantedPoster');
$this->attachmentList = $attachments->getSortedAttachments();
require_once WCF_DIR . 'lib/data/message/bbcode/AttachmentBBCode.class.php';
AttachmentBBCode::setAttachments($this->attachmentList);
parent::show();
}