Browse Source

本日作業分

KEKEC_BBS_DEV-001
みてるぞ 1 year ago
parent
commit
d13588c24f
13 changed files with 170 additions and 13 deletions
  1. +2
    -0
      .gitignore
  2. BIN
      assets/kusobbs.gif
  3. +3
    -4
      forms/index.frm.php
  4. +1
    -1
      index.php
  5. +10
    -0
      migrate.php
  6. +2
    -0
      migrations/2023_09_01_011340_create_threads_table.sql
  7. +2
    -0
      migrations/2023_09_01_012000_create_responses_table.sql
  8. +9
    -3
      modules/backup.php
  9. +1
    -1
      modules/make_thread.php
  10. +2
    -2
      modules/upload.php
  11. +0
    -0
      scripts/colour-pad.js
  12. +2
    -2
      scripts/paint.js
  13. +136
    -0
      styles/style.css

+ 2
- 0
.gitignore View File

@@ -1,4 +1,6 @@
/image
/draft
/images
/drafts
/database.php


BIN
assets/kusobbs.gif View File

Before After
Width: 1990  |  Height: 390  |  Size: 805 KiB

+ 3
- 4
forms/index.frm.php View File

@@ -5,7 +5,6 @@
<meta name="robots" content="noindex" />
<title><?= ($title == '') ? '' : ($title . ' - ') ?>キケッツチャンネル お絵描き掲示板</title>
<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" 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>
@@ -42,11 +41,11 @@
</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>

<?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 />
スレ内容:<textarea name="thread-explain"></textarea><br />
<input type="submit" value="スレ立て" />
@@ -302,7 +301,7 @@
<canvas style="display: none" width="1" height="1" id="work"></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): ?>
<script type="text/javascript" src="./scripts/paint.js"></script>


+ 1
- 1
index.php View File

@@ -25,7 +25,7 @@ else:
endif;

// 画像のディレクトリを開く.
$dir = 'image/';
$dir = '/images/';
$handle = opendir ($dir);

// MySQL 宣言


+ 10
- 0
migrate.php View File

@@ -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
migrations/2023_09_01_011340_create_threads_table.sql View 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;


+ 2
- 0
migrations/2023_09_01_012000_create_responses_table.sql View File

@@ -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
modules/backup.php View File

@@ -1,17 +1,19 @@
<?php
define ('SAVE_DIR', 'draft/');
define ('SAVE_DIR', "${_SERVER['DOCUMENT_ROOT']}/drafts/");

$json = getParamJSON ();

if (!(isset ($json['data'])))
{
sendResult (false, 'Empty query Parameter: data');

exit (1);
}

if (!(preg_match ('/^data:image\/png;base64,/', $json['data'])))
{
sendResult (false, 'Not Allow data type: data');

exit (1);
}

@@ -27,7 +29,8 @@ setcookie ('backup', $file, time () + 60 * 60 * 24 * 30);


function
getParamJSON ()
getParamJSON ():
array
{
$buff = file_get_contents ('php://input');
$json = json_decode ($buff, true);
@@ -36,7 +39,10 @@ getParamJSON ()
}

function
sendResult ($status, $data)
sendResult (
$status,
$data):
string
{
header ('Access-Control-Allow-Origin: *');
header ('Access-Control-Allow-Headers: *');


+ 1
- 1
modules/make_thread.php View File

@@ -37,5 +37,5 @@ if (!(empty ($_POST['thread-name'])))
$mysqli -> close ();
}

header ("location: ./?thread=$current");
header ("location: ../?thread=$current");


+ 2
- 2
modules/upload.php View File

@@ -2,10 +2,10 @@
require "${_SERVER['DOCUMENT_ROOT']}/database.php";


define ('SAVE_DIR', 'image/'); // 保存ディレクトリ定義
define ('SAVE_DIR', "${_SERVER['DOCUMENT_ROOT']}/images/"); // 保存ディレクトリ定義

$thread = $_GET['thread'];
file_put_contents ('log.txt', $thread);
// file_put_contents ('log.txt', $thread);

$json = getParamJSON (); // JSON パラメタ



styles/colour-pad.js → scripts/colour-pad.js View File


+ 2
- 2
scripts/paint.js View File

@@ -219,11 +219,11 @@ SendToServer (backup)
mode: 'cors'};

if (backup)
await SendServer (`backup.php?id=${uniqId}`, param);
await SendServer (`/modules/backup.php?id=${uniqId}`, param);
else
{
// 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);
}
}



+ 136
- 0
styles/style.css View File

@@ -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
{
background-color: aquamarine;


Loading…
Cancel
Save