1
0
mirror of https://github.com/Daichimarukana/uwuzu.git synced 2026-06-05 03:24:41 +00:00

uwuzu version 1.2.14

This commit is contained in:
daichimarukana
2023-09-03 01:02:33 +09:00
parent 70560ecab7
commit 2040eb59ed
32 changed files with 1143 additions and 244 deletions
+79
View File
@@ -4,8 +4,37 @@ require('../db.php');
if (htmlentities(isset($_POST['uniqid'])) && htmlentities(isset($_POST['abitext']))) { if (htmlentities(isset($_POST['uniqid'])) && htmlentities(isset($_POST['abitext']))) {
$postUniqid = htmlentities($_POST['uniqid']); $postUniqid = htmlentities($_POST['uniqid']);
$abitext = htmlentities($_POST['abitext']); $abitext = htmlentities($_POST['abitext']);
$username = htmlentities($_POST['username']);
$abidate = date("Y-m-d H:i:s"); $abidate = date("Y-m-d H:i:s");
//-------------------------------------------
function get_mentions_userid($postText) {
// @useridを検出する
$usernamePattern = '/@(\w+)/';
$mentionedUsers = [];
preg_replace_callback($usernamePattern, function($matches) use (&$mentionedUsers) {
$mention_username = $matches[1];
$dbh = new PDO('mysql:charset=utf8mb4;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,
));
$mention_userQuery = $dbh->prepare("SELECT username, userid FROM account WHERE userid = :userid");
$mention_userQuery->bindValue(':userid', $mention_username);
$mention_userQuery->execute();
$mention_userData = $mention_userQuery->fetch();
if (!empty($mention_userData)) {
$mentionedUsers[] = $mention_username;
}
}, $postText);
return $mentionedUsers;
}
try { try {
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS); $pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS);
@@ -22,6 +51,56 @@ if (htmlentities(isset($_POST['uniqid'])) && htmlentities(isset($_POST['abitext'
// コミット // コミット
$pdo->commit(); $pdo->commit();
$mentionedUsers = get_mentions_userid($abitext);
foreach ($mentionedUsers as $mentionedUser) {
$pdo->beginTransaction();
try {
$touserid = $mentionedUser;
$datetime = date("Y-m-d H:i:s");
$msg = "" . $abitext . "";
$title = "" . $username . "さんにメンションされました!";
$url = "/!" . $uniqid . "~" . $userid . "";
$userchk = 'none';
// 通知用SQL作成
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)");
$stmt->bindParam(':touserid', $touserid, PDO::PARAM_STR);
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR);
$stmt->bindParam(':url', $url, PDO::PARAM_STR);
$stmt->bindParam(':userchk', $userchk, PDO::PARAM_STR);
$stmt->bindParam(':title', $title, PDO::PARAM_STR);
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
// SQLクエリの実行
$res2 = $stmt->execute();
// コミット
$res2 = $pdo->commit();
} catch(Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
if ($res2) {
header('Content-Type: application/json');
echo json_encode(['success' => true]);
exit;
} else {
header('Content-Type: application/json');
echo json_encode(['success' => false, 'error' => '追加に失敗しました。']);
exit;
}
}
if ($res) { if ($res) {
header('Content-Type: application/json'); header('Content-Type: application/json');
echo json_encode(['success' => true]); echo json_encode(['success' => true]);
+2
View File
@@ -21,7 +21,9 @@ $servernamefile = "server/servername.txt";
$onlyuserfile = "server/onlyuser.txt"; $onlyuserfile = "server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile); $onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
// 変数の初期化 // 変数の初期化
$current_date = null; $current_date = null;
+2
View File
@@ -16,7 +16,9 @@ $servernamefile = "server/servername.txt";
$onlyuserfile = "server/onlyuser.txt"; $onlyuserfile = "server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile); $onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
// 変数の初期化 // 変数の初期化
$current_date = null; $current_date = null;
+2
View File
@@ -21,7 +21,9 @@ $ruserid = "";
$rpassword = ""; $rpassword = "";
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
$userid = $_SESSION['userid']; $userid = $_SESSION['userid'];
+2
View File
@@ -21,7 +21,9 @@ $row["password"] = array();
$ruserid = array(); $ruserid = array();
$rpassword = array(); $rpassword = array();
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
// データベースに接続 // データベースに接続
try { try {
+131 -3
View File
@@ -1020,8 +1020,19 @@ main h1{
color:#999; color:#999;
font-family: 'BIZ UDPGothic', sans-serif; font-family: 'BIZ UDPGothic', sans-serif;
} }
.ueuse .photo1 a{
width: 48%;
margin-left: auto;
margin-right: auto;
}
.ueuse .photo2 a{
width: 48%;
margin-left: auto;
margin-right: auto;
}
.ueuse .photo1 img{
.ueuse .photo1 a img{
object-fit: cover; object-fit: cover;
border-radius: 10px; border-radius: 10px;
margin-top: 12px; margin-top: 12px;
@@ -1036,13 +1047,13 @@ main h1{
display: flex; display: flex;
} }
.ueuse .photo2 img{ .ueuse .photo2 a img{
object-fit: cover; object-fit: cover;
border-radius: 10px; border-radius: 10px;
margin-top: 12px; margin-top: 12px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
width: 47%; width: 100%;
height: 350px; height: 350px;
border: 1px solid #EEE; border: 1px solid #EEE;
} }
@@ -2870,6 +2881,60 @@ hr{
border-bottom: 1px solid #FFC832; border-bottom: 1px solid #FFC832;
} }
.hny{
border-radius: 10px;
overflow: hidden;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05) inset;
margin: 12px;
border: 1px solid #EEE;
}
.hny .top{
background-color: #CB4042;
padding-left: 24px;
padding-right: 24px;
padding-top: 8px;
padding-bottom: 8px;
color:#FCFAF2;
font-family: 'BIZ UDPGothic', sans-serif;
font-weight: bold;
}
.hny .textmain{
background-color: #EEE;
padding-top: 8px;
padding-bottom: 8px;
padding-left: 24px;
padding-right: 24px;
}
.hny .textmain h1{
background-color: #FFC832;
text-align: left;
color:#FCFAF2;
font-family: 'BIZ UDPGothic', sans-serif;
word-wrap: break-word;
font-size: 32px;
line-height: 32px;
padding: 12px;
border-radius: 7px;
}
.hny .textmain p{
text-align: left;
color:#252525;
font-family: 'BIZ UDPGothic', sans-serif;
word-wrap: break-word;
font-size: 16px;
line-height: 22px;
font-weight: bold;
}
.hny .textmain .rp{
text-align: right;
color:#252525;
font-family: 'BIZ UDPGothic', sans-serif;
word-wrap: break-word;
font-size: 14px;
line-height: 22px;
font-weight: normal;
margin-bottom: 6px;
}
/*------------------------------------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------スマホ向け--------------------------------------------------*/ /*--------------------------------------------------スマホ向け--------------------------------------------------*/
/*--------------------------------------------------ここから--------------------------------------------------*/ /*--------------------------------------------------ここから--------------------------------------------------*/
@@ -3922,6 +3987,69 @@ hr{
margin-bottom: 12px; margin-bottom: 12px;
font-size: 20px; font-size: 20px;
} }
.hny{
position: absolute;
animation: slideDownhny 5.0s ease-in-out forwards;
border-radius: 10px;
overflow: hidden;
box-shadow:0 0px 32px 0 rgba(0, 0, 0, .15);
margin: 12px;
border: 1px solid #EEE;
}
@keyframes slideDownhny {
0%, 100% { transform: translateY(-40dvh); }
20%, 90% { transform: translateY(0px); }
}
.hny .top{
background-color: #CB4042;
padding-left: 24px;
padding-right: 24px;
padding-top: 8px;
padding-bottom: 8px;
color:#FCFAF2;
font-family: 'BIZ UDPGothic', sans-serif;
font-weight: bold;
}
.hny .textmain{
background-color: #EEE;
padding-top: 8px;
padding-bottom: 8px;
padding-left: 24px;
padding-right: 24px;
}
.hny .textmain h1{
background-color: transparent;
text-align: left;
color:#252525;
font-family: 'BIZ UDPGothic', sans-serif;
word-wrap: break-word;
font-size: 22px;
line-height: 32px;
padding: 0px;
border-radius: 7px;
}
.hny .textmain p{
margin: 0px;
text-align: left;
color:#252525;
font-family: 'BIZ UDPGothic', sans-serif;
word-wrap: break-word;
font-size: 16px;
line-height: 22px;
font-weight: bold;
}
.hny .textmain .rp{
margin-top: 6px;
text-align: right;
color:#252525;
font-family: 'BIZ UDPGothic', sans-serif;
word-wrap: break-word;
font-size: 14px;
line-height: 22px;
font-weight: normal;
margin-bottom: 6px;
}
} }
/*------------------------------------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------------------------------------*/
+42 -8
View File
@@ -23,7 +23,9 @@ $stmt = null;
$res = null; $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
$userid = htmlentities($_SESSION['userid']); $userid = htmlentities($_SESSION['userid']);
$username = htmlentities($_SESSION['username']); $username = htmlentities($_SESSION['username']);
@@ -59,10 +61,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -86,10 +104,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
+2
View File
@@ -21,7 +21,9 @@ $rpassword = array();
$emojiname = null; $emojiname = null;
$_SESSION["emojiname"]=""; $_SESSION["emojiname"]="";
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
$option = array( $option = array(
+41 -8
View File
@@ -22,6 +22,7 @@ $stmt = null;
$res = null; $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true); session_regenerate_id(true);
@@ -58,10 +59,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -85,10 +102,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
+44 -9
View File
@@ -22,7 +22,9 @@ $stmt = null;
$res = null; $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
//------------------------------------------ //------------------------------------------
// データベースに接続 // データベースに接続
@@ -57,10 +59,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -84,10 +102,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -699,6 +733,7 @@ $(document).ready(function() {
event.preventDefault(); event.preventDefault();
var abitext = document.getElementById("abitexts").value; var abitext = document.getElementById("abitexts").value;
var username = "<?php echo $username?>";
if(abitext == ""){ if(abitext == ""){
modalMain.removeClass("slideUp"); modalMain.removeClass("slideUp");
@@ -710,7 +745,7 @@ $(document).ready(function() {
$.ajax({ $.ajax({
url: '../abi/addabi.php', url: '../abi/addabi.php',
method: 'POST', method: 'POST',
data: { uniqid: uniqid2, abitext: abitext}, data: { uniqid: uniqid2, abitext: abitext, username: username},
dataType: 'json', dataType: 'json',
success: function (response) { success: function (response) {
console.log(response); // レスポンス内容をコンソールに表示 console.log(response); // レスポンス内容をコンソールに表示
+93 -16
View File
@@ -22,7 +22,9 @@ $stmt = null;
$res = null; $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
//------------------------------------------ //------------------------------------------
// データベースに接続 // データベースに接続
@@ -57,10 +59,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid, [
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -84,10 +102,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -373,6 +407,12 @@ require('../logout/logout.php');
// データベースの接続を閉じる // データベースの接続を閉じる
$pdo = null; $pdo = null;
if(isset($_GET['text'])){
$ueuse = $_GET['text'];
}else{
$ueuse = "";
}
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="ja"> <html lang="ja">
@@ -402,6 +442,33 @@ if ("serviceWorker" in navigator) {
<?php require('../require/leftbox.php');?> <?php require('../require/leftbox.php');?>
<main class="outer"> <main class="outer">
<?php if(empty($_COOKIE['event'])){
if (date("md") == "0101") {?>
<div class="hny" id="osho_gats">
<div class="top">Happy New Year <?php echo date("Y")?> !!!</div>
<div class="textmain">
<h1>あけましておめでとうございます!</h1>
<p>あけましておめでとうございます<br>今日から<?php echo date("Y年")?>ですね~!<br>今年もどうぞuwuzuをよろしくお願いいたします!</p>
<p><script type="text/javascript">
rand = Math.floor(Math.random()*8);
if (rand == 0) msg = "早速ですが年越しジャンプしました?";
if (rand == 1) msg = "早速ですがお餅は食べましたか?";
if (rand == 2) msg = "お餅を喉に詰まらせないよう気をつけてくださいね~";
if (rand == 3) msg = "福袋とか買いましたか~?";
if (rand == 4) msg = "やっぱりこたつでゆっくりしたいね...";
if (rand == 5) msg = "みかんでも食べます?";
if (rand == 6) msg = "お鍋でもどうですか~?";
if (rand == 7) msg = "一生こたつにいたい...";
document.write(msg);
</script></p>
<div class="rp"><?php echo date("Y年n月j日")?></div>
<button class="os_exit_btn">とじる</button>
</div>
</div>
<?php }?>
<?php }?>
<div class="tlchange"> <div class="tlchange">
<a href="index" class="on">LTL</a> <a href="index" class="on">LTL</a>
<a href="ftl" class="off">FTL</a> <a href="ftl" class="off">FTL</a>
@@ -415,7 +482,7 @@ if ("serviceWorker" in navigator) {
<?php endif; ?> <?php endif; ?>
<form method="post" enctype="multipart/form-data"> <form method="post" enctype="multipart/form-data">
<div class="sendbox"> <div class="sendbox">
<textarea id="ueuse" placeholder="いまどうしてる?" name="ueuse"><?php if( !empty($_SESSION['ueuse']) ){ echo htmlspecialchars( $_SESSION['ueuse'], ENT_QUOTES, 'UTF-8'); } ?></textarea> <textarea id="ueuse" placeholder="いまどうしてる?" name="ueuse"><?php if( !empty($ueuse) ){ echo htmlspecialchars($ueuse, ENT_QUOTES, 'UTF-8'); } ?></textarea>
<p>画像のEXIF情報(位置情報など)は削除されません。<br>情報漏洩に気をつけてくださいね…</p> <p>画像のEXIF情報(位置情報など)は削除されません。<br>情報漏洩に気をつけてくださいね…</p>
<div class="fxbox"> <div class="fxbox">
<label for="upload_images" id="images"> <label for="upload_images" id="images">
@@ -698,6 +765,7 @@ $(document).ready(function() {
event.preventDefault(); event.preventDefault();
var abitext = document.getElementById("abitexts").value; var abitext = document.getElementById("abitexts").value;
var usernames = '<?php echo $username; ?>';
if(abitext == ""){ if(abitext == ""){
modalMain.removeClass("slideUp"); modalMain.removeClass("slideUp");
@@ -709,24 +777,33 @@ $(document).ready(function() {
$.ajax({ $.ajax({
url: '../abi/addabi.php', url: '../abi/addabi.php',
method: 'POST', method: 'POST',
data: { uniqid: uniqid2, abitext: abitext}, data: { uniqid: uniqid2, abitext: abitext, username: usernames },
dataType: 'json', dataType: 'json',
success: function (response) { success: function (response) {
console.log(response); // レスポンス内容をコンソールに表示 console.log(response); // レスポンス内容をコンソールに表示
if (response.success) { if (response.success) {
abimodal.style.display = 'none'; abimodal.style.display = 'none';
postAbiElement.remove(); postAbiElement.remove();
console.log(response);
} else { } else {
abimodal.style.display = 'none';
postAbiElement.remove();
} }
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {
console.log(error);
abimodal.style.display = 'none';
postAbiElement.remove();
}
});
}
});
});
} var osho_gats = document.getElementById('osho_gats');
}); $(document).on('click', '.os_exit_btn', function (event) {
} document.cookie = "event=done; max-age=86400";
}); osho_gats.style.display = 'none';
}); });
}); });
+2
View File
@@ -3,7 +3,9 @@
<?php <?php
require('db.php'); require('db.php');
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) { if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
header("Location: home/index.php"); header("Location: home/index.php");
+2
View File
@@ -27,7 +27,9 @@ $password = null;
$_SESSION["password"]=""; $_SESSION["password"]="";
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
try { try {
+2
View File
@@ -16,7 +16,9 @@ $servernamefile = "server/servername.txt";
$onlyuserfile = "server/onlyuser.txt"; $onlyuserfile = "server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile); $onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
// 変数の初期化 // 変数の初期化
$current_date = null; $current_date = null;
+3
View File
@@ -63,6 +63,9 @@ if (!empty($pdo)) {
$messages[] = $row; $messages[] = $row;
} }
} }
usort($messages, function($a, $b) {
return strtotime($b['datetime']) - strtotime($a['datetime']);
});
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える // ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) { foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname FROM account WHERE userid = :userid"); $userQuery = $pdo->prepare("SELECT username, userid, profile, role, iconname, headname FROM account WHERE userid = :userid");
+14 -8
View File
@@ -2,7 +2,6 @@
<?php <?php
function processMarkdownAndWrapEmptyLines($markdownText){ function processMarkdownAndWrapEmptyLines($markdownText){
$markdownText = preg_replace('/^\[\[buruburu (.+)\]\]/m', '<p class="buruburu">$1</p>', $markdownText);//←ここ!!!!!!!!!!!!!! $markdownText = preg_replace('/^\[\[buruburu (.+)\]\]/m', '<p class="buruburu">$1</p>', $markdownText);//←ここ!!!!!!!!!!!!!!
// コード(#code)をHTMLのdiv class="code"タグに変換 // コード(#code)をHTMLのdiv class="code"タグに変換
$markdownText = preg_replace('/^#code (.+)/m', '<div class="code"><p>$1</p></div>', $markdownText); $markdownText = preg_replace('/^#code (.+)/m', '<div class="code"><p>$1</p></div>', $markdownText);
@@ -118,11 +117,18 @@ class MessageDisplay {
} }
echo ' <div class="time">'; echo ' <div class="time">';
$day = date("Ymd", strtotime(htmlentities($this->value['datetime']))); $datetime = strtotime(htmlentities($this->value['datetime']));
if ($day == date("Ymd")) { $today = strtotime(date("Y-m-d"));
echo date("今日 H:i", strtotime(htmlentities($this->value['datetime']))); if (date("md", $datetime) == "0101") {
if (date("Y", $datetime) == date("Y")) {
echo "元日 " . date("H:i", $datetime);
} else { } else {
echo date("Y年m月d日 H:i", strtotime(htmlentities($this->value['datetime']))); echo date("Y年m月d日 H:i", $datetime);
}
} elseif ($datetime >= $today) {
echo "今日 " . date("H:i", $datetime);
} else {
echo date("Y年m月d日 H:i", $datetime);
} }
echo ' </div>'; echo ' </div>';
@@ -132,12 +138,12 @@ class MessageDisplay {
if (!empty($this->value['photo2']) && $this->value['photo2'] !== 'none') { if (!empty($this->value['photo2']) && $this->value['photo2'] !== 'none') {
echo ' <div class="photo2">'; echo ' <div class="photo2">';
echo ' <img src="' . htmlentities($this->value['photo1']) . '" alt="画像">'; echo ' <a href="'.htmlentities($this->value['photo1']).'" target=”_blank”><img src="'.htmlentities($this->value['photo1']).'" alt="画像1" title="画像1"></a>';
echo ' <img src="' . htmlentities($this->value['photo2']) . '" alt="画像">'; echo ' <a href="'.htmlentities($this->value['photo2']).'" target=”_blank”><img src="'.htmlentities($this->value['photo2']).'" alt="画像2" title="画像2"></a>';
echo ' </div>'; echo ' </div>';
} elseif (!empty($this->value['photo1']) && $this->value['photo1'] !== 'none') { } elseif (!empty($this->value['photo1']) && $this->value['photo1'] !== 'none') {
echo ' <div class="photo1">'; echo ' <div class="photo1">';
echo ' <img src="' . htmlentities($this->value['photo1']) . '" alt="画像">'; echo ' <a href="'.htmlentities($this->value['photo1']).'" target=”_blank”><img src="'.htmlentities($this->value['photo1']).'" alt="画像1" title="画像1"></a>';
echo ' </div>'; echo ' </div>';
} }
if (!empty($this->value['video1']) && $this->value['video1'] !== 'none') { if (!empty($this->value['video1']) && $this->value['video1'] !== 'none') {
+42 -8
View File
@@ -23,7 +23,9 @@ $stmt = null;
$res = null; $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
$userid = htmlentities($_SESSION['userid']); $userid = htmlentities($_SESSION['userid']);
$username = htmlentities($_SESSION['username']); $username = htmlentities($_SESSION['username']);
@@ -59,10 +61,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -86,10 +104,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
-13
View File
@@ -24,17 +24,4 @@ while ($row = $notice_array->fetch(PDO::FETCH_ASSOC)) {
$notices[] = $row; $notices[] = $row;
} }
if(!empty($notices)){
foreach ($notices as $value) {
$uneinoticenote = htmlentities($value['note']);
$uneinoticetitle = htmlentities($value['title']);
$uneinoticeaccount = htmlentities($value['account']);
$uneinoticedatetime = htmlentities($value['datetime']);
}
}else{
$uneinoticenote = "";
$uneinoticetitle = "おしらせはありません";
$uneinoticeaccount = "uwuzu";
$uneinoticedatetime = "";
}
?> ?>
+42 -8
View File
@@ -24,7 +24,9 @@ $stmt = null;
$res = null; $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
$userid = htmlentities($_SESSION['userid']); $userid = htmlentities($_SESSION['userid']);
$username = htmlentities($_SESSION['username']); $username = htmlentities($_SESSION['username']);
@@ -61,10 +63,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -88,10 +106,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
+42 -8
View File
@@ -28,7 +28,9 @@ $stmt = null;
$res = null; $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
$userid = htmlentities($_SESSION['userid']); $userid = htmlentities($_SESSION['userid']);
$username = htmlentities($_SESSION['username']); $username = htmlentities($_SESSION['username']);
@@ -72,10 +74,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -99,10 +117,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
+42 -8
View File
@@ -8,7 +8,9 @@ require('../db.php');
$onlyuserfile = "../server/onlyuser.txt"; $onlyuserfile = "../server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile); $onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
// 変数の初期化 // 変数の初期化
$current_date = null; $current_date = null;
@@ -56,10 +58,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -83,10 +101,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
+2 -1
View File
@@ -26,8 +26,9 @@ $_SESSION["userid"]="";
$password = null; $password = null;
$_SESSION["password"]=""; $_SESSION["password"]="";
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
// データベースに接続 // データベースに接続
try { try {
+2 -1
View File
@@ -26,8 +26,9 @@ $_SESSION["userid"]="";
$password = null; $password = null;
$_SESSION["password"]=""; $_SESSION["password"]="";
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
$userid = $_SESSION['userid']; $userid = $_SESSION['userid'];
try { try {
+14 -6
View File
@@ -21,14 +21,22 @@
?> ?>
<h1>お知らせ</h1> <h1>お知らせ</h1>
<div class="noticearea"> <div class="noticearea">
<?php foreach ($notices as $valuen) {?> <?php if(empty($notices)){?>
<div class="noticebox"> <div class="noticebox">
<h4><?php echo $valuen['title'];?></h4> <h4>なし</h4>
<p><?php echo nl2br($valuen['note']);?></p> <p>おしらせないよ~</p>
<div class="makeup"><p>編集者 : <a href="/@<?php echo $uneinoticeaccount?>">@<?php echo htmlspecialchars($uneinoticeaccount)?></a></p></div> <div class="makeup"><p>編集者 : <a href="/rule/uwuzuabout">@uwuzu</a></p></div>
<div class="time"><p><?php echo date('Y年m月d日 H:i', strtotime($valuen['datetime']));?></p></div> <div class="time"><p>いま</p></div>
</div> </div>
<?php }?> <?php }else{?>
<?php foreach ($notices as $value) {?>
<div class="noticebox">
<h4><?php echo $value['title'];?></h4>
<p><?php echo nl2br($value['note']);?></p>
<div class="makeup"><p>編集者 : <a href="/@<?php echo $value['account'];?>">@<?php echo $value['account'];?></a></p></div>
<div class="time"><p><?php echo date('Y年m月d日 H:i', strtotime($value['datetime']));?></p></div>
</div>
<?php }}?>
</div> </div>
<h1>サーバー情報</h1> <h1>サーバー情報</h1>
<div class="btmbox"> <div class="btmbox">
+91 -12
View File
@@ -22,7 +22,9 @@ $stmt = null;
$res = null; $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
//------------------------------------------ //------------------------------------------
// データベースに接続 // データベースに接続
@@ -57,10 +59,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -84,10 +102,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -300,18 +334,26 @@ $(document).ready(function() {
var modal = document.getElementById('myDelModal'); var modal = document.getElementById('myDelModal');
var deleteButton = document.getElementById('deleteButton'); var deleteButton = document.getElementById('deleteButton');
var cancelButton = document.getElementById('cancelButton'); // 追加 var cancelButton = document.getElementById('cancelButton'); // 追加
var modalMain = $('.modal-content');
$(document).on('click', '.delbtn', function (event) { $(document).on('click', '.delbtn', function (event) {
modal.style.display = 'block'; modal.style.display = 'block';
modalMain.addClass("slideUp");
modalMain.removeClass("slideDown");
var uniqid2 = $(this).attr('data-uniqid2'); var uniqid2 = $(this).attr('data-uniqid2');
var postElement = $(this).closest('.ueuse'); var postElement = $(this).closest('.ueuse');
deleteButton.addEventListener('click', () => { deleteButton.addEventListener('click', () => {
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
modal.style.display = 'none'; modal.style.display = 'none';
}, 150);
$.ajax({ $.ajax({
url: '../delete/delete.php', url: '../delete/delete.php',
@@ -332,25 +374,54 @@ $(document).ready(function() {
}); });
cancelButton.addEventListener('click', () => { // 追加 cancelButton.addEventListener('click', () => { // 追加
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
modal.style.display = 'none'; modal.style.display = 'none';
}, 150);
}); });
}); });
var more_modal = document.getElementById('myMoreModal');
var m_cancelButton = document.getElementById('m_c_button'); // 追加
var modalMain = $('.modal-content');
$(document).on('click', '.more_btn', function (event) {
more_modal.style.display = 'block';
modalMain.addClass("slideUp");
modalMain.removeClass("slideDown");
m_cancelButton.addEventListener('click', () => {
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
more_modal.style.display = 'none';
}, 150);
});
});
var abimodal = document.getElementById('myAbiModal'); var abimodal = document.getElementById('myAbiModal');
var AbiAddButton = document.getElementById('AbiAddButton'); var AbiAddButton = document.getElementById('AbiAddButton');
var AbiCancelButton = document.getElementById('AbiCancelButton'); var AbiCancelButton = document.getElementById('AbiCancelButton');
var modalMain = $('.modal-content');
$(document).on('click', '.addabi', function (event) { $(document).on('click', '.addabi', function (event) {
abimodal.style.display = 'block'; abimodal.style.display = 'block';
modalMain.addClass("slideUp");
modalMain.removeClass("slideDown");
var uniqid2 = $(this).attr('data-uniqid2'); var uniqid2 = $(this).attr('data-uniqid2');
var postAbiElement = $(this).closest('.addabi'); var postAbiElement = $(this).closest('.addabi');
AbiCancelButton.addEventListener('click', () => { AbiCancelButton.addEventListener('click', () => {
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
abimodal.style.display = 'none'; abimodal.style.display = 'none';
}, 150);
}); });
$('#AbiForm').off('submit').on('submit', function (event) { $('#AbiForm').off('submit').on('submit', function (event) {
@@ -358,27 +429,35 @@ $(document).ready(function() {
event.preventDefault(); event.preventDefault();
var abitext = document.getElementById("abitexts").value; var abitext = document.getElementById("abitexts").value;
var usernames = '<?php echo $username; ?>';
if(abitext == ""){ if(abitext == ""){
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
abimodal.style.display = 'none'; abimodal.style.display = 'none';
}, 150);
}else{ }else{
$.ajax({ $.ajax({
url: '../abi/addabi.php', url: '../abi/addabi.php',
method: 'POST', method: 'POST',
data: { uniqid: uniqid2, abitext: abitext}, data: { uniqid: uniqid2, abitext: abitext, username: usernames },
dataType: 'json', dataType: 'json',
success: function (response) { success: function (response) {
console.log(response); // レスポンス内容をコンソールに表示 console.log(response); // レスポンス内容をコンソールに表示
if (response.success) { if (response.success) {
abimodal.style.display = 'none'; abimodal.style.display = 'none';
postAbiElement.remove(); postAbiElement.remove();
console.log(response);
} else { } else {
abimodal.style.display = 'none';
postAbiElement.remove();
} }
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {
console.log(error);
abimodal.style.display = 'none';
postAbiElement.remove();
} }
}); });
} }
+2 -2
View File
@@ -1,4 +1,4 @@
uwuzu uwuzu
1.2.13 1.2.14
2023/08/29 2023/09/03
daichimarukana,putonfps daichimarukana,putonfps
+10
View File
@@ -1,6 +1,16 @@
## リリースノートだぜぇぇぇぇぇぇい!!!!!!! ## リリースノートだぜぇぇぇぇぇぇい!!!!!!!
ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...) ここにはuwuzuの更新情報を載せてくぜぇ~!(いやまてテンションおかしいだろ...)
## Version 1.2.14
リリース日:2023/09/03
お知らせ表示部で編集者が正しく反映されない問題を修正しました。
FTLで投稿の順番がおかしくなるバグを修正しました。
ちょっとうれしくてもしかしたらちょっとうざいかもしれない機能を実装しました()
画像をクリックすることで画像が新しいタブで開かれるようにしました。
ホーム画面のURLに「?text=投稿欄に入れたい文字列」とすることによりリンクより共有などをできるようにしました!
フォロー通知を送信するようにしました!
セキュリティを強化しました!
## Version 1.2.13 ## Version 1.2.13
リリース日:2023/08/29 リリース日:2023/08/29
致命的なバグを修正しました。 致命的なバグを修正しました。
+42 -8
View File
@@ -21,7 +21,9 @@ $servernamefile = "../server/servername.txt";
$onlyuserfile = "../server/onlyuser.txt"; $onlyuserfile = "../server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile); $onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
// 変数の初期化 // 変数の初期化
$current_date = null; $current_date = null;
@@ -69,10 +71,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -96,10 +114,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
+42 -8
View File
@@ -23,7 +23,9 @@ $stmt = null;
$res = null; $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
$userid = htmlentities($_SESSION['userid']); $userid = htmlentities($_SESSION['userid']);
$username = htmlentities($_SESSION['username']); $username = htmlentities($_SESSION['username']);
@@ -59,10 +61,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -86,10 +104,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
+42 -8
View File
@@ -8,7 +8,9 @@ require('../db.php');
$onlyuserfile = "../server/onlyuser.txt"; $onlyuserfile = "../server/onlyuser.txt";
$onlyuser = file_get_contents($onlyuserfile); $onlyuser = file_get_contents($onlyuserfile);
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
// 変数の初期化 // 変数の初期化
$current_date = null; $current_date = null;
@@ -56,10 +58,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -83,10 +101,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
+55 -10
View File
@@ -26,7 +26,9 @@ $stmt = null;
$res = null; $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
$userid = htmlentities($_SESSION['userid']); $userid = htmlentities($_SESSION['userid']);
$username = htmlentities($_SESSION['username']); $username = htmlentities($_SESSION['username']);
@@ -62,10 +64,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -89,10 +107,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -317,7 +351,7 @@ if( !empty($_POST['btn_submit']) ) {
$pdo->beginTransaction(); $pdo->beginTransaction();
$msg = ''.$ueuse.''; $msg = ''.$ueuse.'';
$title = ''.$userid.'さんが返信しました!'; $title = ''.$username.'さんが返信しました!';
$url = $_SERVER['REQUEST_URI']; $url = $_SERVER['REQUEST_URI'];
$userchk = 'none'; $userchk = 'none';
// 通知用SQL作成 // 通知用SQL作成
@@ -670,12 +704,18 @@ $(document).ready(function() {
$(document).on('click', '.addabi', function (event) { $(document).on('click', '.addabi', function (event) {
abimodal.style.display = 'block'; abimodal.style.display = 'block';
modalMain.addClass("slideUp");
modalMain.removeClass("slideDown");
var uniqid2 = $(this).attr('data-uniqid2'); var uniqid2 = $(this).attr('data-uniqid2');
var postAbiElement = $(this).closest('.addabi'); var postAbiElement = $(this).closest('.addabi');
AbiCancelButton.addEventListener('click', () => { AbiCancelButton.addEventListener('click', () => {
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
abimodal.style.display = 'none'; abimodal.style.display = 'none';
}, 150);
}); });
$('#AbiForm').off('submit').on('submit', function (event) { $('#AbiForm').off('submit').on('submit', function (event) {
@@ -683,14 +723,19 @@ $(document).ready(function() {
event.preventDefault(); event.preventDefault();
var abitext = document.getElementById("abitexts").value; var abitext = document.getElementById("abitexts").value;
var username = "<?php echo $username?>";
if(abitext == ""){ if(abitext == ""){
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
abimodal.style.display = 'none'; abimodal.style.display = 'none';
}, 150);
}else{ }else{
$.ajax({ $.ajax({
url: '../abi/addabi.php', url: '../abi/addabi.php',
method: 'POST', method: 'POST',
data: { uniqid: uniqid2, abitext: abitext}, data: { uniqid: uniqid2, abitext: abitext, username: username},
dataType: 'json', dataType: 'json',
success: function (response) { success: function (response) {
console.log(response); // レスポンス内容をコンソールに表示 console.log(response); // レスポンス内容をコンソールに表示
+134 -15
View File
@@ -24,12 +24,13 @@ $stmt = null;
$res = null; $res = null;
$option = null; $option = null;
session_name('uwuzu_s_id');
session_start(); session_start();
session_regenerate_id(true);
$userid = htmlentities($_SESSION['userid']); $userid = htmlentities($_SESSION['userid']);
$username = htmlentities($_SESSION['username']); $username = htmlentities($_SESSION['username']);
try { try {
$option = array( $option = array(
@@ -61,10 +62,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -88,10 +105,26 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$_SESSION['userid'] = $userid; $_SESSION['userid'] = $userid;
$_SESSION['username'] = $username; $_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"]; $_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14); setcookie('userid', $userid,[
setcookie('username', $username, time() + 60 * 60 * 24 * 14); 'expires' => time() + 60 * 60 * 24 * 14,
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14); 'path' => '/',
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14); '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{ }else{
header("Location: ../login.php"); header("Location: ../login.php");
exit; exit;
@@ -276,6 +309,41 @@ if (!empty($_POST['follow'])) {
$updateQuery->bindValue(':userid', $userid, PDO::PARAM_STR); $updateQuery->bindValue(':userid', $userid, PDO::PARAM_STR);
$res_follow = $updateQuery->execute(); $res_follow = $updateQuery->execute();
$datetime = date("Y-m-d H:i:s");
$pdo->beginTransaction();
try {
$touserid = $userData["userid"];
$datetime = date("Y-m-d H:i:s");
$msg = "".$userid."さんにフォローされました。";
$title = "🎉".$userid."さんにフォローされました!🎉";
$url = "/@" . $userid . "";
$userchk = 'none';
// 通知用SQL作成
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)");
$stmt->bindParam(':touserid', $touserid, PDO::PARAM_STR);
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR);
$stmt->bindParam(':url', $url, PDO::PARAM_STR);
$stmt->bindParam(':userchk', $userchk, PDO::PARAM_STR);
$stmt->bindParam(':title', $title, PDO::PARAM_STR);
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->execute();
// コミット
$res = $pdo->commit();
} catch(Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
if ($res && $res_follow) { if ($res && $res_follow) {
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location:" . $url); header("Location:" . $url);
@@ -283,9 +351,8 @@ if (!empty($_POST['follow'])) {
} else { } else {
$error_message[] = '更新に失敗しました。'; $error_message[] = '更新に失敗しました。';
} }
$stmt = null;
} }
} elseif (!empty($_POST['unfollow'])) { } elseif (!empty($_POST['unfollow'])) {
// フォロー解除ボタンが押された場合の処理 // フォロー解除ボタンが押された場合の処理
$followerList = explode(',', $userdata['follower']); $followerList = explode(',', $userdata['follower']);
@@ -592,28 +659,43 @@ $(document).ready(function() {
const modal1 = document.getElementById('myModal'); const modal1 = document.getElementById('myModal');
const openModalButton = document.getElementById('openModalButton'); const openModalButton = document.getElementById('openModalButton');
const closeButton = document.getElementById('closeModal'); const closeButton = document.getElementById('closeModal');
var modalMain = $('.modal-content');
openModalButton.addEventListener('click', () => { openModalButton.addEventListener('click', () => {
modal1.style.display = 'block'; modal1.style.display = 'block';
modalMain.addClass("slideUp");
modalMain.removeClass("slideDown");
}); });
closeButton.addEventListener('click', () => { closeButton.addEventListener('click', () => {
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
modal1.style.display = 'none'; modal1.style.display = 'none';
}, 150);
}); });
var modal = document.getElementById('myDelModal'); var modal = document.getElementById('myDelModal');
var deleteButton = document.getElementById('deleteButton'); var deleteButton = document.getElementById('deleteButton');
var cancelButton = document.getElementById('cancelButton'); // 追加 var cancelButton = document.getElementById('cancelButton'); // 追加
var modalMain = $('.modal-content');
$(document).on('click', '.delbtn', function (event) { $(document).on('click', '.delbtn', function (event) {
modal.style.display = 'block'; modal.style.display = 'block';
modalMain.addClass("slideUp");
modalMain.removeClass("slideDown");
var uniqid2 = $(this).attr('data-uniqid2'); var uniqid2 = $(this).attr('data-uniqid2');
var postElement = $(this).closest('.ueuse'); var postElement = $(this).closest('.ueuse');
deleteButton.addEventListener('click', () => { deleteButton.addEventListener('click', () => {
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
modal.style.display = 'none'; modal.style.display = 'none';
}, 150);
$.ajax({ $.ajax({
url: '../delete/delete.php', url: '../delete/delete.php',
@@ -634,25 +716,54 @@ $(document).ready(function() {
}); });
cancelButton.addEventListener('click', () => { // 追加 cancelButton.addEventListener('click', () => { // 追加
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
modal.style.display = 'none'; modal.style.display = 'none';
}, 150);
}); });
}); });
var more_modal = document.getElementById('myMoreModal');
var m_cancelButton = document.getElementById('m_c_button'); // 追加
var modalMain = $('.modal-content');
$(document).on('click', '.more_btn', function (event) {
more_modal.style.display = 'block';
modalMain.addClass("slideUp");
modalMain.removeClass("slideDown");
m_cancelButton.addEventListener('click', () => {
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
more_modal.style.display = 'none';
}, 150);
});
});
var abimodal = document.getElementById('myAbiModal'); var abimodal = document.getElementById('myAbiModal');
var AbiAddButton = document.getElementById('AbiAddButton'); var AbiAddButton = document.getElementById('AbiAddButton');
var AbiCancelButton = document.getElementById('AbiCancelButton'); var AbiCancelButton = document.getElementById('AbiCancelButton');
var modalMain = $('.modal-content');
$(document).on('click', '.addabi', function (event) { $(document).on('click', '.addabi', function (event) {
abimodal.style.display = 'block'; abimodal.style.display = 'block';
modalMain.addClass("slideUp");
modalMain.removeClass("slideDown");
var uniqid2 = $(this).attr('data-uniqid2'); var uniqid2 = $(this).attr('data-uniqid2');
var postAbiElement = $(this).closest('.addabi'); var postAbiElement = $(this).closest('.addabi');
AbiCancelButton.addEventListener('click', () => { AbiCancelButton.addEventListener('click', () => {
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
abimodal.style.display = 'none'; abimodal.style.display = 'none';
}, 150);
}); });
$('#AbiForm').off('submit').on('submit', function (event) { $('#AbiForm').off('submit').on('submit', function (event) {
@@ -660,27 +771,35 @@ $(document).ready(function() {
event.preventDefault(); event.preventDefault();
var abitext = document.getElementById("abitexts").value; var abitext = document.getElementById("abitexts").value;
var usernames = '<?php echo $username; ?>';
if(abitext == ""){ if(abitext == ""){
modalMain.removeClass("slideUp");
modalMain.addClass("slideDown");
window.setTimeout(function(){
abimodal.style.display = 'none'; abimodal.style.display = 'none';
}, 150);
}else{ }else{
$.ajax({ $.ajax({
url: '../abi/addabi.php', url: '../abi/addabi.php',
method: 'POST', method: 'POST',
data: { uniqid: uniqid2, abitext: abitext}, data: { uniqid: uniqid2, abitext: abitext, username: usernames },
dataType: 'json', dataType: 'json',
success: function (response) { success: function (response) {
console.log(response); // レスポンス内容をコンソールに表示 console.log(response); // レスポンス内容をコンソールに表示
if (response.success) { if (response.success) {
abimodal.style.display = 'none'; abimodal.style.display = 'none';
postAbiElement.remove(); postAbiElement.remove();
console.log(response);
} else { } else {
abimodal.style.display = 'none';
postAbiElement.remove();
} }
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {
console.log(error);
abimodal.style.display = 'none';
postAbiElement.remove();
} }
}); });
} }