Change DSi-ify to use a script instead of using it per page + other changes

This commit is contained in:
HotPizzaYT 2022-05-08 21:43:05 -05:00
commit ee47c13713
15 changed files with 60 additions and 115 deletions

View file

@ -1,17 +1,6 @@
<?php <?php
session_start(); session_start();
$width = "320"; include("../../detect.php");
$height1 = "208";
$height2 = "222";
if(strpos($_SERVER["HTTP_USER_AGENT"], "Nintendo DSi") !== false){
$width = "240";
$height1 = "176";
$height2 = "176";
} else {
$width = "320";
}
$cbp = (78.125 / 100) * intval($width);
$cbp1 = strval($cbp);
?> ?>
<html> <html>

View file

@ -1,17 +1,6 @@
<?php <?php
session_start(); session_start();
$width = "320"; include("../../detect.php");
$height1 = "208";
$height2 = "222";
if(strpos($_SERVER["HTTP_USER_AGENT"], "Nintendo DSi") !== false){
$width = "240";
$height1 = "176";
$height2 = "176";
} else {
$width = "320";
}
$cbp = (78.125 / 100) * intval($width);
$cbp1 = strval($cbp);
?> ?>
<html> <html>

View file

@ -1,17 +1,6 @@
<?php <?php
session_start(); session_start();
$width = "320"; include("../../detect.php");
$height1 = "208";
$height2 = "222";
if(strpos($_SERVER["HTTP_USER_AGENT"], "Nintendo DSi") !== false){
$width = "240";
$height1 = "176";
$height2 = "176";
} else {
$width = "320";
}
$cbp = (78.125 / 100) * intval($width);
$cbp1 = strval($cbp);
?> ?>
<html> <html>

View file

@ -1,18 +1,7 @@
<?php <?php
session_start(); session_start();
include_once("../chat/process.php"); include_once("../chat/process.php");
$width = "320"; include("../../detect.php");
$height1 = "208";
$height2 = "222";
if(strpos($_SERVER["HTTP_USER_AGENT"], "Nintendo DSi") !== false){
$width = "240";
$height1 = "176";
$height2 = "176";
} else {
$width = "320";
}
$cbp = (78.125 / 100) * intval($width);
$cbp1 = strval($cbp);
?> ?>
<html> <html>
<head> <head>

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View file

@ -1,17 +1,6 @@
<?php <?php
session_start(); session_start();
$width = "320"; include("../../../detect.php");
$height1 = "208";
$height2 = "222";
if(strpos($_SERVER["HTTP_USER_AGENT"], "Nintendo DSi") !== false){
$width = "240";
$height1 = "176";
$height2 = "176";
} else {
$width = "320";
}
$cbp = (78.125 / 100) * intval($width);
$cbp1 = strval($cbp);
?> ?>
<?php <?php

View file

@ -1,17 +1,6 @@
<?php <?php
session_start(); session_start();
$width = "320"; include("../../../detect.php");
$height1 = "208";
$height2 = "222";
if(strpos($_SERVER["HTTP_USER_AGENT"], "Nintendo DSi") !== false){
$width = "240";
$height1 = "176";
$height2 = "176";
} else {
$width = "320";
}
$cbp = (78.125 / 100) * intval($width);
$cbp1 = strval($cbp);
?> ?>

View file

