本文整理汇总了PHP中Room::getUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP Room::getUsers方法的具体用法?PHP Room::getUsers怎么用?PHP Room::getUsers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Room
的用法示例。
在下文中一共展示了Room::getUsers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
public function main()
{
$room = intval($_POST['room']);
$loggedUser = LoggedUser::whoIsLogged();
$GLOBALS['smarty']->assign('users', Room::getUsers($room));
echo $GLOBALS['smarty']->fetch('users-box.tpl');
}
示例2: setup
protected function setup()
{
$loggedUser = LoggedUser::whoIsLogged();
if ($this->room !== NULL) {
Room::addUser($loggedUser['id'], $this->room['id']);
$messages = Chat::getMessages($this->room['id'], $loggedUser['id'], 0, $this->game['id']);
MySmarty::assign('loggedUser', $loggedUser);
MySmarty::assign('messages', $messages);
MySmarty::assign('users', Room::getUsers($this->room['id']));
MySmarty::assign('emoticonDir', EMOTICONS_DIR);
MySmarty::assign('emoticons', Emoticons::getEmoticons());
MySmarty::assign('room', $this->room);
}
}
示例3: intval
$actualUrl = Utils::getActualUrl();
$room = intval($_GET['id']);
if (!$room) {
Utils::redirect('rooms.php');
}
Room::addUser($loggedUser['id'], $room);
$gameRepository = new GameRepository();
$game = $gameRepository->getOneByRoom($room);
if ($game) {
$GLOBALS['smarty']->assign('game', $game);
}
if ($_POST && trim($_POST['message'])) {
if (strpos($_POST['message'], '.') === 0) {
$commandResult = Command::execute($_POST['message'], $game);
} else {
Chat::addMessage(trim($_POST['message']), $room);
}
Room::updateUserLastActivity($loggedUser['id'], $room);
Utils::redirect($actualUrl);
}
$messages = Chat::getMessages($room, $loggedUser['id']);
$emoticons = Emoticons::getEmoticons();
$GLOBALS['smarty']->assign('loggedUser', $loggedUser);
$GLOBALS['smarty']->assign('room', $room);
$GLOBALS['smarty']->assign('messages', $messages);
$GLOBALS['smarty']->assign('users', Room::getUsers($room));
$GLOBALS['smarty']->assign('emoticonDir', EMOTICONS_DIR);
$GLOBALS['smarty']->assign('emoticons', $emoticons);
$GLOBALS['smarty']->assign('content', $GLOBALS['smarty']->fetch('room.tpl'));
$GLOBALS['smarty']->assign('bodyAdded', 'onload="JavaScript:timedRefresh(10000, ' . $room . ');"');
echo $GLOBALS['smarty']->fetch('content.tpl');