當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。