mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-04 19:14:41 +00:00
uwuzu version 1.2.21
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
<?php
|
||||
$mojisizefile = "../server/textsize.txt";
|
||||
|
||||
$banurldomainfile = "../server/banurldomain.txt";
|
||||
$banurl_info = file_get_contents($banurldomainfile);
|
||||
$banurl = preg_split("/\r\n|\n|\r/", $banurl_info);
|
||||
|
||||
header("Content-Type: application/json; charset=utf-8");
|
||||
|
||||
function createUniqId(){
|
||||
@@ -42,6 +48,39 @@ if(isset($_GET['token'])&&isset($_GET['ueuse'])) {
|
||||
$token = htmlentities($_GET['token']);
|
||||
$ueuse = nl2br(htmlentities($_GET['ueuse']));
|
||||
|
||||
if( empty($ueuse) ) {
|
||||
$err = "input_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
);
|
||||
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
} else {
|
||||
// 文字数を確認
|
||||
if( (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8') < mb_strlen($ueuse, 'UTF-8') ) {
|
||||
$err = "content_to_".htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8')."_characters";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
);
|
||||
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
// 禁止url確認
|
||||
for($i = 0; $i < count($banurl); $i++) {
|
||||
if (false !== strpos($ueuse, 'https://'.$banurl[$i])) {
|
||||
$err = "contains_prohibited_url";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
);
|
||||
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($token === 'ice'){
|
||||
$err = "input_error";
|
||||
$response = array(
|
||||
@@ -49,6 +88,7 @@ if(isset($_GET['token'])&&isset($_GET['ueuse'])) {
|
||||
);
|
||||
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}elseif($token === ''){
|
||||
$err = "input_error";
|
||||
$response = array(
|
||||
@@ -56,6 +96,7 @@ if(isset($_GET['token'])&&isset($_GET['ueuse'])) {
|
||||
);
|
||||
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
require('../db.php');
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
:root {
|
||||
--main-color: #FFC832;
|
||||
--sub-color: #FFFAE6;
|
||||
--background-color: #f5f5f5;
|
||||
--text-color: #252525;
|
||||
--subtext-color: #999;
|
||||
--link-color: #4e4428;
|
||||
--border-color: #EEE;
|
||||
/*Darkmode*/
|
||||
--dark-sub-color: #181616;
|
||||
--dark-background-color: #0c0c0c;
|
||||
--dark-subtext-color: #CCC;
|
||||
}
|
||||
+629
-511
File diff suppressed because it is too large
Load Diff
+52
-51
@@ -1,4 +1,5 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=BIZ+UDPGothic:wght@400;700&family=Josefin+Sans:ital,wght@1,700&family=Kosugi+Maru&family=Zen+Maru+Gothic:wght@500&display=swap');
|
||||
@import url("color.css");
|
||||
|
||||
body{
|
||||
display: flex;
|
||||
@@ -7,7 +8,7 @@ body{
|
||||
margin-bottom: 0px;
|
||||
margin-left: auto;
|
||||
margin-right: 0px;
|
||||
background-color: #FFFFFF;
|
||||
background-color: var(--background-color);
|
||||
/* 画像を常に天地左右の中央に配置 */
|
||||
background-position: center center;
|
||||
|
||||
@@ -24,7 +25,7 @@ body{
|
||||
.leftbox{
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
background-color: #FFC832;
|
||||
background-color: var(--main-color);
|
||||
width: 35%;
|
||||
height: 100%;
|
||||
margin-left: 0px;
|
||||
@@ -33,7 +34,7 @@ body{
|
||||
|
||||
.leftbox h1{
|
||||
margin-left: 20px;
|
||||
color:#fff;
|
||||
color:var(--background-color);
|
||||
font-size: 2em;
|
||||
}
|
||||
.leftbox .logo{
|
||||
@@ -48,7 +49,7 @@ body{
|
||||
|
||||
}
|
||||
.leftbox .logo p{
|
||||
color:#fff;
|
||||
color:var(--background-color);
|
||||
font-family: 'BIZ UDPGothic', sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 32px;
|
||||
@@ -60,7 +61,7 @@ body{
|
||||
.leftbox2{
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
background-color: #FFC832;
|
||||
background-color: var(--main-color);
|
||||
width: 35%;
|
||||
height: 100vh;
|
||||
margin-left: 0px;
|
||||
@@ -69,7 +70,7 @@ body{
|
||||
|
||||
.leftbox2 h1{
|
||||
margin-left: 20px;
|
||||
color:#fff;
|
||||
color:var(--background-color);
|
||||
font-size: 2em;
|
||||
}
|
||||
.leftbox2 .logo{
|
||||
@@ -84,7 +85,7 @@ body{
|
||||
|
||||
}
|
||||
.leftbox2 .logo p{
|
||||
color:#fff;
|
||||
color:var(--background-color);
|
||||
font-family: 'BIZ UDPGothic', sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 32px;
|
||||
@@ -101,14 +102,14 @@ body{
|
||||
margin-top: 64px;
|
||||
margin-bottom: 100px;
|
||||
border-radius: 25px;
|
||||
background-color: #fff;
|
||||
background-color: var(--background-color);
|
||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.textbox h1{
|
||||
word-wrap: break-word;
|
||||
margin: 0px;
|
||||
color: #FFC832;
|
||||
color: var(--main-color);
|
||||
font-size: 32px;
|
||||
font-family: 'Zen Maru Gothic', sans-serif;
|
||||
}
|
||||
@@ -198,7 +199,7 @@ body{
|
||||
width: 43%;
|
||||
height: 5dvh;
|
||||
border-radius: 15px;
|
||||
background-color: #FFFAE6;
|
||||
background-color: var(--sub-color);
|
||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05) inset;
|
||||
padding: 18px;
|
||||
}
|
||||
@@ -233,7 +234,7 @@ body{
|
||||
padding-left: 32px;
|
||||
padding-right: 32px;
|
||||
border-radius: 15px;
|
||||
background-color: #f7f7f7;
|
||||
background-color: var(--background-color);
|
||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05) inset;
|
||||
margin-top: 32px;
|
||||
text-align: center;
|
||||
@@ -259,11 +260,11 @@ label > input {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
|
||||
background-color: #FFC832;
|
||||
background-color: var(--main-color);
|
||||
|
||||
text-align: center;
|
||||
border-radius: 50px;
|
||||
color:#fff;
|
||||
color:var(--background-color);
|
||||
font-size: 22px;
|
||||
font-family: 'Zen Maru Gothic', sans-serif;
|
||||
font-weight: normal;
|
||||
@@ -297,10 +298,10 @@ label > input {
|
||||
|
||||
|
||||
text-align: center;
|
||||
background-color: #FFFAE6;
|
||||
background-color: var(--sub-color);
|
||||
|
||||
border-radius: 50px;
|
||||
color:#FFC832;
|
||||
color:var(--main-color);
|
||||
font-size: 22px;
|
||||
font-family: 'Zen Maru Gothic', sans-serif;
|
||||
font-weight: normal;
|
||||
@@ -324,7 +325,7 @@ label > input {
|
||||
padding-left: 32px;
|
||||
padding-right: 32px;
|
||||
border-radius: 15px;
|
||||
background-color: #f7f7f7;
|
||||
background-color: var(--background-color);
|
||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05) inset;
|
||||
margin-top: 64px;
|
||||
text-align: left;
|
||||
@@ -365,7 +366,7 @@ label > input {
|
||||
padding-left: 32px;
|
||||
padding-right: 32px;
|
||||
border-radius: 15px;
|
||||
background-color: #f7f7f7;
|
||||
background-color: var(--background-color);
|
||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05) inset;
|
||||
margin-top: 64px;
|
||||
text-align: center;
|
||||
@@ -409,7 +410,7 @@ label > input {
|
||||
padding: 8px 10px;
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
background: #fff;
|
||||
background: var(--background-color);
|
||||
font-family: 'Zen Maru Gothic', sans-serif;
|
||||
color: rgb(32,32,32);
|
||||
font-size: 1em;
|
||||
@@ -430,13 +431,13 @@ label > input {
|
||||
|
||||
.inbox:hover {
|
||||
outline: none;
|
||||
border: 1px solid #FFC832;
|
||||
border: 1px solid var(--main-color);
|
||||
}
|
||||
|
||||
.inbox:focus {
|
||||
outline: none;
|
||||
border: 1px solid #FFC832;
|
||||
border-bottom: 3px solid #FFC832;
|
||||
border: 1px solid var(--main-color);
|
||||
border-bottom: 3px solid var(--main-color);
|
||||
}
|
||||
|
||||
|
||||
@@ -475,10 +476,10 @@ label > input {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
|
||||
background-color: #FFC832;
|
||||
background-color: var(--main-color);
|
||||
|
||||
border-radius: 50px;
|
||||
color:#fff;
|
||||
color:var(--background-color);
|
||||
font-size: 26px;
|
||||
font-family: 'Zen Maru Gothic', sans-serif;
|
||||
font-weight: normal;
|
||||
@@ -509,10 +510,10 @@ label > input {
|
||||
padding-bottom: 8px;
|
||||
|
||||
|
||||
background-color: #FFFAE6;
|
||||
background-color: var(--sub-color);
|
||||
|
||||
border-radius: 50px;
|
||||
color:#FFC832;
|
||||
color:var(--main-color);
|
||||
font-size: 26px;
|
||||
font-family: 'Zen Maru Gothic', sans-serif;
|
||||
font-weight: normal;
|
||||
@@ -541,8 +542,8 @@ label > input {
|
||||
padding-left: auto;
|
||||
padding-right: auto;
|
||||
|
||||
background-color: #fff;
|
||||
border: 1px solid #FFC832;
|
||||
background-color: var(--background-color);
|
||||
border: 1px solid var(--main-color);
|
||||
|
||||
border-radius: 25px;
|
||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
|
||||
@@ -551,7 +552,7 @@ label > input {
|
||||
|
||||
.rolebox p{
|
||||
|
||||
color:#FFC832;
|
||||
color:var(--main-color);
|
||||
margin-top: 2px;
|
||||
margin-bottom: 2px;
|
||||
margin-left: 10px;
|
||||
@@ -567,7 +568,7 @@ label > input {
|
||||
.userleftbox{
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
background-color: #FFC832;
|
||||
background-color: var(--main-color);
|
||||
width: 10%;
|
||||
height: 100%;
|
||||
margin-left: 0px;
|
||||
@@ -577,7 +578,7 @@ label > input {
|
||||
.userleftbox h1{
|
||||
font-family: 'Zen Maru Gothic', sans-serif;
|
||||
margin-left: 20px;
|
||||
color:#fff;
|
||||
color:var(--background-color);
|
||||
font-size: 32px;
|
||||
}
|
||||
.userleftbox .logo{
|
||||
@@ -592,7 +593,7 @@ label > input {
|
||||
|
||||
}
|
||||
.userleftbox .logo p{
|
||||
color:#fff;
|
||||
color:var(--background-color);
|
||||
font-family: 'BIZ UDPGothic', sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 32px;
|
||||
@@ -615,10 +616,10 @@ label > input {
|
||||
padding-bottom: 8px;
|
||||
|
||||
|
||||
background-color: #FFC832;
|
||||
background-color: var(--main-color);
|
||||
|
||||
border-radius: 50px;
|
||||
color:#FFFAE6;
|
||||
color:var(--sub-color);
|
||||
font-size: 20px;
|
||||
font-family: 'Zen Maru Gothic', sans-serif;
|
||||
font-weight: normal;
|
||||
@@ -629,8 +630,8 @@ label > input {
|
||||
transition: all 250ms ease-out;
|
||||
}
|
||||
.leftbutton:hover{
|
||||
background-color: #FFFAE6;
|
||||
color: #FFC832;
|
||||
background-color: var(--sub-color);
|
||||
color: var(--main-color);
|
||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
|
||||
width:75%;
|
||||
}
|
||||
@@ -645,7 +646,7 @@ main{
|
||||
margin-left: 24px;
|
||||
margin-right: 24px;
|
||||
width: 80%;
|
||||
background-color: #fff;
|
||||
background-color: var(--background-color);
|
||||
padding: 24px;
|
||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
|
||||
}
|
||||
@@ -680,10 +681,10 @@ main h1{
|
||||
padding-bottom: 6px;
|
||||
|
||||
|
||||
background-color: #FFC832;
|
||||
background-color: var(--main-color);
|
||||
|
||||
border-radius: 50px;
|
||||
color:#FFFAE6;
|
||||
color:var(--sub-color);
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
font-family: 'Zen Maru Gothic', sans-serif;
|
||||
@@ -695,8 +696,8 @@ main h1{
|
||||
transition: all 250ms ease-out;
|
||||
}
|
||||
.fbtn:hover{
|
||||
background-color: #FFC832;
|
||||
color: #FFFAE6;
|
||||
background-color: var(--main-color);
|
||||
color: var(--sub-color);
|
||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
|
||||
width:55%;
|
||||
}
|
||||
@@ -739,12 +740,12 @@ main h1{
|
||||
|
||||
.leftbox h1{
|
||||
margin-left: 20px;
|
||||
color:#fff;
|
||||
color:var(--background-color);
|
||||
font-size: 2em;
|
||||
}
|
||||
.leftbox .logo{
|
||||
display: flex;
|
||||
background-color: #FFC832;
|
||||
background-color: var(--main-color);
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
@@ -756,7 +757,7 @@ main h1{
|
||||
|
||||
}
|
||||
.leftbox .logo p{
|
||||
color:#fff;
|
||||
color:var(--background-color);
|
||||
font-family: 'BIZ UDPGothic', sans-serif;
|
||||
font-weight: bold;
|
||||
font-size: 32px;
|
||||
@@ -774,14 +775,14 @@ main h1{
|
||||
margin-top: 64px;
|
||||
margin-bottom: 8px;
|
||||
border-radius: 25px;
|
||||
background-color: #fff;
|
||||
background-color: var(--background-color);
|
||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.textbox h1{
|
||||
word-wrap: break-word;
|
||||
margin: 0px;
|
||||
color: #FFC832;
|
||||
color: var(--main-color);
|
||||
font-size: 32px;
|
||||
font-family: 'Zen Maru Gothic', sans-serif;
|
||||
}
|
||||
@@ -793,7 +794,7 @@ main h1{
|
||||
padding-left: 12px;
|
||||
padding-right: 12px;
|
||||
border-radius: 15px;
|
||||
background-color: #f7f7f7;
|
||||
background-color: var(--background-color);
|
||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05) inset;
|
||||
margin-top: 32px;
|
||||
text-align: center;
|
||||
@@ -850,10 +851,10 @@ main h1{
|
||||
padding-bottom: 12px;
|
||||
|
||||
|
||||
background-color: #FFC832;
|
||||
background-color: var(--main-color);
|
||||
|
||||
border-radius: 50px;
|
||||
color:#FFFAE6;
|
||||
color:var(--sub-color);
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
font-family: 'Zen Maru Gothic', sans-serif;
|
||||
@@ -865,8 +866,8 @@ main h1{
|
||||
transition: all 250ms ease-out;
|
||||
}
|
||||
.fbtn:hover{
|
||||
background-color: #FFC832;
|
||||
color: #FFFAE6;
|
||||
background-color: var(--main-color);
|
||||
color: var(--sub-color);
|
||||
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
|
||||
width:55%;
|
||||
}
|
||||
@@ -878,7 +879,7 @@ main h1{
|
||||
.leftbox2{
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
background-color: #FFC832;
|
||||
background-color: var(--main-color);
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
margin-left: 0px;
|
||||
|
||||
+26
-3
@@ -1,6 +1,12 @@
|
||||
<?php
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
$mojisizefile = "../server/textsize.txt";
|
||||
|
||||
$banurldomainfile = "../server/banurldomain.txt";
|
||||
$banurl_info = file_get_contents($banurldomainfile);
|
||||
$banurl = preg_split("/\r\n|\n|\r/", $banurl_info);
|
||||
|
||||
function createUniqId(){
|
||||
list($msec, $sec) = explode(" ", microtime());
|
||||
$hashCreateTime = $sec.floor($msec*1000000);
|
||||
@@ -191,8 +197,15 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
$error_message[] = '内容を入力してください。';
|
||||
} else {
|
||||
// 文字数を確認
|
||||
if( 1024 < mb_strlen($ueuse, 'UTF-8') ) {
|
||||
$error_message[] = '内容は1024文字以内で入力してください。';
|
||||
if( (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8') < mb_strlen($ueuse, 'UTF-8') ) {
|
||||
$error_message[] = '内容は'.htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8').'文字以内で入力してください。';
|
||||
}
|
||||
|
||||
// 禁止url確認
|
||||
for($i = 0; $i < count($banurl); $i++) {
|
||||
if (false !== strpos($ueuse, 'https://'.$banurl[$i])) {
|
||||
$error_message[] = '投稿が禁止されているURLが含まれています。';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -523,6 +536,10 @@ if ("serviceWorker" in navigator) {
|
||||
<div id="loading" class="loading" style="display: none;">
|
||||
🤔
|
||||
</div>
|
||||
<div id="error" class="error" style="display: none;">
|
||||
<h1>エラー</h1>
|
||||
<p>サーバーの応答がなかったか不完全だったようです。<br>ネットワークの接続が正常かを確認の上再読み込みしてください。</p>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
@@ -576,12 +593,18 @@ function loadPosts() {
|
||||
method: 'GET',
|
||||
data: { page: pageNumber, userid: userid },
|
||||
dataType: 'html',
|
||||
timeout: 300000,
|
||||
success: function(response) {
|
||||
$('#postContainer').append(response);
|
||||
pageNumber++;
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
}
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) { // エラーと判定された場合
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
$("#error").show();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+29
-5
@@ -1,6 +1,12 @@
|
||||
<?php
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
$mojisizefile = "../server/textsize.txt";
|
||||
|
||||
$banurldomainfile = "../server/banurldomain.txt";
|
||||
$banurl_info = file_get_contents($banurldomainfile);
|
||||
$banurl = preg_split("/\r\n|\n|\r/", $banurl_info);
|
||||
|
||||
function createUniqId(){
|
||||
list($msec, $sec) = explode(" ", microtime());
|
||||
$hashCreateTime = $sec.floor($msec*1000000);
|
||||
@@ -190,9 +196,17 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
$error_message[] = '内容を入力してください。';
|
||||
} else {
|
||||
// 文字数を確認
|
||||
if( 1024 < mb_strlen($ueuse, 'UTF-8') ) {
|
||||
$error_message[] = '内容は1024文字以内で入力してください。';
|
||||
if( (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8') < mb_strlen($ueuse, 'UTF-8') ) {
|
||||
$error_message[] = '内容は'.htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8').'文字以内で入力してください。';
|
||||
}
|
||||
|
||||
// 禁止url確認
|
||||
for($i = 0; $i < count($banurl); $i++) {
|
||||
if (false !== strpos($ueuse, 'https://'.$banurl[$i])) {
|
||||
$error_message[] = '投稿が禁止されているURLが含まれています。';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -554,6 +568,10 @@ if ("serviceWorker" in navigator) {
|
||||
<div id="loading" class="loading" style="display: none;">
|
||||
🤔
|
||||
</div>
|
||||
<div id="error" class="error" style="display: none;">
|
||||
<h1>エラー</h1>
|
||||
<p>サーバーの応答がなかったか不完全だったようです。<br>ネットワークの接続が正常かを確認の上再読み込みしてください。</p>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
@@ -606,12 +624,18 @@ $(document).ready(function() {
|
||||
method: 'GET',
|
||||
data: { page: pageNumber, userid: userid },
|
||||
dataType: 'html',
|
||||
timeout: 300000,
|
||||
success: function(response) {
|
||||
$('#postContainer').append(response);
|
||||
pageNumber++;
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
}
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) { // エラーと判定された場合
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
$("#error").show();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -655,10 +679,10 @@ $(document).ready(function() {
|
||||
// いいね成功時の処理
|
||||
if (isLiked) {
|
||||
$this.removeClass('favbtn_after'); // クラスを削除していいねを取り消す
|
||||
$this.find('img').attr('src', '../img/sysimage/favorite_1.svg'); // 画像を元の画像に戻す
|
||||
$this.find('use').attr('xlink:href', '../img/sysimage/favorite_1.svg#favorite'); // 画像を元の画像に戻す
|
||||
} else {
|
||||
$this.addClass('favbtn_after'); // クラスを追加していいねを追加する
|
||||
$this.find('img').attr('src', '../img/sysimage/favorite_2.svg'); // 画像を新しい画像に置き換える
|
||||
$this.find('use').attr('xlink:href', '../img/sysimage/favorite_2.svg#favorite'); // 画像を新しい画像に置き換える
|
||||
}
|
||||
|
||||
var newFavoriteList = response.newFavorite.split(',');
|
||||
|
||||
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFC832"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"/></svg>
|
||||
<svg version="1.1" id="favorite" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"/></svg>
|
||||
|
Before Width: | Height: | Size: 502 B After Width: | Height: | Size: 472 B |
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFFFFF"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>
|
||||
<svg version="1.1" id="favorite" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>
|
||||
|
Before Width: | Height: | Size: 333 B After Width: | Height: | Size: 303 B |
@@ -9,7 +9,8 @@
|
||||
{
|
||||
"src": "icon-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
<?php
|
||||
|
||||
$banuseridfile = "server/banuserid.txt";
|
||||
$banuserid_info = file_get_contents($banuseridfile);
|
||||
|
||||
$banuserid = preg_split("/\r\n|\n|\r/", $banuserid_info);
|
||||
|
||||
function createUniqId(){
|
||||
list($msec, $sec) = explode(" ", microtime());
|
||||
$hashCreateTime = $sec.floor($msec*1000000);
|
||||
@@ -221,7 +226,7 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||
);
|
||||
|
||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
|
||||
|
||||
if($onlyuser === "true"){
|
||||
$query = $dbh->prepare('SELECT * FROM invitation WHERE code = :code limit 1');
|
||||
@@ -273,16 +278,7 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
$error_message[] = 'IDは20文字以内で入力してください。';
|
||||
}
|
||||
|
||||
if($userid === 'uwuzu_official'){
|
||||
$error_message[] = 'そのIDは登録禁止になっています。';
|
||||
}
|
||||
if($userid === 'uwuzu'){
|
||||
$error_message[] = 'そのIDは登録禁止になっています。';
|
||||
}
|
||||
if($userid === 'admin'){
|
||||
$error_message[] = 'そのIDは登録禁止になっています。';
|
||||
}
|
||||
if($userid === 'root'){
|
||||
if(in_array($userid, $banuserid) === true ){
|
||||
$error_message[] = 'そのIDは登録禁止になっています。';
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ try {
|
||||
$uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : '';
|
||||
$userid = htmlentities($_GET['userid']);
|
||||
|
||||
$itemsPerPage = 30; // 1ページあたりのユーズ数
|
||||
$itemsPerPage = 15; // 1ページあたりのユーズ数
|
||||
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
|
||||
$offset = ($pageNumber - 1) * $itemsPerPage;
|
||||
|
||||
@@ -81,6 +81,23 @@ if (!empty($pdo)) {
|
||||
$message['reply_count'] = $rpData['reply_count'];
|
||||
}
|
||||
}
|
||||
//adsystem------------------
|
||||
|
||||
$message['ads'] = "false";
|
||||
|
||||
$today = date("Y-m-d H:i:s");
|
||||
|
||||
$adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()");
|
||||
$adsQuery->bindValue(':today', $today);
|
||||
$adsQuery->execute();
|
||||
$adsresult = $adsQuery->fetch();
|
||||
if(!(empty($adsresult))){
|
||||
$message['ads'] = "true";
|
||||
$message['ads_url'] = $adsresult["url"];
|
||||
$message['ads_img_url'] = $adsresult["image_url"];
|
||||
$message['ads_memo'] = $adsresult["memo"];
|
||||
}
|
||||
//--------------------------
|
||||
|
||||
if(!empty($messages)){
|
||||
foreach ($messages as $value) {
|
||||
@@ -94,6 +111,9 @@ if (!empty($pdo)) {
|
||||
$messageDisplay = new MessageDisplay($value, $userid);
|
||||
$messageDisplay->display();
|
||||
}
|
||||
if($message['ads'] === "true"){
|
||||
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
|
||||
}
|
||||
}else{
|
||||
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>';
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ try {
|
||||
$uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : '';
|
||||
$userid = htmlentities($_GET['userid']);
|
||||
|
||||
$itemsPerPage = 30; // 1ページあたりのユーズ数
|
||||
$itemsPerPage = 15; // 1ページあたりのユーズ数
|
||||
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
|
||||
$offset = ($pageNumber - 1) * $itemsPerPage;
|
||||
|
||||
@@ -81,6 +81,24 @@ if (!empty($pdo)) {
|
||||
}
|
||||
}
|
||||
|
||||
//adsystem------------------
|
||||
|
||||
$message['ads'] = "false";
|
||||
|
||||
$today = date("Y-m-d H:i:s");
|
||||
|
||||
$adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()");
|
||||
$adsQuery->bindValue(':today', $today);
|
||||
$adsQuery->execute();
|
||||
$adsresult = $adsQuery->fetch();
|
||||
if(!(empty($adsresult))){
|
||||
$message['ads'] = "true";
|
||||
$message['ads_url'] = $adsresult["url"];
|
||||
$message['ads_img_url'] = $adsresult["image_url"];
|
||||
$message['ads_memo'] = $adsresult["memo"];
|
||||
}
|
||||
//--------------------------
|
||||
|
||||
if(!empty($messages)){
|
||||
foreach ($messages as $value) {
|
||||
|
||||
@@ -93,6 +111,9 @@ if (!empty($pdo)) {
|
||||
$messageDisplay = new MessageDisplay($value, $userid);
|
||||
$messageDisplay->display();
|
||||
}
|
||||
if($message['ads'] === "true"){
|
||||
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
|
||||
}
|
||||
}else{
|
||||
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>';
|
||||
}
|
||||
|
||||
+22
-1
@@ -29,7 +29,7 @@ try {
|
||||
$uwuzuid = htmlentities(isset($_GET['id'])) ? htmlentities($_GET['id']) : '';
|
||||
$userid = htmlentities($_GET['userid']);
|
||||
|
||||
$itemsPerPage = 30; // 1ページあたりのユーズ数
|
||||
$itemsPerPage = 15; // 1ページあたりのユーズ数
|
||||
$pageNumber = htmlentities(isset($_GET['page'])) ? htmlentities(intval($_GET['page'])) : 1;
|
||||
$offset = ($pageNumber - 1) * $itemsPerPage;
|
||||
|
||||
@@ -81,6 +81,24 @@ if (!empty($pdo)) {
|
||||
}
|
||||
}
|
||||
|
||||
//adsystem------------------
|
||||
|
||||
$message['ads'] = "false";
|
||||
|
||||
$today = date("Y-m-d H:i:s");
|
||||
|
||||
$adsQuery = $pdo->prepare("SELECT * FROM ads WHERE start_date < :today AND limit_date > :today ORDER BY rand()");
|
||||
$adsQuery->bindValue(':today', $today);
|
||||
$adsQuery->execute();
|
||||
$adsresult = $adsQuery->fetch();
|
||||
if(!(empty($adsresult))){
|
||||
$message['ads'] = "true";
|
||||
$message['ads_url'] = $adsresult["url"];
|
||||
$message['ads_img_url'] = $adsresult["image_url"];
|
||||
$message['ads_memo'] = $adsresult["memo"];
|
||||
}
|
||||
//--------------------------
|
||||
|
||||
if(!empty($messages)){
|
||||
foreach ($messages as $value) {
|
||||
|
||||
@@ -93,6 +111,9 @@ if (!empty($pdo)) {
|
||||
$messageDisplay = new MessageDisplay($value, $userid);
|
||||
$messageDisplay->display();
|
||||
}
|
||||
if($message['ads'] === "true"){
|
||||
echo '<div class="ads"><a href = "' . htmlentities($message['ads_url']) . '"><img src="' . htmlentities($message['ads_img_url']) . '" title="' . htmlentities($message['ads_memo']) . '"></a></div>';
|
||||
}
|
||||
}else{
|
||||
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>';
|
||||
}
|
||||
|
||||
+3
-3
@@ -65,7 +65,7 @@ function replaceEmojisWithImages($postText) {
|
||||
|
||||
function replaceURLsWithLinks($postText) {
|
||||
// URLを正規表現を使って検出
|
||||
$pattern = '/(https?:\/\/[^\s]+)/';
|
||||
$pattern = '/(https:\/\/[^\s]+)/';
|
||||
preg_match_all($pattern, $postText, $matches);
|
||||
|
||||
// 検出したURLごとに処理を行う
|
||||
@@ -167,9 +167,9 @@ class MessageDisplay {
|
||||
echo '<hr>';
|
||||
echo '<div class="favbox">';
|
||||
if (false !== strstr($this->value['favorite'], $this->userid)) {
|
||||
echo '<button class="favbtn favbtn_after" id="favbtn" data-uniqid="' . htmlentities($this->value['uniqid']) . '" data-userid2="' . htmlentities($this->value['account']) . '"><img src="../img/sysimage/favorite_2.svg" alt="いいね" /> <span class="like-count">' . htmlentities($this->value['favcnt']) . '</span></button>';
|
||||
echo '<button class="favbtn favbtn_after" id="favbtn" data-uniqid="' . htmlentities($this->value['uniqid']) . '" data-userid2="' . htmlentities($this->value['account']) . '"><svg><use xlink:href="../img/sysimage/favorite_2.svg#favorite" alt="いいね"></use></svg> <span class="like-count">' . htmlentities($this->value['favcnt']) . '</span></button>';
|
||||
}else{
|
||||
echo '<button class="favbtn" id="favbtn" data-uniqid="' . htmlentities($this->value['uniqid']) . '" data-userid2="' . htmlentities($this->value['account']) . '"><img src="../img/sysimage/favorite_1.svg" alt="いいね" /> <span class="like-count">' . htmlentities($this->value['favcnt']) . '</span></button>';
|
||||
echo '<button class="favbtn" id="favbtn" data-uniqid="' . htmlentities($this->value['uniqid']) . '" data-userid2="' . htmlentities($this->value['account']) . '"><svg><use xlink:href="../img/sysimage/favorite_1.svg#favorite" alt="いいね"></use></svg> <span class="like-count">' . htmlentities($this->value['favcnt']) . '</span></button>';
|
||||
}
|
||||
echo '<a href="/!'.htmlentities($this->value['uniqid']). '~' . htmlentities($this->value['account']) . '" class="tuduki"><svg><use xlink:href="../img/sysimage/reply_1.svg#reply_1"></use></svg>'.htmlentities($this->value['reply_count']).'</a>';
|
||||
if($this->value['account'] === $this->userid){
|
||||
|
||||
+11
-1
@@ -215,6 +215,10 @@ $pdo = null;
|
||||
<div id="loading" class="loading" style="display: none;">
|
||||
🤔
|
||||
</div>
|
||||
<div id="error" class="error" style="display: none;">
|
||||
<h1>エラー</h1>
|
||||
<p>サーバーの応答がなかったか不完全だったようです。<br>ネットワークの接続が正常かを確認の上再読み込みしてください。</p>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@@ -281,11 +285,17 @@ $(document).ready(function() {
|
||||
method: 'GET',
|
||||
data: { keyword: keyword, userid: userid },
|
||||
dataType: 'html',
|
||||
timeout: 300000,
|
||||
success: function(response) {
|
||||
$('#postContainer').append(response);
|
||||
$("#loading").hide();
|
||||
isLoading = false;
|
||||
}
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) { // エラーと判定された場合
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
$("#error").show();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
uwuzu
|
||||
uwuzu_official
|
||||
uwuzu_system
|
||||
uwuzu_support
|
||||
uwuzu_admin
|
||||
system
|
||||
sys
|
||||
admin
|
||||
administrator
|
||||
sysadmin
|
||||
root
|
||||
superuser
|
||||
support
|
||||
supports
|
||||
manager
|
||||
operator
|
||||
service
|
||||
system
|
||||
guest
|
||||
test
|
||||
demo
|
||||
developer
|
||||
dev
|
||||
engineer
|
||||
dba
|
||||
network
|
||||
host
|
||||
mod
|
||||
moderator
|
||||
staff
|
||||
auth
|
||||
i
|
||||
me
|
||||
everyone
|
||||
all
|
||||
mention
|
||||
mentions
|
||||
example
|
||||
user
|
||||
users
|
||||
account
|
||||
accounts
|
||||
help
|
||||
helps
|
||||
info
|
||||
infomation
|
||||
notice
|
||||
notification
|
||||
tech
|
||||
@@ -0,0 +1 @@
|
||||
1024
|
||||
@@ -1,4 +1,4 @@
|
||||
uwuzu
|
||||
1.2.20
|
||||
2023/09/10
|
||||
1.2.21
|
||||
2023/09/11
|
||||
daichimarukana,putonfps
|
||||
@@ -1,6 +1,22 @@
|
||||
## リリースノートだぜぇぇぇぇぇぇい!!!!!!!
|
||||
ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...)
|
||||
|
||||
## Version 1.2.21
|
||||
リリース日:2023/09/11
|
||||
PC向けUIを若干変更しました!
|
||||
登録禁止ユーザーidを設定できるようにしました!
|
||||
投稿の最大文字数を設定できるようにしました!
|
||||
特定のドメインを含む投稿を禁止できるようにしました。
|
||||
いいねボタンのアイコン表示形式を変更しました。
|
||||
サーバーカスタマイズ機能を実装しました!
|
||||
ユーザーページにも広告を表示するようにしました。
|
||||
広告の表示頻度を投稿15件につき1件にしました。
|
||||
投稿を取得するajax通信に失敗したときにエラーを表示するようにしました。
|
||||
投稿に含まれるURLがSSL対応でないとクリックできないようにしました。
|
||||
ロール作成・付与・管理機能を実装しました!
|
||||
その他使い勝手を若干向上させました!
|
||||
PWAのアイコンに白い縁が出来てしまう問題を修正しました。
|
||||
|
||||
## Version 1.2.20
|
||||
リリース日:2023/09/10
|
||||
LTLにFTLが表示される問題を修正しました。
|
||||
|
||||
@@ -324,7 +324,7 @@ if (!empty($pdo)) {
|
||||
<div class="admin_right">
|
||||
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||
<h1>広告追加</h1>
|
||||
<p>広告はLTL・FTL・返信画面に表示されます。<br>また、投稿10件につき一件の広告がランダムに選ばれ表示されます。<br>表示の優先順位は設定できません。</p>
|
||||
<p>広告はLTL・FTL・返信画面に表示されます。<br>また、投稿15件につき一件の広告がランダムに選ばれ表示されます。<br>表示の優先順位は設定できません。</p>
|
||||
<div>
|
||||
<p>クリックした時のリダイレクト先URL</p>
|
||||
<div class="p2">広告をクリックするとこのURLに飛びます。</div>
|
||||
@@ -338,12 +338,12 @@ if (!empty($pdo)) {
|
||||
<div>
|
||||
<p>掲載開始日時</p>
|
||||
<div class="p2">広告の掲載開始日時です。</div>
|
||||
<input type="date" name="ads_start_date" class="inbox" value="2023-08-16">
|
||||
<input type="date" name="ads_start_date" class="inbox" value="">
|
||||
</div>
|
||||
<div>
|
||||
<p>掲載終了日時</p>
|
||||
<div class="p2">広告の掲載終了日時です。</div>
|
||||
<input type="date" name="ads_limit_date" class="inbox" value="2023-08-17">
|
||||
<input type="date" name="ads_limit_date" class="inbox" value="">
|
||||
</div>
|
||||
<div>
|
||||
<p>広告のメモ</p>
|
||||
|
||||
@@ -0,0 +1,280 @@
|
||||
<?php
|
||||
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
$contactfile = "../server/contact.txt";
|
||||
|
||||
$adminfile = "../server/admininfo.txt";
|
||||
|
||||
$serverstopfile = "../server/serverstop.txt";
|
||||
|
||||
$mojisizefile = "../server/textsize.txt";
|
||||
|
||||
$colorfile = "../css/color.css";
|
||||
$color_info = file_get_contents($colorfile);
|
||||
|
||||
$err404imagefile = "../server/404imagepath.txt";
|
||||
|
||||
$robots = "../robots.txt";
|
||||
|
||||
function createUniqId(){
|
||||
list($msec, $sec) = explode(" ", microtime());
|
||||
$hashCreateTime = $sec.floor($msec*1000000);
|
||||
|
||||
$hashCreateTime = strrev($hashCreateTime);
|
||||
|
||||
return base_convert($hashCreateTime,10,36);
|
||||
}
|
||||
function random_code($length = 8){
|
||||
return substr(str_shuffle('1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, $length);
|
||||
}
|
||||
|
||||
require('../db.php');
|
||||
|
||||
// 変数の初期化
|
||||
$datetime = array();
|
||||
$user_name = null;
|
||||
$message = array();
|
||||
$message_data = null;
|
||||
$error_message = array();
|
||||
$pdo = null;
|
||||
$stmt = null;
|
||||
$res = null;
|
||||
$option = null;
|
||||
|
||||
session_name('uwuzu_s_id');
|
||||
session_start();
|
||||
session_regenerate_id(true);
|
||||
|
||||
try {
|
||||
|
||||
$option = array(
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||
);
|
||||
$pdo = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
|
||||
} catch(PDOException $e) {
|
||||
|
||||
// 接続エラーのときエラー内容を取得する
|
||||
$error_message[] = $e->getMessage();
|
||||
}
|
||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', $_SESSION['userid']);
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
if(empty($res["userid"])){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){
|
||||
// セッションに値をセット
|
||||
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
|
||||
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
|
||||
$loginid = $res["loginid"];
|
||||
$_SESSION['admin_login'] = true;
|
||||
$_SESSION['userid'] = $userid;
|
||||
$_SESSION['username'] = $username;
|
||||
$_SESSION['loginid'] = $res["loginid"];
|
||||
setcookie('userid', $userid, [
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('username', $username,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('loginid', $res["loginid"],[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('admin_login', true,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
}else{
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', $_COOKIE['userid']);
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
if(empty($res["userid"])){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){
|
||||
// セッションに値をセット
|
||||
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
|
||||
$username = $_COOKIE['username']; // クッキーから取得した値をセット
|
||||
$loginid = $res["loginid"];
|
||||
$_SESSION['admin_login'] = true;
|
||||
$_SESSION['userid'] = $userid;
|
||||
$_SESSION['username'] = $username;
|
||||
$_SESSION['loginid'] = $res["loginid"];
|
||||
setcookie('userid', $userid,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('username', $username,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('loginid', $res["loginid"],[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('admin_login', true,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
}else{
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
// ログインが許可されていない場合、ログインページにリダイレクト
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
if(empty($userid)){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
if(empty($username)){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!($res["admin"] === "yes")){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||
$notiQuery->bindValue(':userid', $userid);
|
||||
$notiQuery->execute();
|
||||
$notiData = $notiQuery->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$notificationcount = $notiData['notification_count'];
|
||||
|
||||
if( !empty($pdo) ) {
|
||||
|
||||
// データベース接続の設定
|
||||
$dbh = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||
));
|
||||
|
||||
$userQuery = $dbh->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid");
|
||||
$userQuery->bindValue(':userid', $userid);
|
||||
$userQuery->execute();
|
||||
$userData = $userQuery->fetch();
|
||||
|
||||
$role = $userData["role"];
|
||||
|
||||
$dbh = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
|
||||
$rerole = $dbh->prepare("SELECT username, userid, password, mailadds, profile, iconname, headname, role, datetime FROM account WHERE userid = :userid");
|
||||
|
||||
$rerole->bindValue(':userid', $userid);
|
||||
// SQL実行
|
||||
$rerole->execute();
|
||||
|
||||
$userdata = $rerole->fetch(); // ここでデータベースから取得した値を $role に代入する
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!empty($pdo)) {
|
||||
|
||||
$sql = "SELECT code,used,datetime FROM invitation ORDER BY datetime DESC";
|
||||
$invcode = $pdo->query($sql);
|
||||
|
||||
while ($row = $invcode->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
$codes[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
// 空白除去
|
||||
$colordata = $_POST['colordata'];
|
||||
|
||||
//鯖名
|
||||
$file = fopen($colorfile, 'w');
|
||||
$data = $colordata;
|
||||
fputs($file, $data);
|
||||
fclose($file);
|
||||
|
||||
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||
header("Location:".$url."");
|
||||
exit;
|
||||
}
|
||||
require('../logout/logout.php');
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||
<title>サーバーカスタマイズ - <?php echo file_get_contents($servernamefile);?></title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php require('../require/leftbox.php');?>
|
||||
<main>
|
||||
|
||||
<?php if( !empty($error_message) ): ?>
|
||||
<ul class="errmsg">
|
||||
<?php foreach( $error_message as $value ): ?>
|
||||
<p>・ <?php echo $value; ?></p>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<div class="admin_settings">
|
||||
<?php require('settings_left_menu.php');?>
|
||||
|
||||
<div class="admin_right">
|
||||
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||
<h1>サーバーカスタマイズ</h1>
|
||||
|
||||
<div>
|
||||
<p>CSS</p>
|
||||
<div class="p2">ここで指定されている色が適用されます。<br>もし適用されなかった場合はキャッシュを削除し再読み込みしてください。<br>表示がおかしくなってしまった場合はカラーコードを再度確認してください。</div>
|
||||
<textarea id="colordata" placeholder="uwuzu" class="inbox" type="text" name="colordata"><?php $sinfo = explode("\n", $color_info); foreach ($sinfo as $info) { echo $info; }?></textarea>
|
||||
</div>
|
||||
|
||||
<input type="submit" class = "irobutton" name="btn_submit" value="保存&更新">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php require('../require/rightbox.php');?>
|
||||
<?php require('../require/botbox.php');?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,311 @@
|
||||
<?php
|
||||
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
$contactfile = "../server/contact.txt";
|
||||
|
||||
$adminfile = "../server/admininfo.txt";
|
||||
|
||||
$serverstopfile = "../server/serverstop.txt";
|
||||
|
||||
$mojisizefile = "../server/textsize.txt";
|
||||
|
||||
$banuseridfile = "../server/banuserid.txt";
|
||||
$banuserid_info = file_get_contents($banuseridfile);
|
||||
|
||||
$banurldomainfile = "../server/banurldomain.txt";
|
||||
$banurldomain_info = file_get_contents($banurldomainfile);
|
||||
|
||||
$err404imagefile = "../server/404imagepath.txt";
|
||||
|
||||
$robots = "../robots.txt";
|
||||
|
||||
function createUniqId(){
|
||||
list($msec, $sec) = explode(" ", microtime());
|
||||
$hashCreateTime = $sec.floor($msec*1000000);
|
||||
|
||||
$hashCreateTime = strrev($hashCreateTime);
|
||||
|
||||
return base_convert($hashCreateTime,10,36);
|
||||
}
|
||||
function random_code($length = 8){
|
||||
return substr(str_shuffle('1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, $length);
|
||||
}
|
||||
|
||||
require('../db.php');
|
||||
|
||||
// 変数の初期化
|
||||
$datetime = array();
|
||||
$user_name = null;
|
||||
$message = array();
|
||||
$message_data = null;
|
||||
$error_message = array();
|
||||
$pdo = null;
|
||||
$stmt = null;
|
||||
$res = null;
|
||||
$option = null;
|
||||
|
||||
session_name('uwuzu_s_id');
|
||||
session_start();
|
||||
session_regenerate_id(true);
|
||||
|
||||
try {
|
||||
|
||||
$option = array(
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||
);
|
||||
$pdo = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
|
||||
} catch(PDOException $e) {
|
||||
|
||||
// 接続エラーのときエラー内容を取得する
|
||||
$error_message[] = $e->getMessage();
|
||||
}
|
||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', $_SESSION['userid']);
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
if(empty($res["userid"])){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){
|
||||
// セッションに値をセット
|
||||
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
|
||||
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
|
||||
$loginid = $res["loginid"];
|
||||
$_SESSION['admin_login'] = true;
|
||||
$_SESSION['userid'] = $userid;
|
||||
$_SESSION['username'] = $username;
|
||||
$_SESSION['loginid'] = $res["loginid"];
|
||||
setcookie('userid', $userid, [
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('username', $username,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('loginid', $res["loginid"],[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('admin_login', true,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
}else{
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', $_COOKIE['userid']);
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
if(empty($res["userid"])){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){
|
||||
// セッションに値をセット
|
||||
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
|
||||
$username = $_COOKIE['username']; // クッキーから取得した値をセット
|
||||
$loginid = $res["loginid"];
|
||||
$_SESSION['admin_login'] = true;
|
||||
$_SESSION['userid'] = $userid;
|
||||
$_SESSION['username'] = $username;
|
||||
$_SESSION['loginid'] = $res["loginid"];
|
||||
setcookie('userid', $userid,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('username', $username,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('loginid', $res["loginid"],[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('admin_login', true,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
}else{
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
// ログインが許可されていない場合、ログインページにリダイレクト
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
if(empty($userid)){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
if(empty($username)){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!($res["admin"] === "yes")){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||
$notiQuery->bindValue(':userid', $userid);
|
||||
$notiQuery->execute();
|
||||
$notiData = $notiQuery->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$notificationcount = $notiData['notification_count'];
|
||||
|
||||
if( !empty($pdo) ) {
|
||||
|
||||
// データベース接続の設定
|
||||
$dbh = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||
));
|
||||
|
||||
$userQuery = $dbh->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid");
|
||||
$userQuery->bindValue(':userid', $userid);
|
||||
$userQuery->execute();
|
||||
$userData = $userQuery->fetch();
|
||||
|
||||
$role = $userData["role"];
|
||||
|
||||
$dbh = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
|
||||
$rerole = $dbh->prepare("SELECT username, userid, password, mailadds, profile, iconname, headname, role, datetime FROM account WHERE userid = :userid");
|
||||
|
||||
$rerole->bindValue(':userid', $userid);
|
||||
// SQL実行
|
||||
$rerole->execute();
|
||||
|
||||
$userdata = $rerole->fetch(); // ここでデータベースから取得した値を $role に代入する
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!empty($pdo)) {
|
||||
|
||||
$sql = "SELECT code,used,datetime FROM invitation ORDER BY datetime DESC";
|
||||
$invcode = $pdo->query($sql);
|
||||
|
||||
while ($row = $invcode->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
$codes[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
if( !empty($_POST['btn_submit']) ) {
|
||||
|
||||
// 空白除去
|
||||
$banuserid = $_POST['banuserid'];
|
||||
|
||||
$banurldomain = $_POST['banurldomain'];
|
||||
|
||||
$max_textsize = $_POST['max_textsize'];
|
||||
|
||||
//banuserid
|
||||
$file = fopen($banuseridfile, 'w');
|
||||
$data = $banuserid;
|
||||
fputs($file, $data);
|
||||
fclose($file);
|
||||
|
||||
//banurldomain
|
||||
$file = fopen($banurldomainfile, 'w');
|
||||
$data = $banurldomain;
|
||||
fputs($file, $data);
|
||||
fclose($file);
|
||||
|
||||
//maxtextsize
|
||||
$file = fopen($mojisizefile, 'w');
|
||||
$data = $max_textsize;
|
||||
fputs($file, $data);
|
||||
fclose($file);
|
||||
|
||||
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||
header("Location:".$url."");
|
||||
exit;
|
||||
}
|
||||
require('../logout/logout.php');
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||
<title>モデレーション - <?php echo file_get_contents($servernamefile);?></title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php require('../require/leftbox.php');?>
|
||||
<main>
|
||||
|
||||
<?php if( !empty($error_message) ): ?>
|
||||
<ul class="errmsg">
|
||||
<?php foreach( $error_message as $value ): ?>
|
||||
<p>・ <?php echo $value; ?></p>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<div class="admin_settings">
|
||||
<?php require('settings_left_menu.php');?>
|
||||
|
||||
<div class="admin_right">
|
||||
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||
<h1>モデレーション</h1>
|
||||
|
||||
<div>
|
||||
<p>登録禁止ユーザーid</p>
|
||||
<div class="p2">ここに入力してあるユーザーidは登録できません。<br>改行で禁止するユーザーidを指定できます。<br>すでにあるアカウントは影響を受けません。</div>
|
||||
<textarea id="banuserid" placeholder="uwuzu" class="inbox" type="text" name="banuserid"><?php $sinfo = explode("\n", $banuserid_info); foreach ($sinfo as $info) { echo $info; }?></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>投稿禁止URLドメイン</p>
|
||||
<div class="p2">ここに入力してあるドメインが含まれる投稿をしようとすると投稿が拒否されます。<br>なお、この機能はまだ確実な動作が保証されないためベータ版です。<br>位置情報特定サイトなどの対策等にご利用ください。</div>
|
||||
<textarea id="banurldomain" placeholder="" class="inbox" type="text" name="banurldomain"><?php $sinfo = explode("\n", $banurldomain_info); foreach ($sinfo as $info) { echo $info; }?></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>投稿の最大文字数</p>
|
||||
<div class="p2">ここで設定した文字数までの投稿が可能です。<br>なお、データベースより最大文字数を設定している場合そちらが優先されて使用されます。<br>1文字から16777216文字の間で設定が可能です。</div>
|
||||
<input id="max_textsize" placeholder="1024" class="inbox" type="number" min="1" max="16777216" name="max_textsize" value="<?php if( !empty(file_get_contents($mojisizefile)) ){ echo htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8'); } ?>">
|
||||
</div>
|
||||
|
||||
<input type="submit" class = "irobutton" name="btn_submit" value="保存&更新">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php require('../require/rightbox.php');?>
|
||||
<?php require('../require/botbox.php');?>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,506 @@
|
||||
<?php
|
||||
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
$serverinfofile = '../server/info.txt';
|
||||
$serverinfo = file_get_contents($serverinfofile);
|
||||
|
||||
$servertermsfile = '../server/terms.txt';
|
||||
$serverterms = file_get_contents($servertermsfile);
|
||||
|
||||
$serverprvfile = '../server/privacypolicy.txt';
|
||||
$serverprv = file_get_contents($serverprvfile);
|
||||
|
||||
$contactfile = "../server/contact.txt";
|
||||
|
||||
$adminfile = "../server/admininfo.txt";
|
||||
|
||||
$serverstopfile = "../server/serverstop.txt";
|
||||
|
||||
$onlyuserfile = "../server/onlyuser.txt";
|
||||
|
||||
$err404imagefile = "../server/404imagepath.txt";
|
||||
|
||||
$robots = "../robots.txt";
|
||||
|
||||
function createUniqId(){
|
||||
list($msec, $sec) = explode(" ", microtime());
|
||||
$hashCreateTime = $sec.floor($msec*1000000);
|
||||
|
||||
$hashCreateTime = strrev($hashCreateTime);
|
||||
|
||||
return base_convert($hashCreateTime,10,36);
|
||||
}
|
||||
function random_code($length = 8){
|
||||
return substr(str_shuffle('1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), 0, $length);
|
||||
}
|
||||
|
||||
require('../db.php');
|
||||
|
||||
// 変数の初期化
|
||||
$datetime = array();
|
||||
$user_name = null;
|
||||
$message = array();
|
||||
$message_data = null;
|
||||
$error_message = array();
|
||||
$pdo = null;
|
||||
$stmt = null;
|
||||
$res = null;
|
||||
$option = null;
|
||||
|
||||
session_name('uwuzu_s_id');
|
||||
session_start();
|
||||
session_regenerate_id(true);
|
||||
|
||||
try {
|
||||
|
||||
$option = array(
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
|
||||
);
|
||||
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
|
||||
} catch(PDOException $e) {
|
||||
|
||||
// 接続エラーのときエラー内容を取得する
|
||||
$error_message[] = $e->getMessage();
|
||||
}
|
||||
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', $_SESSION['userid']);
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
if(empty($res["userid"])){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}elseif($_SESSION['loginid'] === $res["loginid"] && $_SESSION['userid'] === $res["userid"]){
|
||||
// セッションに値をセット
|
||||
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
|
||||
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
|
||||
$loginid = $res["loginid"];
|
||||
$_SESSION['admin_login'] = true;
|
||||
$_SESSION['userid'] = $userid;
|
||||
$_SESSION['username'] = $username;
|
||||
$_SESSION['loginid'] = $res["loginid"];
|
||||
setcookie('userid', $userid, [
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('username', $username,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('loginid', $res["loginid"],[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('admin_login', true,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
}else{
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
|
||||
|
||||
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
|
||||
$passQuery->bindValue(':userid', $_COOKIE['userid']);
|
||||
$passQuery->execute();
|
||||
$res = $passQuery->fetch();
|
||||
if(empty($res["userid"])){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}elseif($_COOKIE['loginid'] === $res["loginid"] && $_COOKIE['userid'] === $res["userid"]){
|
||||
// セッションに値をセット
|
||||
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
|
||||
$username = $_COOKIE['username']; // クッキーから取得した値をセット
|
||||
$loginid = $res["loginid"];
|
||||
$_SESSION['admin_login'] = true;
|
||||
$_SESSION['userid'] = $userid;
|
||||
$_SESSION['username'] = $username;
|
||||
$_SESSION['loginid'] = $res["loginid"];
|
||||
setcookie('userid', $userid,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('username', $username,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('loginid', $res["loginid"],[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
setcookie('admin_login', true,[
|
||||
'expires' => time() + 60 * 60 * 24 * 14,
|
||||
'path' => '/',
|
||||
'samesite' => 'lax',
|
||||
]);
|
||||
}else{
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
// ログインが許可されていない場合、ログインページにリダイレクト
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
if(empty($userid)){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
if(empty($username)){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!($res["admin"] === "yes")){
|
||||
header("Location: ../login.php");
|
||||
exit;
|
||||
}
|
||||
$notiQuery = $pdo->prepare("SELECT COUNT(*) as notification_count FROM notification WHERE touserid = :userid AND userchk = 'none'");
|
||||
$notiQuery->bindValue(':userid', $userid);
|
||||
$notiQuery->execute();
|
||||
$notiData = $notiQuery->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$notificationcount = $notiData['notification_count'];
|
||||
|
||||
if( !empty($_POST['role_btn_submit']) ) {
|
||||
|
||||
$rolename = htmlentities($_POST['rolename']);
|
||||
$roleid = htmlentities($_POST['roleid']);
|
||||
$rolecolor = htmlentities($_POST['rolecolor']);
|
||||
|
||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
$query = $dbh->prepare('SELECT * FROM role WHERE roleidname = :roleid limit 1');
|
||||
$query->execute(array(':roleid' => $roleid));
|
||||
$result3 = $query->fetch();
|
||||
|
||||
if(empty($rolename)){
|
||||
$error_message[] = "ロール名が入力されていません。";
|
||||
}
|
||||
if(empty($roleid)){
|
||||
$error_message[] = "ロールのidが入力されていません。";
|
||||
}elseif($result3 > 0){
|
||||
$error_message[] = 'このロールのid('.$roleid.')は既に使用されています。他のidを作成してください。';
|
||||
}
|
||||
|
||||
if(empty($rolecolor)){
|
||||
$error_message[] = "ロールの色が入力されていません。";
|
||||
}
|
||||
|
||||
if (!empty($pdo)) {
|
||||
if (empty($error_message)) {
|
||||
// 書き込み日時を取得
|
||||
$datetime = date("Y-m-d H:i:s");
|
||||
$roleauth = "user";
|
||||
|
||||
// トランザクション開始
|
||||
$pdo->beginTransaction();
|
||||
|
||||
try {
|
||||
|
||||
// SQL作成
|
||||
$stmt = $pdo->prepare("INSERT INTO role (rolename, roleauth, rolecolor, roleidname) VALUES (:rolename, :roleauth, :rolecolor, :roleidname)");
|
||||
|
||||
$stmt->bindParam(':rolename', $rolename, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':roleauth', $roleauth, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':rolecolor', $rolecolor, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':roleidname', $roleid, PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
|
||||
} catch(Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
|
||||
if( $res ) {
|
||||
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||
header("Location:".$url."");
|
||||
exit;
|
||||
} else {
|
||||
$error_message[] = $e->getMessage();
|
||||
}
|
||||
|
||||
// プリペアドステートメントを削除
|
||||
$stmt = null;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if( !empty($_POST['role_del']) ) {
|
||||
$role_id = htmlentities($_POST['role_id']);
|
||||
try{
|
||||
// 通知削除クエリを実行
|
||||
$deleteQuery = $pdo->prepare("DELETE FROM role WHERE roleidname = :roleid");
|
||||
$deleteQuery->bindValue(':roleid', $role_id, PDO::PARAM_STR);
|
||||
$res = $deleteQuery->execute();
|
||||
|
||||
try{
|
||||
// フォローの更新
|
||||
$updateFollowQuery = $pdo->prepare("UPDATE account SET role = REPLACE(role, :roleid, '') WHERE role LIKE :pattern");
|
||||
$updateFollowQuery->bindValue(':roleid', ",$role_id", PDO::PARAM_STR);
|
||||
$updateFollowQuery->bindValue(':pattern', "%,$role_id%", PDO::PARAM_STR);
|
||||
$res = $updateFollowQuery->execute();
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
|
||||
if( $res ) {
|
||||
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||
header("Location:".$url."");
|
||||
exit;
|
||||
} else {
|
||||
$error_message[] = $e->getMessage();
|
||||
}
|
||||
|
||||
|
||||
// プリペアドステートメントを削除
|
||||
$stmt = null;
|
||||
}
|
||||
|
||||
|
||||
if( !empty($_POST['send_add_role_submit']) ) {
|
||||
$add_userid = htmlentities($_POST['add_userid']);
|
||||
$add_roleid = htmlentities($_POST['add_roleid']);
|
||||
|
||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
$query = $dbh->prepare('SELECT * FROM account WHERE userid = :userid limit 1');
|
||||
$query->execute(array(':userid' => $add_userid));
|
||||
$result4 = $query->fetch();
|
||||
|
||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
|
||||
$query = $dbh->prepare('SELECT * FROM role WHERE roleidname = :roleid limit 1');
|
||||
$query->execute(array(':roleid' => $add_roleid));
|
||||
$result5 = $query->fetch();
|
||||
|
||||
if($result4 > 0 && $result5 > 0){
|
||||
|
||||
if (false !== strstr($result4["role"], ','.$add_roleid)) {
|
||||
$error_message[] = "既に".$add_roleid."は付与済みです。";
|
||||
}
|
||||
|
||||
$New_role_id = $result4["role"] . ',' . $add_roleid;
|
||||
if(empty($error_message)){
|
||||
try{
|
||||
// フォローの更新
|
||||
$updateRoleQuery = $pdo->prepare("UPDATE account SET role = :newrole WHERE userid = :userid");
|
||||
$updateRoleQuery->bindValue(':newrole', "$New_role_id", PDO::PARAM_STR);
|
||||
$updateRoleQuery->bindValue(':userid', $add_userid, PDO::PARAM_STR);
|
||||
$res = $updateRoleQuery->execute();
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
|
||||
|
||||
if( $res ) {
|
||||
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||
header("Location:".$url."");
|
||||
exit;
|
||||
} else {
|
||||
$error_message[] = $e->getMessage();
|
||||
}
|
||||
|
||||
|
||||
// プリペアドステートメントを削除
|
||||
$stmt = null;
|
||||
}
|
||||
}else{
|
||||
$error_message[] = "ロールがないまたはユーザーがいません。";
|
||||
}
|
||||
}
|
||||
|
||||
require('../logout/logout.php');
|
||||
|
||||
if (!empty($pdo)) {
|
||||
$sql = "SELECT * FROM role";
|
||||
$allrole = $pdo->query($sql);
|
||||
|
||||
while ($row = $allrole->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
$roles[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="../css/home.css">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
|
||||
<title>ロール - <?php echo file_get_contents($servernamefile);?></title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php require('../require/leftbox.php');?>
|
||||
<main>
|
||||
|
||||
<?php if( !empty($error_message) ): ?>
|
||||
<ul class="errmsg">
|
||||
<?php foreach( $error_message as $value ): ?>
|
||||
<p>・ <?php echo $value; ?></p>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<div class="admin_settings">
|
||||
<?php require('settings_left_menu.php');?>
|
||||
|
||||
<div class="admin_right">
|
||||
<form class="formarea" enctype="multipart/form-data" method="post">
|
||||
<h1>ロール作成</h1>
|
||||
<p>ここではロールを作成できます。</p>
|
||||
<div>
|
||||
<p>ロール名</p>
|
||||
<div class="p2">ロールの表示名です。</div>
|
||||
<input id="rolename" placeholder="RoleName" class="inbox" type="text" name="rolename" value="">
|
||||
</div>
|
||||
<div>
|
||||
<p>ロールid</p>
|
||||
<div class="p2">ロールのidです。ロールを付与する際に使用されるidです。</div>
|
||||
<input onInput="checkForm(this)" id="roleid" placeholder="role" class="inbox" type="text" name="roleid" value="">
|
||||
</div>
|
||||
<div>
|
||||
<p>ロールの色</p>
|
||||
<div class="p2">ロールの色です。<br>HEXコードで入力してください。(#はつけないでください。)</div>
|
||||
<input id="rolecolor" placeholder="256238" class="inbox" type="text" name="rolecolor" maxlength="6" value="">
|
||||
</div>
|
||||
|
||||
<input type="submit" class = "irobutton" name="role_btn_submit" value="作成">
|
||||
</form>
|
||||
<div class="formarea">
|
||||
<hr>
|
||||
<h1>ロール付与</h1>
|
||||
<p>特定のユーザーにロール付与するときに使用してください。</p>
|
||||
<button id="addrole" class="irobutton">付与</button>
|
||||
<hr>
|
||||
<h1>ロール一覧</h1>
|
||||
<?php if(!(empty($roles))){?>
|
||||
<?php foreach ($roles as $value) {?>
|
||||
<div class="server_code">
|
||||
<details>
|
||||
<summary><?php echo htmlentities($value["rolename"]);?></summary>
|
||||
<hr>
|
||||
<p>ロールのid:<?php echo htmlentities($value["roleidname"]);?></p>
|
||||
<p>ロールの色:#<?php echo htmlentities($value["rolecolor"]);?></p>
|
||||
<hr>
|
||||
|
||||
<form enctype="multipart/form-data" method="post">
|
||||
<?php if(!($value["roleidname"] === "user" || $value["roleidname"] === "official" || $value["roleidname"] === "ice")){?>
|
||||
<div class="delbox">
|
||||
<p>削除ボタンを押すとこのロールは削除されます。<br>また、このロールをつけているユーザー全員からこのロールが剥奪されます。</p>
|
||||
<input type="text" name="role_id" id="role_id" value="<?php echo htmlentities($value["roleidname"]);?>" style="display:none;" >
|
||||
<input type="submit" name="role_del" class="delbtn" value="削除">
|
||||
</div>
|
||||
<?php }else{?>
|
||||
<div class="delbox">
|
||||
<p>このロールは削除できません。</p>
|
||||
</div>
|
||||
<?php }?>
|
||||
</form>
|
||||
</details>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="account_addrole_Modal" class="modal">
|
||||
<div class="modal-content">
|
||||
<h1>ロール付与</h1>
|
||||
<p>ロール付与先のユーザーidと付与したいロールのidを入力してください。<br>なお、現時点ではここからロールの剥奪は出来ませんのでご注意ください。</p>
|
||||
<form method="post" id="deleteForm">
|
||||
<div class="p2">付与先ユーザーid</div>
|
||||
<input type="text" id="add_userid" class="inbox" placeholder="admin" name="add_userid" value="">
|
||||
<div class="p2">付与するロールid</div>
|
||||
<input type="text" id="add_roleid" class="inbox" placeholder="role" name="add_roleid" value="">
|
||||
<div class="btn_area">
|
||||
<input type="submit" id="deleteButton" class="fbtn_no" name="send_add_role_submit" value="付与">
|
||||
<input type="button" id="cancelButton" class="fbtn" value="キャンセル">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
<?php require('../require/rightbox.php');?>
|
||||
<?php require('../require/botbox.php');?>
|
||||
|
||||
</body>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
function checkForm(inputElement) {
|
||||
var str = inputElement.value;
|
||||
while (str.match(/[^A-Za-z\d_]/)) {
|
||||
str = str.replace(/[^A-Za-z\d_]/, "");
|
||||
}
|
||||
inputElement.value = str;
|
||||
}
|
||||
|
||||
var modal = document.getElementById('account_addrole_Modal');
|
||||
var deleteButton = document.getElementById('deleteButton');
|
||||
var cancelButton = document.getElementById('cancelButton'); // 追加
|
||||
var modalMain = $('.modal-content');
|
||||
|
||||
document.getElementById("addrole").addEventListener('click', function(){
|
||||
modal.style.display = 'block';
|
||||
modalMain.addClass("slideUp");
|
||||
modalMain.removeClass("slideDown");
|
||||
|
||||
deleteButton.addEventListener('click', () => {
|
||||
modalMain.removeClass("slideUp");
|
||||
modalMain.addClass("slideDown");
|
||||
window.setTimeout(function(){
|
||||
modal.style.display = 'none';
|
||||
}, 150);
|
||||
});
|
||||
|
||||
cancelButton.addEventListener('click', () => { // 追加
|
||||
modalMain.removeClass("slideUp");
|
||||
modalMain.addClass("slideDown");
|
||||
window.setTimeout(function(){
|
||||
modal.style.display = 'none';
|
||||
}, 150);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</html>
|
||||
@@ -3,6 +3,9 @@
|
||||
<a href="serveradmin" class="admin_leftbtn">サーバー設定</a>
|
||||
<a href="useradmin" class="admin_leftbtn">ユーザー管理</a>
|
||||
<a href="codeadmin" class="admin_leftbtn">招待コード発行所</a>
|
||||
<a href="role_admin" class="admin_leftbtn">ロール</a>
|
||||
<a href="ad_admin" class="admin_leftbtn">広告</a>
|
||||
<a href="moderation_admin" class="admin_leftbtn">モデレーション</a>
|
||||
<a href="customize_admin" class="admin_leftbtn">カスタマイズ</a>
|
||||
</div>
|
||||
<?php ?>
|
||||
+29
-3
@@ -1,5 +1,9 @@
|
||||
<?php
|
||||
$mojisizefile = "../server/textsize.txt";
|
||||
|
||||
$banurldomainfile = "../server/banurldomain.txt";
|
||||
$banurl_info = file_get_contents($banurldomainfile);
|
||||
$banurl = preg_split("/\r\n|\n|\r/", $banurl_info);
|
||||
|
||||
function createUniqId(){
|
||||
list($msec, $sec) = explode(" ", microtime());
|
||||
@@ -197,8 +201,15 @@ if( !empty($_POST['btn_submit']) ) {
|
||||
$error_message[] = '内容を入力してください。';
|
||||
} else {
|
||||
// 文字数を確認
|
||||
if( 1024 < mb_strlen($ueuse, 'UTF-8') ) {
|
||||
$error_message[] = '内容は1024文字以内で入力してください。';
|
||||
if( (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8') < mb_strlen($ueuse, 'UTF-8') ) {
|
||||
$error_message[] = '内容は'.htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8').'文字以内で入力してください。';
|
||||
}
|
||||
|
||||
// 禁止url確認
|
||||
for($i = 0; $i < count($banurl); $i++) {
|
||||
if (false !== strpos($ueuse, 'https://'.$banurl[$i])) {
|
||||
$error_message[] = '投稿が禁止されているURLが含まれています。';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -551,6 +562,15 @@ $pdo = null;
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<div id="loading" class="loading" style="display: none;">
|
||||
🤔
|
||||
</div>
|
||||
<div id="error" class="error" style="display: none;">
|
||||
<h1>エラー</h1>
|
||||
<p>サーバーの応答がなかったか不完全だったようです。<br>ネットワークの接続が正常かを確認の上再読み込みしてください。</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="myDelModal" class="modal">
|
||||
@@ -599,11 +619,17 @@ $(document).ready(function() {
|
||||
method: 'GET',
|
||||
data: { page: pageNumber, id: ueuseid ,userid: userid},
|
||||
dataType: 'html',
|
||||
timeout: 300000,
|
||||
success: function(response) {
|
||||
$('#postContainer').append(response);
|
||||
pageNumber++;
|
||||
isLoading = false;
|
||||
}
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) { // エラーと判定された場合
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
$("#error").show();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+33
-4
@@ -548,6 +548,10 @@ $pdo = null;
|
||||
<div id="loading" class="loading" style="display: none;">
|
||||
🤔
|
||||
</div>
|
||||
<div id="error" class="error" style="display: none;">
|
||||
<h1>エラー</h1>
|
||||
<p>サーバーの応答がなかったか不完全だったようです。<br>ネットワークの接続が正常かを確認の上再読み込みしてください。</p>
|
||||
</div>
|
||||
|
||||
<div id="myDelModal" class="modal">
|
||||
<div class="modal-content">
|
||||
@@ -596,6 +600,7 @@ $(document).ready(function() {
|
||||
if (isLoading) return;
|
||||
isLoading = true;
|
||||
$("#loading").show();
|
||||
$("#error").hide();
|
||||
var uwuzuid = '<?php echo $uwuzuid; ?>';
|
||||
var userid = '<?php echo $userid; ?>';
|
||||
if(mode == 'allueuse'){
|
||||
@@ -604,12 +609,18 @@ $(document).ready(function() {
|
||||
method: 'GET',
|
||||
data: { page: pageNumber, id: uwuzuid ,userid: userid},
|
||||
dataType: 'html',
|
||||
timeout: 300000,
|
||||
success: function(response) {
|
||||
$('#postContainer').append(response);
|
||||
pageNumber++;
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
}
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) { // エラーと判定された場合
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
$("#error").show();
|
||||
},
|
||||
});
|
||||
}else if(mode == 'mediaueuse'){
|
||||
$.ajax({
|
||||
@@ -617,12 +628,18 @@ $(document).ready(function() {
|
||||
method: 'GET',
|
||||
data: { page: pageNumber, id: uwuzuid ,userid: userid},
|
||||
dataType: 'html',
|
||||
timeout: 300000,
|
||||
success: function(response) {
|
||||
$('#postContainer').append(response);
|
||||
pageNumber++;
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
}
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) { // エラーと判定された場合
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
$("#error").show();
|
||||
},
|
||||
});
|
||||
}else if(mode == 'likeueuse'){
|
||||
$.ajax({
|
||||
@@ -630,12 +647,18 @@ $(document).ready(function() {
|
||||
method: 'GET',
|
||||
data: { page: pageNumber, id: uwuzuid ,userid: userid},
|
||||
dataType: 'html',
|
||||
timeout: 300000,
|
||||
success: function(response) {
|
||||
$('#postContainer').append(response);
|
||||
pageNumber++;
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
}
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) { // エラーと判定された場合
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
$("#error").show();
|
||||
},
|
||||
});
|
||||
}else{
|
||||
$('#all_ueuse_btn').addClass('btmline');
|
||||
@@ -644,12 +667,18 @@ $(document).ready(function() {
|
||||
method: 'GET',
|
||||
data: { page: pageNumber, id: uwuzuid ,userid: userid},
|
||||
dataType: 'html',
|
||||
timeout: 300000,
|
||||
success: function(response) {
|
||||
$('#postContainer').append(response);
|
||||
pageNumber++;
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
}
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) { // エラーと判定された場合
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
$("#error").show();
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+3
-60
@@ -2,8 +2,8 @@
|
||||
-- version 5.2.1
|
||||
-- https://www.phpmyadmin.net/
|
||||
--
|
||||
-- ホスト: ひみつ
|
||||
-- 生成日時: 2023-09-10 11:16:42
|
||||
-- ホスト: ひみつ♡()
|
||||
-- 生成日時: 2023-09-02 18:20:50
|
||||
-- サーバのバージョン: 10.4.28-MariaDB
|
||||
-- PHP のバージョン: 8.2.4
|
||||
|
||||
@@ -18,7 +18,7 @@ SET time_zone = "+00:00";
|
||||
/*!40101 SET NAMES utf8mb4 */;
|
||||
|
||||
--
|
||||
-- データベース: `account`
|
||||
-- データベース: `nandemo`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
@@ -49,23 +49,6 @@ CREATE TABLE `account` (
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- テーブルの構造 `ads`
|
||||
--
|
||||
|
||||
CREATE TABLE `ads` (
|
||||
`sysid` int(11) NOT NULL,
|
||||
`uniqid` varchar(512) NOT NULL,
|
||||
`url` varchar(512) NOT NULL,
|
||||
`image_url` varchar(512) NOT NULL,
|
||||
`memo` text NOT NULL,
|
||||
`start_date` datetime NOT NULL,
|
||||
`limit_date` datetime NOT NULL,
|
||||
`datetime` datetime NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- テーブルの構造 `emoji`
|
||||
--
|
||||
@@ -126,22 +109,6 @@ CREATE TABLE `notification` (
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- テーブルの構造 `report`
|
||||
--
|
||||
|
||||
CREATE TABLE `report` (
|
||||
`sysid` int(11) NOT NULL,
|
||||
`uniqid` varchar(256) NOT NULL,
|
||||
`userid` varchar(500) NOT NULL,
|
||||
`report_userid` varchar(500) NOT NULL,
|
||||
`msg` text NOT NULL,
|
||||
`datetime` datetime NOT NULL,
|
||||
`admin_chk` varchar(25) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- テーブルの構造 `role`
|
||||
--
|
||||
@@ -186,12 +153,6 @@ CREATE TABLE `ueuse` (
|
||||
ALTER TABLE `account`
|
||||
ADD PRIMARY KEY (`sysid`);
|
||||
|
||||
--
|
||||
-- テーブルのインデックス `ads`
|
||||
--
|
||||
ALTER TABLE `ads`
|
||||
ADD PRIMARY KEY (`sysid`);
|
||||
|
||||
--
|
||||
-- テーブルのインデックス `emoji`
|
||||
--
|
||||
@@ -216,12 +177,6 @@ ALTER TABLE `notice`
|
||||
ALTER TABLE `notification`
|
||||
ADD PRIMARY KEY (`sysid`);
|
||||
|
||||
--
|
||||
-- テーブルのインデックス `report`
|
||||
--
|
||||
ALTER TABLE `report`
|
||||
ADD PRIMARY KEY (`sysid`);
|
||||
|
||||
--
|
||||
-- テーブルのインデックス `role`
|
||||
--
|
||||
@@ -244,12 +199,6 @@ ALTER TABLE `ueuse`
|
||||
ALTER TABLE `account`
|
||||
MODIFY `sysid` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- テーブルの AUTO_INCREMENT `ads`
|
||||
--
|
||||
ALTER TABLE `ads`
|
||||
MODIFY `sysid` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- テーブルの AUTO_INCREMENT `emoji`
|
||||
--
|
||||
@@ -274,12 +223,6 @@ ALTER TABLE `notice`
|
||||
ALTER TABLE `notification`
|
||||
MODIFY `sysid` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- テーブルの AUTO_INCREMENT `report`
|
||||
--
|
||||
ALTER TABLE `report`
|
||||
MODIFY `sysid` int(11) NOT NULL AUTO_INCREMENT;
|
||||
|
||||
--
|
||||
-- テーブルの AUTO_INCREMENT `role`
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user