当前位置: 首页>>代码示例>>PHP>>正文


PHP KunenaAttachmentHelper::getByUserid方法代码示例

本文整理汇总了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');
	}
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:39,代码来源:display.php

示例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;
 }
开发者ID:Ruud68,项目名称:Kunena-Forum,代码行数:20,代码来源:view.html.php


注:本文中的KunenaAttachmentHelper::getByUserid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。