forked from H3Gi/tatar-wars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchat.php
48 lines (30 loc) · 884 Bytes
/
chat.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
require( '.' . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'boot.php' );
require_once( MODEL_PATH . 'chat.php' );
require_once( MODEL_PATH . 'wordsfilter.php' );
class GPage extends SecureGamePage {
var $chats = null;
var $Filter = NULL;
function GPage() {
parent::securegamepage();
$this->viewFile = 'chat.phtml';
$this->contentCssClass = 'player';
}
function load() {
parent::load();
$this->Filter = new FilterWordsModel();
$m = new ChatModel();
if (( $this->isPost() && isset( $_POST['text'] ) )) {
$text = stripslashes( htmlspecialchars( trim( $_POST['text'] ) ) );
if ($text != '') {
$m->SendToChat( $this->data['name'], $this->player->playerId, $text );
}
}
$m->DeleteOldChat();
$this->chats = $m->GetFromChat();
$m->dispose();
}
}
$p = new GPage();
$p->run();
?>