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


PHP UserStatus::getFollowingFollowsUser方法代码示例

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


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

示例1: execute


//.........这里部分代码省略.........
                 $data[$name]['followingcount'] = $huijiUser->getFollowingUsersCount();
             }
             if (isset($this->prop['followercount'])) {
                 $data[$name]['followercount'] = $huijiUser->getFollowerCount();
             }
             if (isset($this->prop['followingsitescount'])) {
                 $data[$name]['followingsitescount'] = $huijiUser->getFollowingSitesCount();
             }
             if (isset($this->prop['stats'])) {
                 $data[$name]['stats'] = $huijiUser->getStats();
             }
             if (isset($this->prop['level'])) {
                 $data[$name]['level'] = $huijiUser->getLevel()->getLevelNumber();
             }
             if (isset($this->prop['followingsites'])) {
                 $vals['followingsites'] = $huijiUser->getFollowingSites(true);
             }
             if (isset($this->prop['context'])) {
                 if ($this->getUser()->isLoggedIn()) {
                     $data[$name]['context']['followedbyme'] = $huijiUser->isFollowedBy($this->getUser()) ? "true" : "false";
                     $me = HuijiUser::newFromUser($this->getUser());
                     $iAmFollowing = $me->getFollowingUsers();
                     $heIsFollowing = $huijiUser->getFollowingUsers();
                     $bothfollowing = [];
                     if ($heIsFollowing != null) {
                         foreach ($heIsFollowing as $someUser) {
                             //Php is awesome...
                             if (array_search($someUser['user_name'], array_column($iAmFollowing, 'user_name'))) {
                                 $bothfollowing[] = $someUser['user_name'];
                             }
                         }
                     }
                     $data[$name]['context']['bothfollowing'] = $bothfollowing;
                     $data[$name]['context']['alsofollowing'] = UserStatus::getFollowingFollowsUser($huijiUser->getName(), $me->getName());
                     $data[$name]['context']['followingsites'] = $huijiUser->getFollowingSites(true, $this->getUser());
                 } else {
                     $data[$name]['context'] = false;
                 }
             }
             if (!is_null($params['token'])) {
                 $tokenFunctions = $this->getTokenFunctions();
                 foreach ($params['token'] as $t) {
                     $val = call_user_func($tokenFunctions[$t], $user);
                     if ($val === false) {
                         $this->setWarning("Action '{$t}' is not allowed for the current user");
                     } else {
                         $data[$name][$t . 'token'] = $val;
                     }
                 }
             }
         }
     }
     $context = $this->getContext();
     // Second pass: add result data to $retval
     foreach ($goodNames as $u) {
         if (!isset($data[$u])) {
             $data[$u] = ['name' => $u];
             $urPage = new UserrightsPage();
             $urPage->setContext($context);
             $iwUser = $urPage->fetchUser($u);
             if ($iwUser instanceof UserRightsProxy) {
                 $data[$u]['interwiki'] = true;
                 if (!is_null($params['token'])) {
                     $tokenFunctions = $this->getTokenFunctions();
                     foreach ($params['token'] as $t) {
                         $val = call_user_func($tokenFunctions[$t], $iwUser);
开发者ID:HuijiWiki,项目名称:HuijiMiddleware,代码行数:67,代码来源:ApiQueryHuijiUsers.php


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