Add Razr flip phone support

This commit is contained in:
HotPizzaYT 2022-05-27 01:04:28 +00:00
commit 33d307ecdb
8 changed files with 63 additions and 10 deletions

View file

@ -25,7 +25,7 @@ if(isset($_POST["username"]) && $_POST["username"] !== "" && isset($_POST["passw
if(!file_exists("data/" . $_POST["username"] . ".json") && !preg_match_all('/([<>\[\]\(\).,\/\\&?$=!%^#* ])/', $_POST["username"]) && strlen($_POST["username"]) >= 3){
$passHash = password_hash($_POST["password"], PASSWORD_ARGON2ID);
$date = date('Y/m/d H:i:s');
$details = array("username" => $_POST["username"], "password" => $passHash, "email" => $_POST["email"], "timezone" => "UTC", "created"=>$date,"createdmt"=>microtime(),"profile"=>"I have not filled this in yet","profilecomments"=>array(),"apps"=>array(),"hasPublishedCB"=>false,"comicbooks"=>array(0),"ownedComics"=>array(),"points"=>30,"cmsg"=>0,"forumPosts"=>array(),"reputation"=>1500,"banned"=>0,"admin"=>0,"ownedApps"=>array(),"drawings"=>array(),"pms"=>array());
$details = array("username" => $_POST["username"], "password" => $passHash, "email" => $_POST["email"], "timezone" => "UTC", "created"=>$date,"createdmt"=>microtime(),"profile"=>"I have not filled this in yet","profilecomments"=>array(),"apps"=>array(),"hasPublishedCB"=>false,"comicbooks"=>array(0),"ownedComics"=>array(),"points"=>30,"cmsg"=>0,"forumPosts"=>array(),"reputation"=>1500,"banned"=>1,"admin"=>0,"ownedApps"=>array(),"drawings"=>array(),"pms"=>array());
$detailsEncoded = json_encode($details, true);
file_put_contents("data/" . $_POST["username"] . ".json", $detailsEncoded);
echo "<p>SUCCESS: Account created successfully!</p>";
@ -35,4 +35,4 @@ if(!file_exists("data/" . $_POST["username"] . ".json") && !preg_match_all('/([<
echo "<p>ERROR: That account already exists or contains symbols! (<>[]().,/\\&?$=!%^#*)</p>";
}
}
?>
?>

BIN
3ds/chat/.innerch.php.swo Normal file

Binary file not shown.

BIN
3ds/chat/.innerch.php.swp Normal file

Binary file not shown.

View file

@ -1,4 +1,10 @@
<?php
if(strpos($_SERVER["HTTP_USER_AGENT"], "MOT-RAZR") !== false){
$razr = true;
} else {
$razr = false;
}
session_start();
if(isset($_GET["room"])){
if(file_exists("data/".$_GET["room"].".json")){
@ -220,12 +226,12 @@ if(isset($_GET["room"])){
<!-- I had to set it to normal full long polling because this IN MY HAIR code keeps repeating latest message -->
<body onload="getIcons(); setInterval(getfullchat, 1000);">
<div id="contenttop" class="conttop">
<a href="../../">Back</a><br/>
<?php if($razr){?><input id="msg" style="width: 120px" onkeydown="check(event)" maxlength="2000"></input><button onclick="sendmess()">Send!</send><br /><?php } ?><a href="../../">Back</a><br/>
<div id="chatscreen" class="scrollable h200">Loading chat...</div>
</div>
<div id="contentbot">
<div id="nav" class="scrollable test">Loading nav</div>
<?php if(isset($_SESSION["ts_user"])){?><input onclick="" onfocus="" id="msg" style="width: 120px" onkeydown="check(event)"></input><button onclick="sendmess()">Send</button>
<?php if(isset($_SESSION["ts_user"]) && $razr == false){?><input onclick="" onfocus="" id="msg" style="width: 120px" onkeydown="check(event)"></input><button onclick="sendmess()">Send</button>
- <img src="u.png" onmousedown="scrolling='yes'; scrollup()" onmouseup="scrolling='no';" onmouseout="scrolling='no'" /> <img src="d.png" onmousedown="scrolling='yes'; scrolldown()" onmouseup="scrolling='no';" onmouseout="scrolling='no'" />
<?php } else { ?> You have to be logged in! <a href="../acc/index.php">Login here</a><?php }?>
</div>
@ -234,4 +240,4 @@ if(isset($_GET["room"])){
}
?>
</body>
</html>
</html>

View file

@ -1,5 +1,6 @@
<?php
session_start();
error_reporting(E_ALL);
include_once("process.php");
if(isset($_GET["room"]) && file_exists("data/".$_GET["room"].".json")){
$jsonF = file_get_contents("data/".$_GET["room"].".json");
@ -31,4 +32,4 @@ if(isset($_GET["room"]) && file_exists("data/".$_GET["room"].".json")){
}
}
}
}

View file

@ -1 +1 @@
{"name":"General Beta","description":"General topic for all users to use (beta)","allowGuest":false,"posts":[{"title":"You can now post to the forums","from":"HxOr1337","cont":"Great news everyone, you can now post to the forms!\r\n\r\nThis is a test, unfortunately. :troll:","time":1651021306,"com":[]},{"title":"System Post","from":"System","cont":"wuzzup guise???","time":0,"com":[]},{"title":"Hey guys","from":"HxOr1337","cont":"Hey guys\n\n[code]<?php\n\/\/ Hello everyone, this is my first\n\/\/ post. I'm not exactly sure how\n\/\/ all this will play out on the\n\/\/ Nintendo 3DS, but here's to\n\/\/ hoping highlight.js plays\n\/\/ nice with the Nintendo 3DS\n?>[\/code]","time":0,"com":[]},{"title":"test","from":"HxOr1337","cont":"test! testity test test test...\r\n\r\n\r\nballs","time":1651021123,"com":[]},{"title":"Post :D","from":"HxOr1337","cont":"Posting post post post 123","time":1651713046,"com":[]},{"title":"Posted from DSi","from":"DSi","cont":"This has been posted from DSi, :D","time":1651978343,"com":[]},{"title":"We hit the min-width!","from":"DSi","cont":"Let's see what happens R:","time":1652213864,"com":[]},{"title":"3DSTownSquare.com","from":"HxOr1337","cont":"I'm proud to announce that 3DSTownsquare has been LAUNCHED! Thank you for waiting almost a month for this. It's been 31 days since 3DSTownSquare's release.","time":1653576810,"com":[]}]}
{"name":"General Beta","description":"General topic for all users to use (beta)","allowGuest":false,"posts":[{"title":"You can now post to the forums","from":"HxOr1337","cont":"Great news everyone, you can now post to the forms!\r\n\r\nThis is a test, unfortunately. :troll:","time":1651021306,"com":[]},{"title":"Why did it roll back","from":"HxOr1337","cont":"Why?","time":1653599865,"com":[]},{"title":"asdsad","from":"HxOr1337","cont":"asdadas","time":1653599876,"com":[]}]}

View file

@ -5,10 +5,22 @@ body, html {
</style>
<meta name="viewport" content="width=320">
<?php
error_reporting(E_ALL);
if(isset($_COOKIE["cd"]) && intval($_COOKIE["cd"]) >= time()){
// unset($_COOKIE["cd"]);
setCookie("cd", "", -1);
$iscd = true;
} else if(isset($_COOKIE["cd"])){
$iscd = false;
} else {
$iscd = true;
}
session_start();
if(isset($_SESSION["ts_user"]) && $_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["topic"]) && isset($_POST["title"]) && isset($_POST["cont"])){
if(isset($_SESSION["ts_user"]) && $_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["topic"]) && isset($_POST["title"]) && isset($_POST["cont"]) && isset($_COOKIE["cd"])){
if($_POST["title"] != "" && $_POST["cont"] != "" && strlen($_POST["title"]) <= 32 && strlen($_POST["cont"]) <= 5000){
if(file_exists("data/topic/".$_POST["topic"].".json")){
if(file_exists("data/topic/".$_POST["topic"].".json") && json_decode(file_get_contents("../acc/data/".$_SESSION["ts_user"].".json"),true)["banned"] <= 0 && $iscd){
setCookie("cd", time()+30000, time()+30000);
$jsonF = file_get_contents("data/topic/".$_POST["topic"].".json");
$jsonD = json_decode($jsonF, true);
$posts = $jsonD["posts"];
@ -20,6 +32,8 @@ body, html {
echo "Your post has been submitted<a href='view.php?topic=0&post=".$id."'>here</a>.";
} else {
echo "You're banned, probably.";
}
}else{
echo "forums.error.unknown";
@ -27,4 +41,4 @@ body, html {
} else {
echo "Something went wrong.<br />";
echo "Debug info: ".var_dump($_SERVER["REQUEST_METHOD"]);
}
}

32
3ds/forums/~ Normal file
View file

@ -0,0 +1,32 @@
<style>
body, html {
width: 320px;
}
</style>
<meta name="viewport" content="width=320">
<?php
session_start();
if(isset($_SESSION["ts_user"]) && $_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["topic"]) && isset($_POST["title"]) && isset($_POST["cont"])){
if($_POST["title"] != "" && $_POST["cont"] != "" && strlen($_POST["title"]) <= 32 && strlen($_POST["cont"]) <= 5000){
if(file_exists("data/topic/".$_POST["topic"].".json") && json_decode(file_get_contents("../acc/data/".$_SESSION["ts_user"].".json"),true)["banned"] <= 0 && (!isset($_COOKIE["as"])){
// CoolDown cookie, disguised as something else :trl:
setCookie("as", "aHR0cHM6Ly9zdGFja292ZXJmbG93LmNvbS9xdWVzdGlvbnMvMzk4MjA4MjYvaG93LWNhbi1pLW1ha2UtYS1jb29sZG93bi1pbi1waHA=",time()+30000);
$jsonF = file_get_contents("data/topic/".$_POST["topic"].".json");
$jsonD = json_decode($jsonF, true);
$posts = $jsonD["posts"];
$newPost = array("title"=>$_POST["title"],"from"=>$_SESSION["ts_user"],"cont"=>$_POST["cont"],"time"=>time(),"com"=>array());
array_push($jsonD["posts"], $newPost);
$newj = json_encode($jsonD);
file_put_contents("data/topic/".$_POST["topic"].".json", $newj);
$id = count($jsonD["posts"]) - 1;
echo "Your post has been submitted<a href='view.php?topic=0&post=".$id."'>here</a>.";
}
}else{
echo "forums.error.unknown";
}
} else {
echo "Something went wrong.<br />";
echo "Debug info: ".var_dump($_SERVER["REQUEST_METHOD"]);
}