本文整理汇总了PHP中Chat::get_box_list方法的典型用法代码示例。如果您正苦于以下问题:PHP Chat::get_box_list方法的具体用法?PHP Chat::get_box_list怎么用?PHP Chat::get_box_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chat
的用法示例。
在下文中一共展示了Chat::get_box_list方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Game
try {
$Game = new Game((int) $_SESSION['game_id']);
if (!empty($_GET['accept'])) {
$Game->accept($_SESSION['player_id']);
}
} catch (MyException $e) {
if (!defined('DEBUG') || !DEBUG) {
Flash::store('Error Accessing Game !');
} else {
call('ERROR ACCESSING GAME :' . $e->outputMessage());
}
exit;
}
$players = $Game->get_players();
$Chat = new Chat($_SESSION['player_id'], $_SESSION['game_id']);
$chat_data = $Chat->get_box_list();
$chat_html = '
<div id="chatbox">
<form action="' . $_SERVER['REQUEST_URI'] . '" method="post"><div>
<input id="chat" type="text" name="chat" />
<label for="private" class="inline"><input type="checkbox" name="private" id="private" value="yes" /> Private</label>
</div></form>';
if (is_array($chat_data)) {
$chat_html .= '
<dl id="chats">';
foreach ($chat_data as $chat) {
if ('' == $chat['username']) {
$chat['username'] = '[deleted]';
}
$color = '';
if (isset($players[$chat['player_id']]['color'])) {
示例2: Chat
break;
default:
break;
}
echo 'OK';
exit;
}
// run the in game chat
if (isset($_POST['chat'])) {
try {
if (!isset($_SESSION['game_id'])) {
$_SESSION['game_id'] = 0;
}
$Chat = new Chat((int) $_SESSION['player_id'], (int) $_SESSION['game_id']);
$Chat->send_message($_POST['chat'], isset($_POST['private']), isset($_POST['lobby']));
$return = $Chat->get_box_list(1);
$return = $return[0];
} catch (MyException $e) {
$return['error'] = 'ERROR: ' . $e->outputMessage();
}
echo json_encode($return);
exit;
}
// run setup validation
if (isset($_POST['test_setup'])) {
try {
Setup::is_valid_reflection($_POST['setup'], $_POST['reflection']);
$return['valid'] = true;
} catch (MyException $e) {
$return['error'] = 'ERROR: ' . $e->outputMessage();
}