8 コミット

作成者 SHA1 メッセージ 日付
みてるぞ 60b82f2ae2 Merge branch 'main' into KEKEC_BBS_DEV-001 2023-10-29 14:53:06 +09:00
みてるぞ 6c4e401d5a コーディング・スタイルの調整 2023-10-29 14:49:18 +09:00
みてるぞ 26d78aab88 修正 2023-09-01 02:06:03 +09:00
みてるぞ d13588c24f 本日作業分 2023-09-01 01:53:54 +09:00
みてるぞ 50996316e5 本日作業分 2023-09-01 01:03:57 +09:00
Gitea 34758dfa19 database.php の追加 2023-08-07 01:26:21 +09:00
Gitea a7a601c769 レイア削除で reDraw するやぅに変更 2023-07-09 19:30:31 +09:00
Gitea 0a96136e34 URL を相対パスにした. 2023-06-17 00:02:22 +09:00
15個のファイルの変更211行の追加41行の削除
+3 -2
ファイルの表示
@@ -1,3 +1,4 @@
/image /images
/draft /drafts
/database.php
バイナリ
ファイルの表示
バイナリファイルは表示されません.

変更後

幅:  |  高さ:  |  サイズ: 805 KiB

+12
ファイルの表示
@@ -0,0 +1,12 @@
<?php
function
set_mysql ($db)
{
$url = 'localhost';
$user = 'root';
$pass = '';
return new mysqli ($url, $user, $pass, $db);
}
+3 -4
ファイルの表示
@@ -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">&emsp;</a></div> <div style="text-align: center"><a href="#" onclick="PauseMusic ()" id="mute">&emsp;</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>
+22 -22
ファイルの表示
@@ -2,30 +2,28 @@
require_once "${_SERVER['DOCUMENT_ROOT']}/database.php"; require_once "${_SERVER['DOCUMENT_ROOT']}/database.php";
if (isset ($_GET['page'])): if (isset ($_GET['page']))
$page = $_GET['page']; $page = $_GET['page'];
else: else
$page = 0; $page = 0;
endif;
if (isset ($_GET['thread'])): if (isset ($_GET['thread']))
$thread = $_GET['thread']; $thread = $_GET['thread'];
else: else
$thread = -1; $thread = -1;
endif;
if (isset ($_GET['sort'])): if (isset ($_GET['sort']))
{
$sort = $_GET['sort']; $sort = $_GET['sort'];
if (!(in_array ($sort, array ('td', 'eg', 'ta', 'eb')))): if (!(in_array ($sort, array ('td', 'eg', 'ta', 'eb'))))
$sort = 'td'; $sort = 'td';
endif; }
else: else
$sort = 'td'; $sort = 'td';
endif;
// 画像のディレクトリを開く. // 画像のディレクトリを開く.
$dir = 'image/'; $dir = '/images/';
$handle = opendir ($dir); $handle = opendir ($dir);
// MySQL 宣言 // MySQL 宣言
@@ -33,18 +31,20 @@ $mysqli = set_mysql ('miteruzo_bbs');
$mysqli -> set_charset ('utf8'); $mysqli -> set_charset ('utf8');
if ($result = $mysqli -> query ("SELECT * FROM threads WHERE id = $thread")): if ($result = $mysqli -> query ("SELECT * FROM threads WHERE id = $thread"))
{
$row = $result -> fetch_assoc (); $row = $result -> fetch_assoc ();
$title = $row['title']; $title = $row['title'];
$explain = $row['explain']; $explain = $row['explain'];
$result -> close (); $result -> close ();
endif; }
if (isset ($_GET['id']) if (isset ($_GET['id'])
&& isset ($_GET['evaluate']) && isset ($_GET['evaluate'])
&& (($_GET['evaluate'] == 'good') || ($_GET['evaluate'] == 'bad'))): && (($_GET['evaluate'] == 'good') || ($_GET['evaluate'] == 'bad')))
{
$mysqli -> query (" $mysqli -> query ("
UPDATE UPDATE
responses responses
@@ -54,7 +54,7 @@ if (isset ($_GET['id'])
(thread_id = $thread) AND (response_id = {$_GET['id']})"); (thread_id = $thread) AND (response_id = {$_GET['id']})");
header ("Location: ./?thread=$thread&sort=$sort"); header ("Location: ./?thread=$thread&sort=$sort");
endif; }
require_once './forms/index.frm.php'; require_once './forms/index.frm.php';
+10
ファイルの表示
@@ -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));
+2
ファイルの表示
@@ -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;
+2
ファイルの表示
@@ -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;
+9 -3
ファイルの表示
@@ -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: *');
+2 -2
ファイルの表示
@@ -28,11 +28,11 @@ if ($result = $mysqli -> query ("
WHERE WHERE
(thread_id = $thread) AND (response_id = $id)"); (thread_id = $thread) AND (response_id = $id)");
echo "消しましたぁ!!<br /><br /><img style='border: solid 1px' src='image/{$row['image']}' />"; echo "消しましたぁ!!<br /><br /><img style='border: solid 1px' src='/images/{$row['image']}' />";
else: else:
echo '残念.<br />削除用パスワードが違います.'; echo '残念.<br />削除用パスワードが違います.';
endif; endif;
echo "<br /><br />5 秒後に元のページに戻ります.<br /><br /><a href='./?thread=$thread#$id'>戻らない場合はこちら</a><script>setTimeout (function () {window.location.href = `./?thread=$thread#$id`}, 5000)</script>"; echo "<br /><br />5 秒後に元のページに戻ります.<br /><br /><a href='/?thread=$thread#$id'>戻らない場合はこちら</a><script>setTimeout (function () {window.location.href = `/?thread=$thread#$id`}, 5000)</script>";
endif; endif;
+2 -2
ファイルの表示
@@ -17,7 +17,7 @@ if (!(empty ($_POST['thread-name'])))
$result -> close (); $result -> close ();
$sql = "INSERT INTO threads (id, title, `explain`, latest, length) VALUES ($current, '{$_POST['thread-name']}', '$explain', '" . date ('Y-m-d H:i:s') . "', 0)"; $sql = "INSERT INTO threads (title, `explain`, latest, length) VALUES ('{$_POST['thread-name']}', '$explain', '" . date ('Y-m-d H:i:s') . "', 0)";
$mysqli -> query ($sql); $mysqli -> query ($sql);
/* $sql = "CREATE TABLE `miteruzo_bbs`.`thread_$current` ( /* $sql = "CREATE TABLE `miteruzo_bbs`.`thread_$current` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT 'レス番', `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT 'レス番',
@@ -37,5 +37,5 @@ if (!(empty ($_POST['thread-name'])))
$mysqli -> close (); $mysqli -> close ();
} }
header ("location: ./?thread=$current"); header ("location: ../?thread=$current");
+2 -2
ファイルの表示
@@ -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 パラメタ
ファイルの表示
+6 -4
ファイルの表示
@@ -116,7 +116,7 @@ if (imageUrl != '')
reDraw (); reDraw ();
}, false); }, false);
imgData.src = `//miteruzo.ml/kekec/bbs/draft/${imageUrl}`; imgData.src = `./draft/${imageUrl}`;
} }
let nowDraw = false; // 描画フラグ let nowDraw = false; // 描画フラグ
@@ -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);
} }
} }
@@ -872,7 +872,7 @@ deletePostReally ()
{ {
const searchParams = new URLSearchParams (window.location.search); const searchParams = new URLSearchParams (window.location.search);
window.location.href = `./delete.php?thread=${searchParams.get ( window.location.href = `./modules/delete.php?thread=${searchParams.get (
'thread')}&id=${delId.value}&pass=${delPass.value}`; 'thread')}&id=${delId.value}&pass=${delPass.value}`;
} }
else else
@@ -1043,5 +1043,7 @@ delLayer (lyr, fromHistory)
layer: lyr}; layer: lyr};
++count; ++count;
} }
reDraw ();
} }
+136
ファイルの表示
@@ -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;