本文整理汇总了PHP中KunenaAttachmentHelper::getByUserid方法的典型用法代码示例。如果您正苦于以下问题:PHP KunenaAttachmentHelper::getByUserid方法的具体用法?PHP KunenaAttachmentHelper::getByUserid怎么用?PHP KunenaAttachmentHelper::getByUserid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KunenaAttachmentHelper
的用法示例。
在下文中一共展示了KunenaAttachmentHelper::getByUserid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: before
/**
* Prepare user attachments list.
*
* @return void
*/
protected function before()
{
parent::before();
$userid = $this->input->getInt('userid');
$params = array('file' => '1', 'image' => '1', 'orderby' => 'desc', 'limit' => '30');
$this->template = KunenaFactory::getTemplate();
$this->me = KunenaUserHelper::getMyself();
$this->profile = KunenaUserHelper::get($userid);
$this->attachments = KunenaAttachmentHelper::getByUserid($this->profile, $params);
// Pre-load messages.
$messageIds = array();
foreach ($this->attachments as $attachment)
{
$messageIds[] = (int) $attachment->mesid;
}
$messages = KunenaForumMessageHelper::getMessages($messageIds, 'none');
// Pre-load topics.
$topicIds = array();
foreach ($messages as $message)
{
$topicIds[] = $message->thread;
}
KunenaForumTopicHelper::getTopics($topicIds, 'none');
$this->headerText = JText::_('COM_KUNENA_MANAGE_ATTACHMENTS');
}
示例2: canManageAttachments
/**
* @return bool
*/
function canManageAttachments()
{
if ($this->config->show_imgfiles_manage_profile) {
$params = array('file' => '1', 'image' => '1', 'orderby' => 'desc', 'limit' => '30');
$this->userattachs = KunenaAttachmentHelper::getByUserid($this->profile, $params);
if ($this->userattachs) {
if ($this->me->isModerator() || $this->profile->userid == $this->me->userid) {
return true;
} else {
return false;
}
} else {
return false;
}
}
return false;
}