本文整理汇总了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();
}