本文整理汇总了PHP中UserStatus::getProvince方法的典型用法代码示例。如果您正苦于以下问题:PHP UserStatus::getProvince方法的具体用法?PHP UserStatus::getProvince怎么用?PHP UserStatus::getProvince使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserStatus
的用法示例。
在下文中一共展示了UserStatus::getProvince方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
//.........这里部分代码省略.........
if (isset($this->prop['emailable'])) {
$data[$name]['emailable'] = $user->canReceiveEmail();
}
if (isset($this->prop['gender'])) {
$gender = $user->getOption('gender');
if (strval($gender) === '') {
$gender = 'unknown';
}
$data[$name]['gender'] = $gender;
}
if (isset($this->prop['centralids'])) {
$data[$name] += ApiQueryUserInfo::getCentralUserInfo($this->getConfig(), $user, $params['attachedwiki']);
}
if (isset($this->prop['designation'])) {
$data[$name]['designation'] = $huijiUser->getDesignation(false, true);
}
if (isset($this->prop['avatar'])) {
$data[$name]['avatar'] = array("l" => $huijiUser->getAvatar('l')->getAvatarUrlPath(), "ml" => $huijiUser->getAvatar('ml')->getAvatarUrlPath(), "m" => $huijiUser->getAvatar('m')->getAvatarUrlPath(), "s" => $huijiUser->getAvatar('s')->getAvatarUrlPath());
}
if (isset($this->prop['status'])) {
$us = new UserStatus($user);
$data[$name]['status'] = $us->getStatus();
}
if (isset($this->prop['birthday'])) {
$us = new UserStatus($user);
$data[$name]['birthday'] = $us->getBirthday();
}
if (isset($this->prop['city'])) {
$us = new UserStatus($user);
$data[$name]['city'] = $us->getCity();
}
if (isset($this->prop['province'])) {
$us = new UserStatus($user);
$data[$name]['province'] = $us->getProvince();
}
if (isset($this->prop['followingcount'])) {
$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'];
}
示例2: getCurrentUserInfo
//.........这里部分代码省略.........
$p = $this->getModulePrefix();
$this->setWarning("{$p}prop=preferencestoken has been deprecated. Please use action=query&meta=tokens instead.");
}
if (isset($this->prop['preferencestoken']) && !$this->lacksSameOriginSecurity() && $user->isAllowed('editmyoptions')) {
$vals['preferencestoken'] = $user->getEditToken('', $this->getMain()->getRequest());
}
if (isset($this->prop['editcount'])) {
// use intval to prevent null if a non-logged-in user calls
// api.php?format=jsonfm&action=query&meta=userinfo&uiprop=editcount
$vals['editcount'] = intval($user->getEditCount());
}
if (isset($this->prop['ratelimits'])) {
$vals['ratelimits'] = $this->getRateLimits();
}
if (isset($this->prop['realname']) && !in_array('realname', $this->getConfig()->get('HiddenPrefs'))) {
$vals['realname'] = $user->getRealName();
}
if ($user->isAllowed('viewmyprivateinfo')) {
if (isset($this->prop['email'])) {
$vals['email'] = $user->getEmail();
$auth = $user->getEmailAuthenticationTimestamp();
if (!is_null($auth)) {
$vals['emailauthenticated'] = wfTimestamp(TS_ISO_8601, $auth);
}
}
}
if (isset($this->prop['registrationdate'])) {
$regDate = $user->getRegistration();
if ($regDate !== false) {
$vals['registrationdate'] = wfTimestamp(TS_ISO_8601, $regDate);
}
}
if (isset($this->prop['acceptlang'])) {
$langs = $this->getRequest()->getAcceptLang();
$acceptLang = [];
foreach ($langs as $lang => $val) {
$r = ['q' => $val];
ApiResult::setContentValue($r, 'code', $lang);
$acceptLang[] = $r;
}
ApiResult::setIndexedTagName($acceptLang, 'lang');
$vals['acceptlang'] = $acceptLang;
}
if (isset($this->prop['unreadcount'])) {
$store = MediaWikiServices::getInstance()->getWatchedItemStore();
$unreadNotifications = $store->countUnreadNotifications($user, self::WL_UNREAD_LIMIT);
if ($unreadNotifications === true) {
$vals['unreadcount'] = self::WL_UNREAD_LIMIT . '+';
} else {
$vals['unreadcount'] = $unreadNotifications;
}
}
if (isset($this->prop['centralids'])) {
$vals += self::getCentralUserInfo($this->getConfig(), $this->getUser(), $this->params['attachedwiki']);
}
if (isset($this->prop['designation'])) {
$vals['designation'] = $huijiUser->getDesignation(false, true);
}
if (isset($this->prop['avatar'])) {
$vals['avatar'] = array("l" => $huijiUser->getAvatar('l')->getAvatarUrlPath(), "ml" => $huijiUser->getAvatar('ml')->getAvatarUrlPath(), "m" => $huijiUser->getAvatar('m')->getAvatarUrlPath(), "s" => $huijiUser->getAvatar('s')->getAvatarUrlPath());
}
if (isset($this->prop['gender'])) {
$vals['gender'] = $huijiUser->getOption('gender');
}
if (isset($this->prop['status'])) {
$us = new UserStatus($user);
$vals['status'] = $us->getStatus();
}
if (isset($this->prop['birthday'])) {
$us = new UserStatus($user);
$vals['birthday'] = $us->getBirthday();
}
if (isset($this->prop['city'])) {
$us = new UserStatus($user);
$vals['city'] = $us->getCity();
}
if (isset($this->prop['province'])) {
$us = new UserStatus($user);
$vals['province'] = $us->getProvince();
}
if (isset($this->prop['followingcount'])) {
$vals['followingcount'] = $huijiUser->getFollowingUsersCount();
}
if (isset($this->prop['followercount'])) {
$vals['followercount'] = $huijiUser->getFollowerCount();
}
if (isset($this->prop['followingsitescount'])) {
$vals['followingsitescount'] = $huijiUser->getFollowingSitesCount();
}
if (isset($this->prop['stats'])) {
$vals['stats'] = $huijiUser->getStats();
}
if (isset($this->prop['level'])) {
$vals['level'] = $huijiUser->getLevel()->getLevelNumber();
}
if (isset($this->prop['followingsites'])) {
$vals['followingsites'] = $huijiUser->getFollowingSites(true);
}
return $vals;
}