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); + ?>
@@ -71,7 +75,7 @@ function addComment(item, index){

Created on

Banned:

Admin:

-

", htmlspecialchars($jsonD["profile"])); ?>

+



diff --git a/3ds/chat/i/clown.png b/3ds/chat/i/clown.png new file mode 100644 index 0000000000000000000000000000000000000000..51a5d47677643afe730c54d8c33cc7ea9e005370 GIT binary patch literal 628 zcmV-)0*n2LP)UlTA+(Q51%sJDq|PmV5@ov@`}2Oh|-6OqIB>)--5{ zZn_iw3+xC>;>W)*up`EuNd+w~FkMKEqzlqiTAbDb+JzcP2kEre#cgLwyqif*<~i@V z?|HAFHeO9M9&4E zt0?n}|0&8e&;T3=kHLo>@OP8YB6p^q-M%$;Zd5V;!Ub_aL=@O=5Sxa`6i>8Lp%O5M zy3XGbT#!b~(T3N+?1S<#qxxa7f}z*I`Q?r(KZ2O?Rw&hP;aIhEqqzXF1&KMJ33d%G4uNi(hE*z;1LJ}3YVj?_&j72dTx|zp&Ktk< z14jBe(9&DkrOniy=PDqjWD=Nc1wl%w>aUdY#tx)+S=Q>dT(|8inXKw6--8ft@RX_$ zE||%~>0hXyv92dAnxqIFRVXsA_9)+Y=Fs%MnLMm*!v0r6NsDG@wnt}YDH?vYN3&14 zYS+{qH+Gcb_9rjfdK+#PeEx0{XQw
-
+
Loading chat...
You have to be logged in! Login here
"mario", ":luigi:" => "luigi", ":weegee:" => "weegee", - ":pokeball:" => "pokeball src=", + ":pokeball:" => "pokeball", ":ds:" => "ds", ":baby:" => "baby", ":bheart:" => "heart", @@ -62,7 +62,11 @@ ":rec:" => "RECOMMENDED", ":stb:" => "STABLE", ":uns:" => "UNSTABLE", - ":pre:" => "pre" + ":pre:" => "pre", + ":0)" => "clown", + ":O)" => "clown", + ":o)" => "clown" + ); $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 @@ + + + + + + 3DSTownSquare forums + + + + +
+ Oops! Our header could not be displayed! +
Welcome to 3DSTownSquare forums!
+
+
+
+
+
+ Topics +
+
+ ".$jsonD["name"].""; + $desc = $jsonD["description"]; + $latestPost = "Latest post by: ".$jsonD["posts"][0]["from"].", \"".htmlspecialchars($jsonD["posts"][0]["title"])."\""; + echo "
" . $name . "
".$latestPost."
"; + } + } + ?> + +
+
+ Back +
+
+ + \ No newline at end of file diff --git a/3ds/forums/topic.php b/3ds/forums/topic.php new file mode 100644 index 0000000..466242d --- /dev/null +++ b/3ds/forums/topic.php @@ -0,0 +1,87 @@ + + + + + + 3DSTownSquare forums + + + + +
+ Oops! Our header could not be displayed! +
Welcome to 3DSTownSquare forums!
+
+
+
+ +
+
+ + Posts in + +
+
+ $post){ + echo ""; + } + } else { + echo $error; + } + ?> + +
+
+ Back +
+
+ + \ No newline at end of file diff --git a/3ds/forums/view.php b/3ds/forums/view.php new file mode 100644 index 0000000..2254f82 --- /dev/null +++ b/3ds/forums/view.php @@ -0,0 +1,105 @@ + + + + + + + + + 3DSTownSquare forums + + + + +
+ Oops! Our header could not be displayed! +
Welcome to 3DSTownSquare forums!
+
+
+
+ + = strval($_GET["post"])){ + $post = $jsonD["posts"][strval($_GET["post"])]; + $cont = str_ireplace("\\n", "
", htmlspecialchars($post["cont"])); + $cont = str_ireplace("[code]", "
", $cont);
+				$cont = str_ireplace("[/code]", "
", $cont); + } else { + $error = "forums.errors.postnotfound"; + } + } else { + $error = "forums.errors.notfound"; + } + ?> +
+
+ +
+
+ "; + echo $cont; + } else { + echo $error; + } + ?> + +
+ + +
+ + ">Back +
+
+ + \ No newline at end of file diff --git a/3ds/index.php b/3ds/index.php index afa59d8..bfff20e 100644 --- a/3ds/index.php +++ b/3ds/index.php @@ -49,8 +49,13 @@ session_start(); $jsonD = json_decode($jsonF, true); $_SESSION["ts_points"] = $jsonD["points"]; ?>Welcome, " . $_SESSION["ts_user"] . ""; ?>, you have Login
+ + +
+ +
\ No newline at end of file diff --git a/images/forums.png b/images/forums.png new file mode 100644 index 0000000000000000000000000000000000000000..c1ab636997e0b7ed8d319c43b9e6cf2447bd646c GIT binary patch literal 1382 zcmV-s1)2JZP)jDvm8utAHhU%c^Jhs!evCh z;LY)i0Gdax7x>J*&sjL{S>8Bz6G@Du$%De7kGID^*N~kh;0Hi|V&w7`Phm31#qsaz zzy~#vlc!D&6d&opo)w8C<0pknjPuAz4djv=R_r$rUJeu(zfl)5^14rUoe^UW?7Av3 zta@BVZ(0kQmaR-Vpf~(CA{pmB>=!DNe^8y8K+Fo&sRo6^7EP$gzjN>JmZHIHV~Ff;sgl_c!XfcaBK>yCXC&K&K37tB~r0qx#BMLP8(dg4jb3OOB><(B;0xc zTUz1IzhT=8uD%EJF46aPK~rN51ic#QxtP$Tp6q-L3I=>T20vbd;u@HlgP*R!*H_^F zLulI^ZuXmD7gI3c=i6Y}?q;5A2BX1Mziw@fRW#&&V^h7LhDqsKm4>P7ti zv~If@LKlY(Yve3Gc<>;lQVD?W?rsdjc)I+27w2^|TeoiI(4j*B0l7-0LQ|7_&e^t& zh+r57j^kh$2DWVnSEUq%LIKONC=?24nubye(=-DeD@v-HNyOmN(h`+Q1>3d(7#tkr z)TvWkxNrf0uC6Z5oH@hX+#G|0g8>HMz<~ptK7E>_M~`y$>{(8nIDutZ96NT5p`js0 zM@LsD7-?Ab*jK$LCr_T_{Q2{YjErEKCdFcrzP>(&hlc@ZZ*Qlkr-uz2Hl%cSbaZg| z@L@Dfqo=2b#l=Nz+r~6aN~IFpw{Ne_g0VuKh{68;e!9B4*tc(=w;_ogfyH7mvRU`J zPRbzP@eEYjQCOSxR;+_`hB6ZF06_-FA7CrM*tBO=1UzyO_{ovHbjmKKJF zhM1q9&t0!vE_3|&aavnj*}He|>I9u=!+P_L@VmJEMsBmJ71hcB9@!B?BTOcuY)gh^5t?UqLl1sXTn7Z6%<|I@|BVFAs>`t#Ab$Tvm`v(mkA zS4X(C;!ngRIjMo1B*;k?Iac2cT-H&1l1olykV`6*gwmvyGp(3>C+=2{oC3bo*>U44 zA|C=O;}2(oNYbh~7D`!6(nO+|G&z7ij!a(+Gh(!@gz!E}_Mq6js*93VkKJduToL={ o5@7si4j?Q5mw-<>GJO@`Uj^Yh1pJ2pR{#J207*qoM6N<$f+*vV-v9sr literal 0 HcmV?d00001 diff --git a/images/index.php b/images/index.php new file mode 100644 index 0000000..09f6cea --- /dev/null +++ b/images/index.php @@ -0,0 +1,4 @@ +Error 403 +go home!"); +echo $rand[array_rand($rand)]; \ No newline at end of file