$alive = false; $page_title = "Chat Board"; $quickstat = false; include SERVER_ROOT . "interface/header.php"; echo "<h1>Chat Board</h1>"; echo "<p><a href=\"" . $_SERVER['PHP_SELF'] . "?chatlength=50\">Refresh</a><p>"; $default_limit = 360; $chatlength = in('chatlength', $default_limit, 'toInt'); $message = in('message', null, 'forChat'); // Essentially no filtering. $command = in('command'); $sentMessage = in('message'); $sent = false; $username = get_username(); $user_id = get_user_id(); $input_form = $username ? render_chat_input($_SERVER['PHP_SELF'], $field_size = 40) : ''; $channel = 1; // Take in a chat and record it to the database. if ($user_id) { if ($command == "postnow" && $message) { send_chat($user_id, $message); } } // Output section. echo render_chat_refresh($not_mini = true); // Write out the js to refresh to refresh page to full chat. echo "<div id='full-chat'>"; echo $input_form; echo render_active_members($sql); echo render_chat_messages($chatlength); echo "</div>";
$private = false; $alive = false; $page_title = "Mini Chat"; $quickstat = false; include SERVER_ROOT . "interface/header.php"; $default_limit = 22; $chatlength = in('chatlength', $default_limit, 'toInt'); $message = in('message', null, 'forChat'); // Essentially no filtering. $command = in('command'); $sentMessage = in('message'); $chat_submit = in('chat_submit'); $sent = false; $username = get_username(); $user_id = get_user_id(); $input_form = $username ? render_chat_input() : ''; // Take in a chat and record it to the database. if ($user_id) { if ($command == "postnow" && $message) { send_chat($user_id, $message); } } // Output section. echo render_chat_refresh(); // Write out the js to refresh. if ($chat_submit) { // Js refocus code when chat sent. echo '<script type="text/javascript"> $(document).ready(function(){ $(".chat-submit #message").focus(); });