]> git.lizzy.rs Git - dragonblocks.git/blob - game/chat/send.php
Reset file permissions to defaults
[dragonblocks.git] / game / chat / send.php
1 <?php
2         if(file_exists("../login-config.php"))
3                 require("../login-config.php");
4         else if(file_exists("../../login-config.php"))
5                 require("../../login-config.php");
6         else
7                 die;
8         if(! is_loggedin())
9                 die;
10         $rawmsg = $_POST["msg"];
11         if($rawmsg[0] != ".")
12                 $rawmsg = ".tell " . $rawmsg;
13         $args = explode(" ", $rawmsg);
14         switch(array_shift($args)){
15                 case ".join":
16                         $msg = get_username() . " has joined.";
17                         break;
18                 case ".tell":
19                         $msg = "<" . get_username() . "> " . join(" ", $args);
20                         break;
21                 case ".leave":
22                         $msg = get_username() . " has left.";
23                         break;
24                 case ".me":
25                         $msg = "*" . get_username() . " " . join(" ", $args);
26                         break;
27         }
28         if($msg)
29                 file_put_contents("message.html", htmlentities($msg));
30 ?>