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


PHP WCF::getUserProfileHandler方法代码示例

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


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

示例1: load

 /**
  * Loads a list of recent activity entries.
  * 
  * @return	array
  */
 public function load()
 {
     $eventList = new ViewableUserActivityEventList();
     if ($this->parameters['lastEventID']) {
         $eventList->getConditionBuilder()->add("user_activity_event.time <= ?", array($this->parameters['lastEventTime']));
         $eventList->getConditionBuilder()->add("user_activity_event.eventID < ?", array($this->parameters['lastEventID']));
     } else {
         $eventList->getConditionBuilder()->add("user_activity_event.time < ?", array($this->parameters['lastEventTime']));
     }
     // profile view
     if ($this->parameters['userID']) {
         $eventList->getConditionBuilder()->add("user_activity_event.userID = ?", array($this->parameters['userID']));
     } else {
         if ($this->parameters['filteredByFollowedUsers'] && count(WCF::getUserProfileHandler()->getFollowingUsers())) {
             $eventList->getConditionBuilder()->add('user_activity_event.userID IN (?)', array(WCF::getUserProfileHandler()->getFollowingUsers()));
         }
     }
     $eventList->readObjects();
     $lastEventTime = $eventList->getLastEventTime();
     if (!$lastEventTime) {
         return array();
     }
     // removes orphaned and non-accessable events
     UserActivityEventHandler::validateEvents($eventList);
     if (!count($eventList)) {
         return array();
     }
     // parse template
     WCF::getTPL()->assign(array('eventList' => $eventList));
     $events = $eventList->getObjects();
     return array('lastEventID' => end($events)->eventID, 'lastEventTime' => $lastEventTime, 'template' => WCF::getTPL()->fetch('recentActivityListItem'));
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:37,代码来源:UserActivityEventAction.class.php

示例2: init

 /**
  * @see	\wcf\system\dashboard\box\IDashboardBox::init()
  */
 public function init(DashboardBox $box, IPage $page)
 {
     parent::init($box, $page);
     // get current date
     $currentDay = DateUtil::format(null, 'm-d');
     $date = explode('-', DateUtil::format(null, 'Y-n-j'));
     // get user ids
     $userIDs = UserBirthdayCache::getInstance()->getBirthdays($date[1], $date[2]);
     $userIDs = array_intersect($userIDs, WCF::getUserProfileHandler()->getFollowingUsers());
     if (!empty($userIDs)) {
         $userProfileList = new UserProfileList();
         $userProfileList->setObjectIDs($userIDs);
         $userProfileList->readObjects();
         $i = 0;
         foreach ($userProfileList as $userProfile) {
             if ($i == 10) {
                 break;
             }
             if (!$userProfile->isProtected() && substr($userProfile->birthday, 5) == $currentDay) {
                 $this->userProfiles[] = $userProfile;
                 $i++;
             }
         }
     }
     $this->fetched();
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:29,代码来源:TodaysFollowingBirthdaysDashboardBox.class.php

示例3: init

 /**
  * @see	\wcf\system\dashboard\box\IDashboardBox::init()
  */
 public function init(DashboardBox $box, IPage $page)
 {
     parent::init($box, $page);
     if (MODULE_USERS_ONLINE && WCF::getSession()->getPermission('user.profile.canViewUsersOnlineList') && count(WCF::getUserProfileHandler()->getFollowingUsers())) {
         $this->usersOnlineList = new UsersOnlineList();
         $this->usersOnlineList->getConditionBuilder()->add('session.userID IN (?)', array(WCF::getUserProfileHandler()->getFollowingUsers()));
         $this->usersOnlineList->sqlLimit = 10;
         $this->usersOnlineList->readObjects();
     }
     $this->fetched();
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:14,代码来源:FollowingsOnlineSidebarDashboardBox.class.php

示例4: init

 /**
  * @see	\wcf\system\dashboard\box\IDashboardBox::init()
  */
 public function init(DashboardBox $box, IPage $page)
 {
     parent::init($box, $page);
     if (WCF::getUser()->userID && count(WCF::getUserProfileHandler()->getFollowingUsers())) {
         $this->canFilterByFollowedUsers = true;
     }
     $this->eventList = new ViewableUserActivityEventList();
     if ($this->canFilterByFollowedUsers && WCF::getUser()->recentActivitiesFilterByFollowing) {
         $this->filteredByFollowedUsers = true;
         $this->eventList->getConditionBuilder()->add('user_activity_event.userID IN (?)', array(WCF::getUserProfileHandler()->getFollowingUsers()));
     }
     $this->eventList->sqlLimit = RECENT_ACTIVITY_ITEMS;
     $this->eventList->readObjects();
     $this->lastEventTime = $this->eventList->getLastEventTime();
     // removes orphaned and non-accessable events
     UserActivityEventHandler::validateEvents($this->eventList);
     $this->fetched();
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:21,代码来源:RecentActivityDashboardBox.class.php

示例5: isVisible

 /**
  * Checks the 'canViewOnlineStatus' setting.
  * 
  * @param	integer		$userID
  * @param	integer		$canViewOnlineStatus
  * @return	boolean
  */
 public static function isVisible($userID, $canViewOnlineStatus)
 {
     if (WCF::getSession()->getPermission('admin.user.canViewInvisible') || $userID == WCF::getUser()->userID) {
         return true;
     }
     switch ($canViewOnlineStatus) {
         case 0:
             // everyone
             return true;
         case 1:
             // registered
             if (WCF::getUser()->userID) {
                 return true;
             }
             break;
         case 2:
             // following
             if (WCF::getUserProfileHandler()->isFollower($userID)) {
                 return true;
             }
             break;
     }
     return false;
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:31,代码来源:UsersOnlineList.class.php


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