@ -1,15 +1,21 @@
<?php <?php
session_start(); session_start();
include("../../../detect.php");
if($isDSi){
$cheight = "132";
} else {
$cheight = "240";
}
?> ?>
<html> <html>
<style> <style>
body, html { body, html {
width: 320px; width: <?php echo $width; ?>px;
margin: 0px; margin: 0px;
} }
</style> </style>
<title>DrawTown - New Drawing</title> <title>DrawTown - New Drawing</title>
<meta name="viewport" content="width=320"> <meta name="viewport" content="width=<?php echo $width; ?>">
<script type="text/javascript"> <script type="text/javascript">
lw = 5; lw = 5;
var canvas, ctx, flag = false, var canvas, ctx, flag = false,
@ -130,13 +136,13 @@ http.open('POST', url, true);
//Send the proper header information along with the request //Send the proper header information along with the request
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http.setRequestHeader('Cookie', document.cookie); http.setRequestHeader('Cookie', document.cookie);
alert(document.cookie); // alert(document.cookie);
http.onreadystatechange = function() {//Call a function when the state changes. http.onreadystatechange = function() {//Call a function when the state changes.
if(this.readyState == 4 && this.status == 200) { if(this.readyState == 4 && this.status == 200) {
alert("Uploaded, " + http.responseText); alert("Uploaded, " + http.responseText);
alert(params); // alert(params);
document.getElementById("dbg").innerText = params; // document.getElementById("dbg").innerText = params;
alert(t); // alert(t);
} }
} }
http.send(params.toString()); http.send(params.toString());
@ -222,13 +228,12 @@ http.send(params.toString());
<img id="canvasimg" style="" style="display:none;"> <img id="canvasimg" style="" style="display:none;">
<canvas id="can" width="320" height="240" style="outline: 1px solid black;"></canvas> <canvas id="can" width="<?php echo $width; ?>" height="<?php echo $cheight; ?>" style="outline: 1px solid black;"></canvas>
<br /> <br />
<input type="button" value="save" id="btn" size="30" onclick="save()" style=""> <input type="button" value="save" id="btn" size="30" onclick="save()" style="">
<input type="button" value="clear" id="clr" size="23" onclick="erase()" style=""> <input type="button" value="clear" id="clr" size="23" onclick="erase()" style="">
<input type="button" value="exit" onclick="window.location='../'"> <input type="button" value="exit" onclick="window.location='../'">
<input type="button" value="view works" onclick="window.location='works.php'"> <input type="button" value="view works" onclick="window.location='works.php'">
<input type="button" value="play game" onclick="window.location='rooms.php'"> <input type="button" value="play game" onclick="window.location='rooms.php'">
<div id="dbg">DEBUG BOX: Debugging info will show here</div>
</body> </body>
</html> </html>

View file

@ -1,5 +1,6 @@
<?php <?php
session_start(); session_start();
include("../../../detect.php");
?> ?>
<html> <html>

View file

@ -1,5 +1,6 @@
<?php <?php
session_start(); session_start();
include("../../../detect.php");
?> ?>
<html> <html>
@ -7,23 +8,24 @@ session_start();
<style> <style>
body { body {
margin: 0px; margin: 0px;
width: 320px; width: <?php echo $width; ?>px;
background-color: #fffff; background-color: #fffff;
font-size: 12px; font-size: 12px;
} }
#contenttop { #contenttop {
background-color: #f0f0f0; background-color: #f0f0f0;
height: 208px; height: <?php echo $height1; ?>px;
} }
#contentbot { #contentbot {
background-color: #f0f0f0; background-color: #f0f0f0;
height: 222px; height: <?php echo $height2; ?>px;
overflow-y: scroll; overflow-y: scroll;
overflow-x: hidden;
word-wrap: break-word; word-wrap: break-word;
} }
.commentbox { .commentbox {
width: 250px; width: <?php echo $cbp1; ?>px;
outline: 1px solid black; outline: 1px solid black;
min-height: 200px; min-height: 200px;
} }
@ -38,12 +40,12 @@ session_start();
} }
</style> </style>
<title>DrawTown - View drawing</title> <title>DrawTown - View drawing</title>
<meta name="viewport" content="width=320"> <meta name="viewport" content="width=<?php echo $width; ?>">
<meta name="description" content="DrawTown current works"> <meta name="description" content="DrawTown current works">
</head> </head>
<body> <body>
<div id="contenttop"> <div id="contenttop">
<img src="../../../images/header3ds.png" alt="Oops! Our header could not be displayed!" /> <img src="../../../images/header3ds.png" width="<?php echo $width; ?>" alt="Oops! Our header could not be displayed!" />
<center><b><u>DrawTown view drawing</u></b></center> <center><b><u>DrawTown view drawing</u></b></center>
</div> </div>
<div id="contentbot"> <div id="contentbot">
@ -55,7 +57,7 @@ session_start();
$title = htmlspecialchars($jsonD["title"]); $title = htmlspecialchars($jsonD["title"]);
$from = $jsonD["from"]; $from = $jsonD["from"];
$src = "out/".$_GET["v"].".png"; $src = "out/".$_GET["v"].".png";
echo "<h2>".$title."</h2><img src='".$src."' alt='".$title."' />"; echo "<h2>".$title."</h2><a href='".$src."'><img src='".$src."' alt='".$title."' /></a>";
} else { } else {
echo "Drawing not found"; echo "Drawing not found";
} }

