From b0034c937bb07687ff7c95d669b0eda3a7ce3376 Mon Sep 17 00:00:00 2001
From: HotPizzaYT <57576298+HotPizzaYT@users.noreply.github.com>
Date: Tue, 26 Apr 2022 15:54:47 -0500
Subject: [PATCH] Add forums (beta)
---
3ds/acc/profile/view.php | 6 +-
3ds/chat/i/clown.png | Bin 0 -> 628 bytes
3ds/chat/index.php | 7 ++-
3ds/chat/process.php | 8 ++-
3ds/chat/sender.php | 8 ++-
3ds/forums/data/topic/0.json | 1 +
3ds/forums/index.php | 77 +++++++++++++++++++++++++
3ds/forums/topic.php | 87 +++++++++++++++++++++++++++++
3ds/forums/view.php | 105 +++++++++++++++++++++++++++++++++++
3ds/index.php | 5 ++
images/forums.png | Bin 0 -> 1382 bytes
images/index.php | 4 ++
12 files changed, 299 insertions(+), 9 deletions(-)
create mode 100644 3ds/chat/i/clown.png
create mode 100644 3ds/forums/data/topic/0.json
create mode 100644 3ds/forums/index.php
create mode 100644 3ds/forums/topic.php
create mode 100644 3ds/forums/view.php
create mode 100644 images/forums.png
create mode 100644 images/index.php
diff --git a/3ds/acc/profile/view.php b/3ds/acc/profile/view.php
index 43cb741..daf10a2 100644
--- a/3ds/acc/profile/view.php
+++ b/3ds/acc/profile/view.php
@@ -32,6 +32,10 @@ body, html {
if(isset($_GET["pf"]) && file_exists("../data/" . $_GET["pf"] . ".json")){
$jsonF = file_get_contents("../data/".$_GET["pf"].".json");
$jsonD = json_decode($jsonF, true);
+ $cont = str_ireplace("\\n", "
", htmlspecialchars($jsonD["profile"]));
+ $cont = str_ireplace("[code]", "
", $cont);
+ $cont = str_ireplace("[/code]", "", $cont);
+
?>
Created on
Banned:
Admin:
-", htmlspecialchars($jsonD["profile"])); ?>
+
",
- ":pokeball:" => "
",
":ds:" => "
",
+ ":O)" => "
",
+ ":o)" => "
"
+
);
$txt = str_replace(array_keys($plazaEmotes), array_values($plazaEmotes), $txt);
diff --git a/3ds/chat/sender.php b/3ds/chat/sender.php
index 0a9e751..8c53ca0 100644
--- a/3ds/chat/sender.php
+++ b/3ds/chat/sender.php
@@ -51,9 +51,11 @@ include_once("functions.php");
$x = explode(" ", $_POST["msg"]);
$who = $x[1];
$msg = strSplit($_POST["msg"], 2, " ");
- if(count($jsonD["msg"])+1 >= strval($jsonD["max"])){
- array_pop($jsonD["msg"]);
- }
+
+ // Don't pop off array if whisper. To the general public, it may look as if a line was removed!
+ // if(count($jsonD["msg"])+1 >= strval($jsonD["max"])){
+ // array_pop($jsonD["msg"]);
+ // }
$finalmsg = array("cont"=>$msg[1],"time"=>time(),"type"=>"message","color"=>"red","visibility"=>$who,"from"=>$_SESSION["ts_user"]);
array_unshift($jsonD["msg"], $finalmsg);
$jsonString = json_encode($jsonD);
diff --git a/3ds/forums/data/topic/0.json b/3ds/forums/data/topic/0.json
new file mode 100644
index 0000000..39be213
--- /dev/null
+++ b/3ds/forums/data/topic/0.json
@@ -0,0 +1 @@
+{"name":"General Beta","description":"General topic for all users to use (beta)","allowGuest":false,"posts":[{"title":"System Post","from":"System","cont":"wuzzup guise???","time":0,"com":[]},{"title":"Hey guys","from":"HxOr1337","cont":"Hey guys\n\n[code][/code]","time":0,"com":[]}]}
\ No newline at end of file
diff --git a/3ds/forums/index.php b/3ds/forums/index.php
new file mode 100644
index 0000000..debe560
--- /dev/null
+++ b/3ds/forums/index.php
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+ ", $cont);
+ $cont = str_ireplace("[/code]", "", $cont);
+ } else {
+ $error = "forums.errors.postnotfound";
+ }
+ } else {
+ $error = "forums.errors.notfound";
+ }
+ ?>
+
+
+
".$latestPost."