-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat.php
More file actions
24 lines (23 loc) · 765 Bytes
/
chat.php
File metadata and controls
24 lines (23 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
include 'chat_class.php';
require_once('functions.php');
if ($_REQUEST['action'] == 'get_last_messages') {
$sChatMessages = $GLOBALS['Chat']->getMessages(true);
require_once('Services_JSON.php');
$oJson = new Services_JSON();
echo $oJson->encode(array('messages' => $sChatMessages));
exit;
}
echo '<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>';
echo '<script type="text/javascript" src="js/main.js"></script>';
$sChatMessages = $GLOBALS['Chat']->getMessages();
echo "<div class='chat_main'>".$sChatMessages."</div>";
if(!empty($_SESSION['login'])){
include('send_mess.php');
}else{
include('login.php');
}
$GLOBALS['Chat']->acceptMessages();
// require_once('send_mess.php');
// echo $sChatInputForm;
?>