@@ -1,4 +1,6 @@ | |||||
/image | /image | ||||
/draft | /draft | ||||
/images | |||||
/drafts | |||||
/database.php | /database.php | ||||
@@ -5,7 +5,6 @@ | |||||
<meta name="robots" content="noindex" /> | <meta name="robots" content="noindex" /> | ||||
<title><?= ($title == '') ? '' : ($title . ' - ') ?>キケッツチャンネル お絵描き掲示板</title> | <title><?= ($title == '') ? '' : ($title . ' - ') ?>キケッツチャンネル お絵描き掲示板</title> | ||||
<link rel="stylesheet" href="https://jpafonts.osdn.jp/webfonts/jpafonts.css" /> | <link rel="stylesheet" href="https://jpafonts.osdn.jp/webfonts/jpafonts.css" /> | ||||
<link rel="stylesheet" type="text/css" href="/style.css" /> | |||||
<link rel="stylesheet" type="text/css" href="./styles/style.css" /> | <link rel="stylesheet" type="text/css" href="./styles/style.css" /> | ||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css" /> | <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css" /> | ||||
<script defer src="https://use.fontawesome.com/releases/v5.15.4/js/all.js"></script> | <script defer src="https://use.fontawesome.com/releases/v5.15.4/js/all.js"></script> | ||||
@@ -42,11 +41,11 @@ | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<h1><a href="."><img src="/img/kusobbs.gif" alt="クソ掲示板" style="width: 398px" /></a></h1> | |||||
<h1><a href="."><img src="/assets/kusobbs.gif" alt="クソ掲示板" style="width: 398px" /></a></h1> | |||||
<div style="text-align: center"><a href="#" onclick="PauseMusic ()" id="mute"> </a></div> | <div style="text-align: center"><a href="#" onclick="PauseMusic ()" id="mute"> </a></div> | ||||
<?php if ($thread == -1): ?> | <?php if ($thread == -1): ?> | ||||
<form action="make_thread.php" method="POST"> | |||||
<form action="./modules/make_thread.php" method="POST"> | |||||
スレ名:<input type="text" name="thread-name" /><br /> | スレ名:<input type="text" name="thread-name" /><br /> | ||||
スレ内容:<textarea name="thread-explain"></textarea><br /> | スレ内容:<textarea name="thread-explain"></textarea><br /> | ||||
<input type="submit" value="スレ立て" /> | <input type="submit" value="スレ立て" /> | ||||
@@ -302,7 +301,7 @@ | |||||
<canvas style="display: none" width="1" height="1" id="work"></canvas> | <canvas style="display: none" width="1" height="1" id="work"></canvas> | ||||
<canvas style="display: none" width="480" height="480" id="canvas-perfect"></canvas> | <canvas style="display: none" width="480" height="480" id="canvas-perfect"></canvas> | ||||
<script type="text/javascript" src="script.js"></script> | |||||
<script type="text/javascript" src="./scripts/script.js"></script> | |||||
<?php if ($thread != -1): ?> | <?php if ($thread != -1): ?> | ||||
<script type="text/javascript" src="./scripts/paint.js"></script> | <script type="text/javascript" src="./scripts/paint.js"></script> | ||||
@@ -25,7 +25,7 @@ else: | |||||
endif; | endif; | ||||
// 画像のディレクトリを開く. | // 画像のディレクトリを開く. | ||||
$dir = 'image/'; | |||||
$dir = '/images/'; | |||||
$handle = opendir ($dir); | $handle = opendir ($dir); | ||||
// MySQL 宣言 | // MySQL 宣言 | ||||
@@ -0,0 +1,10 @@ | |||||
<?php | |||||
require_once './db_connection.php'; | |||||
$files = glob ('./migrations/*.sql'); | |||||
foreach ($files as $file) | |||||
$__db_connection -> query (file_get_contents ($file)); | |||||
@@ -0,0 +1,2 @@ | |||||
CREATE TABLE `miteruzo_bbs`.`threads` ( `id` INT NOT NULL AUTO_INCREMENT , `title` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , `explain` MEDIUMTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , `latest` DATETIME NOT NULL , `length` INT NOT NULL DEFAULT '0' , PRIMARY KEY (`id`)) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci; | |||||
@@ -0,0 +1,2 @@ | |||||
CREATE TABLE `miteruzo_bbs`.`responses` ( `thread_id` INT NOT NULL , `response_id` INT NOT NULL , `name` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '名なしさん' , `message` MEDIUMTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , `date` DATETIME NOT NULL , `image` VARCHAR(31) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL , `held` TINYINT NOT NULL DEFAULT '0' , `deleted` TINYINT NOT NULL DEFAULT '0' , `pass` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL , `good` INT NOT NULL DEFAULT '0' , `bad` INT NOT NULL DEFAULT '0' , PRIMARY KEY (`thread_id`, `response_id`)) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci; | |||||
@@ -1,17 +1,19 @@ | |||||
<?php | <?php | ||||
define ('SAVE_DIR', 'draft/'); | |||||
define ('SAVE_DIR', "${_SERVER['DOCUMENT_ROOT']}/drafts/"); | |||||
$json = getParamJSON (); | $json = getParamJSON (); | ||||
if (!(isset ($json['data']))) | if (!(isset ($json['data']))) | ||||
{ | { | ||||
sendResult (false, 'Empty query Parameter: data'); | sendResult (false, 'Empty query Parameter: data'); | ||||
exit (1); | exit (1); | ||||
} | } | ||||
if (!(preg_match ('/^data:image\/png;base64,/', $json['data']))) | if (!(preg_match ('/^data:image\/png;base64,/', $json['data']))) | ||||
{ | { | ||||
sendResult (false, 'Not Allow data type: data'); | sendResult (false, 'Not Allow data type: data'); | ||||
exit (1); | exit (1); | ||||
} | } | ||||
@@ -27,7 +29,8 @@ setcookie ('backup', $file, time () + 60 * 60 * 24 * 30); | |||||
function | function | ||||
getParamJSON () | |||||
getParamJSON (): | |||||
array | |||||
{ | { | ||||
$buff = file_get_contents ('php://input'); | $buff = file_get_contents ('php://input'); | ||||
$json = json_decode ($buff, true); | $json = json_decode ($buff, true); | ||||
@@ -36,7 +39,10 @@ getParamJSON () | |||||
} | } | ||||
function | function | ||||
sendResult ($status, $data) | |||||
sendResult ( | |||||
$status, | |||||
$data): | |||||
string | |||||
{ | { | ||||
header ('Access-Control-Allow-Origin: *'); | header ('Access-Control-Allow-Origin: *'); | ||||
header ('Access-Control-Allow-Headers: *'); | header ('Access-Control-Allow-Headers: *'); | ||||
@@ -37,5 +37,5 @@ if (!(empty ($_POST['thread-name']))) | |||||
$mysqli -> close (); | $mysqli -> close (); | ||||
} | } | ||||
header ("location: ./?thread=$current"); | |||||
header ("location: ../?thread=$current"); | |||||
@@ -2,10 +2,10 @@ | |||||
require "${_SERVER['DOCUMENT_ROOT']}/database.php"; | require "${_SERVER['DOCUMENT_ROOT']}/database.php"; | ||||
define ('SAVE_DIR', 'image/'); // 保存ディレクトリ定義 | |||||
define ('SAVE_DIR', "${_SERVER['DOCUMENT_ROOT']}/images/"); // 保存ディレクトリ定義 | |||||
$thread = $_GET['thread']; | $thread = $_GET['thread']; | ||||
file_put_contents ('log.txt', $thread); | |||||
// file_put_contents ('log.txt', $thread); | |||||
$json = getParamJSON (); // JSON パラメタ | $json = getParamJSON (); // JSON パラメタ | ||||
@@ -219,11 +219,11 @@ SendToServer (backup) | |||||
mode: 'cors'}; | mode: 'cors'}; | ||||
if (backup) | if (backup) | ||||
await SendServer (`backup.php?id=${uniqId}`, param); | |||||
await SendServer (`/modules/backup.php?id=${uniqId}`, param); | |||||
else | else | ||||
{ | { | ||||
// SendServer (`upload.php?name=${userName.value}&pass=${password.value}&msg=${message.value}`, param); | // SendServer (`upload.php?name=${userName.value}&pass=${password.value}&msg=${message.value}`, param); | ||||
await SendServer (`upload.php${window.location.search}&name=${userName.value}&pass=${password.value}&held=${held ? 1 : 0}&uniqid=${uniqId}`, param); | |||||
await SendServer (`/modules/upload.php${window.location.search}&name=${userName.value}&pass=${password.value}&held=${held ? 1 : 0}&uniqid=${uniqId}`, param); | |||||
} | } | ||||
} | } | ||||
@@ -1,3 +1,139 @@ | |||||
html | |||||
{ | |||||
font-size: 24px; | |||||
font-family: "Helvetica Neue", "Helvetica", "Segoe UI", "Arial", | |||||
"JPAGothic", "IPAGothic", | |||||
"Hiragino Sans", "Hiragino Kaku Gothic ProN", | |||||
"Yu Gothic", "Meiryo", "MS Gothic", | |||||
sans-serif; | |||||
width: 960px; | |||||
text-align: justify; | |||||
margin: auto; | |||||
punctuation-trim: adjacent; | |||||
} | |||||
em | |||||
{ | |||||
font-style: normal; | |||||
font-size: 120%; | |||||
font-weight: bold; | |||||
color: red; | |||||
font-family: "Helvetica Neue", "Helvetica", "Segoe UI", "Arial", | |||||
"JPAGothic", "IPAGothic", | |||||
"Hiragino Sans", "Hiragino Kaku Gothic ProN", | |||||
"Yu Gothic", "Meiryo", "MS Gothic", | |||||
sans-serif; | |||||
} | |||||
.miteruzochan | |||||
{ | |||||
white-space: nowrap; | |||||
} | |||||
section | |||||
{ | |||||
margin-bottom: 3em; | |||||
} | |||||
p:not(.noindent) | |||||
{ | |||||
text-indent: 1em; | |||||
} | |||||
p | |||||
{ | |||||
margin: 0 2em; | |||||
line-height: 3em; | |||||
} | |||||
.copy | |||||
{ | |||||
font-size: 200%; | |||||
font-weight: bold; | |||||
font-style: italic; | |||||
text-align: center; | |||||
font-family: "Times New Roman", | |||||
"JPAMincho", "IPAMincho", "Hiragino Mincho ProN", | |||||
"Yu Mincho", "MS Mincho", | |||||
serif; | |||||
margin: 1em 0; | |||||
} | |||||
footer | |||||
{ | |||||
font-size: 16px; | |||||
color: dimgray; | |||||
text-align: center; | |||||
line-height: 2em; | |||||
padding-bottom: 24px; | |||||
} | |||||
footer > div | |||||
{ | |||||
margin: 24px 0; | |||||
} | |||||
.copyright | |||||
{ | |||||
text-align: center; | |||||
margin: 24px 0; | |||||
} | |||||
footer a | |||||
{ | |||||
color: darkslategray; | |||||
} | |||||
a | |||||
{ | |||||
text-decoration: none; | |||||
} | |||||
div.paragraph | |||||
{ | |||||
margin-bottom: 1.5em; | |||||
} | |||||
table | |||||
{ | |||||
margin: auto; | |||||
} | |||||
tr:nth-child(odd) | |||||
{ | |||||
background-color: lightgray; | |||||
} | |||||
th, td | |||||
{ | |||||
padding: 8px 16px; | |||||
} | |||||
#title | |||||
{ | |||||
text-align: left; | |||||
display: inline-block; | |||||
} | |||||
#translate | |||||
{ | |||||
text-align: right; | |||||
display: inline-block; | |||||
width: 288px; | |||||
} | |||||
header | |||||
{ | |||||
display: flex; | |||||
justify-content: space-between; | |||||
align-items: center; | |||||
} | |||||
button, input | |||||
{ | |||||
font-size: 24px; | |||||
} | |||||
body | body | ||||
{ | { | ||||
background-color: aquamarine; | background-color: aquamarine; | ||||