本文整理汇总了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);