本文整理汇总了PHP中FWUser::showCurrentlyOnlineUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP FWUser::showCurrentlyOnlineUsers方法的具体用法?PHP FWUser::showCurrentlyOnlineUsers怎么用?PHP FWUser::showCurrentlyOnlineUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FWUser
的用法示例。
在下文中一共展示了FWUser::showCurrentlyOnlineUsers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postContentLoad
/**
* Do something after content is loaded from DB
*
* @param \Cx\Core\ContentManager\Model\Entity\Page $page The resolved page
*/
public function postContentLoad(\Cx\Core\ContentManager\Model\Entity\Page $page)
{
switch ($this->cx->getMode()) {
case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
$objTemplate = $this->cx->getTemplate();
// ACCESS: parse access_logged_in[1-9] and access_logged_out[1-9] blocks
\FWUser::parseLoggedInOutBlocks($objTemplate);
// currently online users
$objAccessBlocks = false;
if ($objTemplate->blockExists('access_currently_online_member_list')) {
if (\FWUser::showCurrentlyOnlineUsers() && ($objTemplate->blockExists('access_currently_online_female_members') || $objTemplate->blockExists('access_currently_online_male_members') || $objTemplate->blockExists('access_currently_online_members'))) {
$objAccessBlocks = new AccessBlocks();
if ($objTemplate->blockExists('access_currently_online_female_members')) {
$objAccessBlocks->setCurrentlyOnlineUsers('female');
}
if ($objTemplate->blockExists('access_currently_online_male_members')) {
$objAccessBlocks->setCurrentlyOnlineUsers('male');
}
if ($objTemplate->blockExists('access_currently_online_members')) {
$objAccessBlocks->setCurrentlyOnlineUsers();
}
} else {
$objTemplate->hideBlock('access_currently_online_member_list');
}
}
// last active users
if ($objTemplate->blockExists('access_last_active_member_list')) {
if (\FWUser::showLastActivUsers() && ($objTemplate->blockExists('access_last_active_female_members') || $objTemplate->blockExists('access_last_active_male_members') || $objTemplate->blockExists('access_last_active_members'))) {
if (!$objAccessBlocks) {
$objAccessBlocks = new AccessBlocks();
}
if ($objTemplate->blockExists('access_last_active_female_members')) {
$objAccessBlocks->setLastActiveUsers('female');
}
if ($objTemplate->blockExists('access_last_active_male_members')) {
$objAccessBlocks->setLastActiveUsers('male');
}
if ($objTemplate->blockExists('access_last_active_members')) {
$objAccessBlocks->setLastActiveUsers();
}
} else {
$objTemplate->hideBlock('access_last_active_member_list');
}
}
// latest registered users
if ($objTemplate->blockExists('access_latest_registered_member_list')) {
if (\FWUser::showLatestRegisteredUsers() && ($objTemplate->blockExists('access_latest_registered_female_members') || $objTemplate->blockExists('access_latest_registered_male_members') || $objTemplate->blockExists('access_latest_registered_members'))) {
if (!$objAccessBlocks) {
$objAccessBlocks = new AccessBlocks();
}
if ($objTemplate->blockExists('access_latest_registered_female_members')) {
$objAccessBlocks->setLatestRegisteredUsers('female');
}
if ($objTemplate->blockExists('access_latest_registered_male_members')) {
$objAccessBlocks->setLatestRegisteredUsers('male');
}
if ($objTemplate->blockExists('access_latest_registered_members')) {
$objAccessBlocks->setLatestRegisteredUsers();
}
} else {
$objTemplate->hideBlock('access_latest_registered_member_list');
}
}
// birthday users
if ($objTemplate->blockExists('access_birthday_member_list')) {
if (\FWUser::showBirthdayUsers() && ($objTemplate->blockExists('access_birthday_female_members') || $objTemplate->blockExists('access_birthday_male_members') || $objTemplate->blockExists('access_birthday_members'))) {
if (!$objAccessBlocks) {
$objAccessBlocks = new AccessBlocks();
}
if ($objAccessBlocks->isSomeonesBirthdayToday()) {
if ($objTemplate->blockExists('access_birthday_female_members')) {
$objAccessBlocks->setBirthdayUsers('female');
}
if ($objTemplate->blockExists('access_birthday_male_members')) {
$objAccessBlocks->setBirthdayUsers('male');
}
if ($objTemplate->blockExists('access_birthday_members')) {
$objAccessBlocks->setBirthdayUsers();
}
$objTemplate->touchBlock('access_birthday_member_list');
} else {
$objTemplate->hideBlock('access_birthday_member_list');
}
} else {
$objTemplate->hideBlock('access_birthday_member_list');
}
}
break;
default:
break;
}
}