本文整理汇总了PHP中cmsUser::isOnline方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsUser::isOnline方法的具体用法?PHP cmsUser::isOnline怎么用?PHP cmsUser::isOnline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsUser
的用法示例。
在下文中一共展示了cmsUser::isOnline方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getClubPreMembers
public function getClubPreMembers($club_id, $role = '', $prem = '')
{
$club_members = array();
$role_where = $role ? "AND c.role = '{$role}'" : '';
$prem_where = $prem ? "AND premoderlist = '{$prem}'" : '';
$sql = "SELECT c.user_id, c.role, u.nickname, u.login, u.status, u.logdate, p.karma, p.gender, p.imageurl as admin_avatar, u.is_deleted\n\t\t\t\tFROM cms_user_clubs c\n\t\t\t\tLEFT JOIN cms_users u ON u.id = c.user_id\n\t\t\t\tLEFT JOIN cms_user_profiles p ON p.user_id = u.id\n\t\t\t\tWHERE club_id = '{$club_id}' {$role_where} {$prem_where}\n\t\t\t\tORDER BY c.role DESC, u.logdate DESC\n";
if ($this->inDB->limit) {
$sql .= "LIMIT {$this->inDB->limit}";
}
$rs = $this->inDB->query($sql);
$this->inDB->resetConditions();
if (!$this->inDB->num_rows($rs)) {
return $club_members;
}
while ($u = $this->inDB->fetch_assoc($rs)) {
$u['admin_avatar'] = cmsUser::getUserAvatarUrl($u['user_id'], 'small', $u['admin_avatar'], $u['is_deleted']);
$u['is_online'] = cmsUser::isOnline($u['user_id']);
$u['logdate'] = cmsCore::dateFormat($u['logdate'], true, true);
$club_members[] = $u;
}
return $club_members;
}
示例2: getUsers
public function getUsers($is_online = false){
//подготовим условия
$r_join = $is_online ? "INNER JOIN cms_online o ON o.user_id = u.id" : '';
$sql = "SELECT
u.id,
u.login,
u.nickname,
u.icq,
u.logdate as flogdate,
u.rating,
u.is_deleted as is_deleted,
u.birthdate, u.rating,
u.status as microstatus,
p.city, p.karma, p.imageurl,
p.gender as gender
FROM cms_users u
INNER JOIN cms_user_profiles p ON p.user_id = u.id
{$r_join}
WHERE u.is_locked = 0 AND u.is_deleted = 0
{$this->inDB->where}
{$this->inDB->group_by}
{$this->inDB->order_by}\n";
if ($this->inDB->limit){
$sql .= "LIMIT {$this->inDB->limit}";
}
$result = $this->inDB->query($sql);
$this->inDB->resetConditions();
if(!$this->inDB->num_rows($result)){ return false; }
$users = array();
while ($user = $this->inDB->fetch_assoc($result)){
$user['avatar'] = cmsUser::getUserAvatarUrl($user['id'], 'small', $user['imageurl'], $user['is_deleted']);
$user['user_link'] = cmsUser::getProfileLink($user['login'], $user['nickname']);
$user['flogdate'] = cmsCore::dateFormat($user['flogdate']);
$user['is_online'] = $is_online ? true : cmsUser::isOnline($user['id']);
$users[] = $user;
}
return $users;
}
示例3: getUsersPreAtoClubs
public function getUsersPreAtoClubs()
{
$sql = "SELECT u.*, u.logdate as flogdate, u.status as microstatus, p.*\n FROM ato_users u\n INNER JOIN ato_user_profiles p ON p.user_id = u.id\n WHERE u.group_id=11 AND u.is_locked = 0 AND u.is_deleted = 0 AND u.id NOT IN (SELECT user_id FROM ato_user_clubs)";
$result = $this->inDB->query($sql);
$users = array();
while ($user = $this->inDB->fetch_assoc($result)) {
$user['avatar'] = cmsUser::getUserAvatarUrl($user['id'], 'small', $user['imageurl'], $user['is_deleted']);
$user['user_link'] = cmsUser::getProfileLink($user['login'], $user['nickname']);
$user['flogdate'] = cmsCore::dateFormat($user['flogdate']);
$user['is_online'] = cmsUser::isOnline($user['id']);
$users[] = $user;
}
return $users;
}