From d6c9283ae64432c780740fb99bffba2240af9019 Mon Sep 17 00:00:00 2001 From: Getindor Date: Fri, 5 Feb 2021 16:20:57 -0500 Subject: [PATCH] Add files via upload --- chat.php | 47 +++++++++++++++++++++++++++++++++++++++++++++++ chats.html | 1 + display.php | 36 ++++++++++++++++++++++++++++++++++++ index.php | 47 +++++++++++++++++++++++++++++++++++++++++++++++ settings.php | 3 +++ style.css | 36 ++++++++++++++++++++++++++++++++++++ userlist.php | 22 ++++++++++++++++++++++ users.txt | 1 + 8 files changed, 193 insertions(+) create mode 100644 chat.php create mode 100644 chats.html create mode 100644 display.php create mode 100644 index.php create mode 100644 settings.php create mode 100644 style.css create mode 100644 userlist.php create mode 100644 users.txt diff --git a/chat.php b/chat.php new file mode 100644 index 0000000..2b938c8 --- /dev/null +++ b/chat.php @@ -0,0 +1,47 @@ + + + +@"; +} + +if(isset($_POST["chatbox"])){ +$message = $_POST["chatbox"]; +if (substr($message, 0,3) == "/raw"){ + $raw = substr($message, 3); + $message = ""; +} +$message = htmlspecialchars($message); + +$db = file_get_contents("db.txt"); + +$db = $db . $badge . "$time $nick: " . $message . "\n"; +file_put_contents("db.txt", $db); +file_put_contents("chats.html", $db); +} +$db_array = explode("\n", $db); + +if(sizeof($db_array) > 40){ +unset($db_array[0]); +file_put_contents("db.txt", implode("\n", $db_array)); +} + +?> + + + + + + +
+ +
+ \ No newline at end of file diff --git a/chats.html b/chats.html new file mode 100644 index 0000000..d3f5a12 --- /dev/null +++ b/chats.html @@ -0,0 +1 @@ + diff --git a/display.php b/display.php new file mode 100644 index 0000000..f7d0961 --- /dev/null +++ b/display.php @@ -0,0 +1,36 @@ + + + +", $db); + +echo "" . $db . ""; + +?> + + diff --git a/index.php b/index.php new file mode 100644 index 0000000..0fb8d2c --- /dev/null +++ b/index.php @@ -0,0 +1,47 @@ + + + + + + + + +
+ +
+ \ No newline at end of file diff --git a/settings.php b/settings.php new file mode 100644 index 0000000..4d3abc9 --- /dev/null +++ b/settings.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..22a0574 --- /dev/null +++ b/style.css @@ -0,0 +1,36 @@ +body{ + margin:0px; /* rip dooms */ + padding:0px; + background-color:#111; + color:#444; + text-align:center; +} +#chat{ + height:92%; + width:90%; + border:0px; +} +#users{ + height:92%; + width:10%; + border:0px; + float:right; +} +input{ + padding:10px; + width:97%; + background-color:#222; + border:0px; + color:#999; +} +textarea:focus, input:focus{ + border:0px; + outline: none; +} +#nick{ + float:right; + color:#f00; +} +#time{ + +} \ No newline at end of file diff --git a/userlist.php b/userlist.php new file mode 100644 index 0000000..2f04781 --- /dev/null +++ b/userlist.php @@ -0,0 +1,22 @@ + +

Users:

+", $db))) { + $db = $db . $nick . "
"; + file_put_contents("users.txt", $db); +} +echo($db); +header("Refresh:1"); + +?> \ No newline at end of file diff --git a/users.txt b/users.txt new file mode 100644 index 0000000..373fd9c --- /dev/null +++ b/users.txt @@ -0,0 +1 @@ +nobody
\ No newline at end of file