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


PHP KunenaForumCategoryHelper::getLatestSubscriptions方法代码示例

本文整理汇总了PHP中KunenaForumCategoryHelper::getLatestSubscriptions方法的典型用法代码示例。如果您正苦于以下问题:PHP KunenaForumCategoryHelper::getLatestSubscriptions方法的具体用法?PHP KunenaForumCategoryHelper::getLatestSubscriptions怎么用?PHP KunenaForumCategoryHelper::getLatestSubscriptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KunenaForumCategoryHelper的用法示例。


在下文中一共展示了KunenaForumCategoryHelper::getLatestSubscriptions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getLastestCategories

	public function getLastestCategories() {
		if ( $this->items === false ) {
			$this->items = array();
			$user = KunenaFactory::getUser();
			list($total,$categories) = KunenaForumCategoryHelper::getLatestSubscriptions($user->userid);
			$this->items = $categories;
		}
		return $this->items;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:9,代码来源:category.php

示例2: before

 /**
  * Prepare category subscriptions display.
  *
  * @return void
  *
  * @throws KunenaExceptionAuthorise
  */
 protected function before()
 {
     parent::before();
     $me = KunenaUserHelper::getMyself();
     if (!$me->exists()) {
         throw new KunenaExceptionAuthorise(JText::_('COM_KUNENA_NO_ACCESS'), 401);
     }
     $limit = $this->input->getInt('limit', 0);
     if ($limit < 1 || $limit > 100) {
         $limit = 20;
     }
     $limitstart = $this->input->getInt('limitstart', 0);
     if ($limitstart < 0) {
         $limitstart = 0;
     }
     list($total, $this->categories) = KunenaForumCategoryHelper::getLatestSubscriptions($me->userid);
     $topicIds = array();
     $userIds = array();
     $postIds = array();
     foreach ($this->categories as $category) {
         // Get list of topics.
         if ($category->last_topic_id) {
             $topicIds[$category->last_topic_id] = $category->last_topic_id;
         }
     }
     // Pre-fetch topics (also display unauthorized topics as they are in allowed categories).
     $topics = KunenaForumTopicHelper::getTopics($topicIds, 'none');
     // Pre-fetch users (and get last post ids for moderators).
     foreach ($topics as $topic) {
         $userIds[$topic->last_post_userid] = $topic->last_post_userid;
         $postIds[$topic->id] = $topic->last_post_id;
     }
     KunenaUserHelper::loadUsers($userIds);
     KunenaForumMessageHelper::getMessages($postIds);
     // Pre-fetch user related stuff.
     if ($me->exists() && !$me->isBanned()) {
         // Load new topic counts.
         KunenaForumCategoryHelper::getNewTopics(array_keys($this->categories));
     }
     $this->actions = $this->getActions();
     $this->pagination = new JPagination($total, $limitstart, $limit);
     $this->headerText = JText::_('COM_KUNENA_CATEGORY_SUBSCRIPTIONS');
 }
开发者ID:densem-2013,项目名称:exikom,代码行数:50,代码来源:display.php

示例3: unSubscribeCategory

 /**
  * Un-subscribe from a category
  *
  * @param  string|int   $catid   Forum Category id
  * @param  UserTable    $user    Viewed at User
  * @param  PluginTable  $plugin  Current Plugin
  * @return boolean               Result
  */
 public static function unSubscribeCategory($catid, $user, $plugin)
 {
     if (!class_exists('KunenaForumCategoryHelper')) {
         return false;
     }
     if ($catid == 'all') {
         $categories = KunenaForumCategoryHelper::getLatestSubscriptions((int) $user->id, 0, 0);
         $ids = array_keys(array_pop($categories));
     } else {
         $ids = array((int) $catid);
     }
     if (!$ids || !KunenaForumCategoryHelper::subscribe($ids, 0, (int) $user->id)) {
         return false;
     }
     return true;
 }
开发者ID:bobozhangshao,项目名称:HeartCare,代码行数:24,代码来源:kunena20.php

示例4: unSubscribeCategory

	/**
	 * Un-subscribe from a category
	 *
	 * @param  string|int   $catid   Forum Category id
	 * @param  UserTable    $user    Viewed at User
	 * @param  PluginTable  $plugin  Current Plugin
	 * @return boolean               Result
	 */
	static public function unSubscribeCategory( $catid, $user, /** @noinspection PhpUnusedParameterInspection */ $plugin )
	{
		if ( ! class_exists( 'KunenaForumCategoryHelper' ) ) {
			return false;
		}

		if ( $catid == 'all' ) {
			$categories	=	KunenaForumCategoryHelper::getLatestSubscriptions( (int) $user->id, 0, 0 );
			$ids		=	array_keys( array_pop( $categories ) );
		} else {
			$ids		=	array( (int) $catid );
		}

		if ( ( ! $ids ) || ( ! KunenaForumCategoryHelper::subscribe( $ids, 0, (int) $user->id ) ) ) {
			return false;
		}

		return true;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:27,代码来源:kunena20.php


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