View file

@ -1,5 +1,6 @@
<?php <?php
session_start(); session_start();
include("../../../detect.php");
?> ?>
<html> <html>
@ -7,23 +8,23 @@ session_start();
<style> <style>
body { body {
margin: 0px; margin: 0px;
width: 320px; width: <?php echo $width; ?>px;
background-color: #fffff; background-color: #fffff;
font-size: 12px; font-size: 12px;
} }
#contenttop { #contenttop {
background-color: #f0f0f0; background-color: #f0f0f0;
height: 208px; height: <?php echo $height1; ?>px;
} }
#contentbot { #contentbot {
background-color: #f0f0f0; background-color: #f0f0f0;
height: 222px; height: <?php echo $height2; ?>px;
overflow-y: scroll; overflow-y: scroll;
word-wrap: break-word; word-wrap: break-word;
} }
.commentbox { .commentbox {
width: 250px; width: <?php echo $cbp1; ?>px;
outline: 1px solid black; outline: 1px solid black;
min-height: 200px; min-height: 200px;
} }
@ -38,12 +39,12 @@ session_start();
} }
</style> </style>
<title>DrawTown - Works</title> <title>DrawTown - Works</title>
<meta name="viewport" content="width=320"> <meta name="viewport" content="width=<?php echo $width; ?>">
<meta name="description" content="DrawTown current works"> <meta name="description" content="DrawTown current works">
</head> </head>
<body> <body>
<div id="contenttop"> <div id="contenttop">
<img src="../../../images/header3ds.png" alt="Oops! Our header could not be displayed!" /> <img src="../../../images/header3ds.png" width="<?php echo $width; ?>" alt="Oops! Our header could not be displayed!" />
<center><b><u>DrawTown list of works</u></b></center> <center><b><u>DrawTown list of works</u></b></center>
</div> </div>
<div id="contentbot"> <div id="contentbot">

View file

@ -1,17 +1,6 @@
<?php <?php
session_start(); session_start();
$width = "320"; include("../../detect.php");
$height1 = "208";
$height2 = "222";
if(strpos($_SERVER["HTTP_USER_AGENT"], "Nintendo DSi") !== false){
$width = "240";
$height1 = "176";
$height2 = "176";
} else {
$width = "320";
}
$cbp = (78.125 / 100) * intval($width);
$cbp1 = strval($cbp);
?> ?>
<html> <html>

View file

@ -1,15 +1,6 @@
<?php <?php
session_start(); session_start();
$width = "320"; include("../detect.php");
$height1 = "208";
$height2 = "222";
if(strpos($_SERVER["HTTP_USER_AGENT"], "Nintendo DSi") !== false){
$width = "240";
$height1 = "176";
$height2 = "176";
} else {
$width = "320";
}
?> ?>
<html> <html>

View file

@ -0,0 +1,20 @@
<?php
$isDSi = false;
$width = "320";
$height1 = "208";
$height2 = "222";
if(strpos($_SERVER["HTTP_USER_AGENT"], "Nintendo DSi") !== false){
$width = "240";
$height1 = "176";
$height2 = "176";
$isDSi = true;
} else {
$width = "320";
}
$cbp = (78.125 / 100) * intval($width);
$cbp1 = strval($cbp);
if(count(get_included_files()) == 1 && count(get_required_files()) == 1){
echo "Top screen: ". $width . "x" . $height1 . ", bottom screen: " . $width . "x" . $height2;
}
?>

2
inc.detect.php Normal file
View file

@ -0,0 +1,2 @@
Hello!
<?php include("detect.php") ?>