diff --git a/.well-known/nodeinfo/index.php b/.well-known/nodeinfo/index.php index e9980d4..50542ed 100644 --- a/.well-known/nodeinfo/index.php +++ b/.well-known/nodeinfo/index.php @@ -2,7 +2,7 @@ $serversettings_file = "../../server/serversettings.ini"; $serversettings = parse_ini_file($serversettings_file, true); if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){ - header("Content-Type: application/json"); + header("Content-Type: application/activity+json"); header("charset=utf-8"); header("Access-Control-Allow-Origin: *"); diff --git a/.well-known/webfinger/index.php b/.well-known/webfinger/index.php index 2736205..e3588c5 100644 --- a/.well-known/webfinger/index.php +++ b/.well-known/webfinger/index.php @@ -2,7 +2,7 @@ $serversettings_file = "../../server/serversettings.ini"; $serversettings = parse_ini_file($serversettings_file, true); if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){ - header("Content-Type: application/json"); + header("Content-Type: application/jrd+json"); header("charset=utf-8"); header("Access-Control-Allow-Origin: *"); diff --git a/actor/index.php b/actor/index.php index 3138f78..5ac671e 100644 --- a/actor/index.php +++ b/actor/index.php @@ -2,7 +2,7 @@ $serversettings_file = "../server/serversettings.ini"; $serversettings = parse_ini_file($serversettings_file, true); if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUOTES, 'UTF-8') === "true"){ - header("Content-Type: application/json"); + header("Content-Type: application/activity+json"); header("charset=utf-8"); header("Access-Control-Allow-Origin: *"); @@ -47,6 +47,11 @@ if(htmlspecialchars($serversettings["serverinfo"]["server_activitypub"], ENT_QUO "@context" => [ "https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1", + array( + "schema" => "http://schema.org#", + "PropertyValue" => "schema:PropertyValue", + "value" => "schema:value", + ), ], "id" => "https://".$domain."/actor/?actor=@".$userid."", "type" => "Person", diff --git a/addauthcode.php b/addauthcode.php index 39cbf43..a339a18 100644 --- a/addauthcode.php +++ b/addauthcode.php @@ -185,6 +185,7 @@ $pdo = null; + diff --git a/admin/addadmin.php b/admin/addadmin.php index c27008e..2edcaa7 100644 --- a/admin/addadmin.php +++ b/admin/addadmin.php @@ -122,7 +122,7 @@ if( !empty($_POST['btn_submit']) ) { // アップロードされたファイル情報 $uploadedFile = $_FILES['image']; - if(check_mime_video($uploadedFile['tmp_name'])){ + if(check_mime($uploadedFile['tmp_name'])){ // アップロードされたファイルの拡張子を取得 $extension = pathinfo($uploadedFile['name'], PATHINFO_EXTENSION); @@ -136,7 +136,7 @@ if( !empty($_POST['btn_submit']) ) { delete_exif($extension, $uploadedFile['tmp_name']); // ファイルを移動 - $result = move_uploaded_file($uploadedFile['tmp_name'], $uploadedPath); + $result = move_uploaded_file($uploadedFile['tmp_name'], '../'.$uploadedPath); if ($result) { $iconName = $uploadedPath; // 保存されたファイルのパスを使用 @@ -231,7 +231,7 @@ if( !empty($_POST['btn_submit']) ) { $error_message[] = '表示名を入力してください。(USERNAME_INPUT_PLEASE)'; } else { // 文字数を確認 - if( 25 < mb_strlen($username, 'UTF-8') ) { + if( 50 < mb_strlen($username, 'UTF-8') ) { $error_message[] = 'ユーザーネームは50文字以内で入力してください。(USERNAME_OVER_MAX_COUNT)'; } } @@ -249,6 +249,9 @@ if( !empty($_POST['btn_submit']) ) { if($result > 0){ $error_message[] = 'このID('.$userid.')は既に使用されています。他のIDを作成してください。(USERID_SHIYOUZUMI)'; } + if(!(preg_match("/^[a-zA-Z0-9_]+$/", $userid))){ + $error_message[] = "IDは半角英数字で入力してください。(「_」は使用可能です。)(USERID_DONT_USE_WORD)"; + } } @@ -337,8 +340,8 @@ if( !empty($_POST['btn_submit']) ) { } // 文字数を確認 - if( 100 < mb_strlen($password, 'UTF-8') ) { - $error_message[] = 'パスワードは100文字以内で入力してください。(PASSWORD_OVER_MAX_COUNT)'; + if( 256 < mb_strlen($password, 'UTF-8') ) { + $error_message[] = 'パスワードは256文字以内で入力してください。(PASSWORD_OVER_MAX_COUNT)'; } } @@ -431,6 +434,7 @@ $pdo = null; + diff --git a/admin/index.php b/admin/index.php index 3472a37..b9a5d3c 100644 --- a/admin/index.php +++ b/admin/index.php @@ -75,6 +75,26 @@ if($result2 > 0){ exit; } +if (in_array("gd", get_loaded_extensions())) { + $check_gd = true; +} else { + $check_gd = false; +} +if (in_array("fileinfo", get_loaded_extensions())) { + $check_fileinfo = true; +} else { + $check_fileinfo = false; +} +if (in_array("mbstring", get_loaded_extensions())) { + $check_mbstring = true; +} else { + $check_mbstring = false; +} +if (in_array("pdo_mysql", get_loaded_extensions())) { + $check_pdo_mysql = true; +} else { + $check_pdo_mysql = false; +} // データベースの接続を閉じる $pdo = null; @@ -84,6 +104,7 @@ $pdo = null; + @@ -115,7 +136,15 @@ $pdo = null;

おめでとうございます!!!

uwuzuの導入が完了しました!

-

これより管理者アカウントの登録を行います。
userロールとofficialロールの設定はお済みですか?
userロールとofficialロールがないとuwuzuは正しく動作しないので設定をしていない方は一度このページを閉じて設定してください!
また、php.iniよりGDの有効化または導入はお済みですか?GDがないとuwuzuは二段階認証が正しく動作しないため絶対に設定してください!

+

これより管理者アカウントの登録を行います。
userロールとofficialロール、iceロールの設定はお済みですか?
userロールとofficialロール、iceロールがないとuwuzuは正しく動作しないので設定をしていない方は一度このページを閉じて設定してください!
また、php.iniよりGDの有効化または導入はお済みですか?GDがないとuwuzuは二段階認証が正しく動作しないため絶対に設定してください!

+ +
+

GD :

+

Fileinfo :

+

mbstring :

+

pdo_mysql :

+
+

uwuzu
Version :

diff --git a/admin/success.php b/admin/success.php index 22e0e1c..9508344 100644 --- a/admin/success.php +++ b/admin/success.php @@ -79,6 +79,7 @@ if(!(empty($_SESSION['backupcode']))){ + diff --git a/api/bot-api.php b/api/bot-api.php index 5e71f39..70b33cf 100644 --- a/api/bot-api.php +++ b/api/bot-api.php @@ -299,7 +299,7 @@ if(isset($_GET['token'])&&isset($_GET['type'])) { } if($type === "reply"){ - if(isset($_GET['ueuse'])) { + if(isset($_GET['ueuse']) && isset($_GET['uniqid'])) { $rpuniqid = htmlentities($_GET['uniqid']); $ueuse = nl2br(htmlentities($_GET['ueuse'])); @@ -679,6 +679,422 @@ if(isset($_GET['token'])&&isset($_GET['type'])) { } } + if($type === "getuser_from_userid"){ + + if(isset($_GET['userid'])) { + $userid = htmlentities($_GET['userid']); + + if($token === 'ice'){ + $err = "this_account_has_been_frozen"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + }elseif($token === ''){ + $err = "token_input_error"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + require('../db.php'); + + $datetime = array(); + $pdo = null; + + session_start(); + + 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 (!empty($pdo)) { + + // データベース接続の設定 + $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, + )); + + $userQuery = $dbh->prepare("SELECT username, userid,role FROM account WHERE token = :token"); + $userQuery->bindValue(':token', $token); + $userQuery->execute(); + $userData = $userQuery->fetch(); + + if(empty($userData["userid"])){ + $err = "token_invalid"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + }elseif($userData["role"] === "ice"){ + $err = "this_account_has_been_frozen"; + $response = array( + 'error_code' => $err, + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + }else{ + $userQuery = $pdo->prepare("SELECT username,userid,profile,datetime,follow,follower,iconname,headname FROM account WHERE userid = :userid"); + $userQuery->bindValue(':userid', $userid); + $userQuery->execute(); + $userdata = $userQuery->fetch(); + + if (empty($userdata)){ + $response = array( + 'error_code' => "userid_not_found", + ); + }else{ + $followcnts = explode(',', $userdata["follow"]); + $userdata["follow_cnt"] = count($followcnts)-1; + + $followercnts = explode(',', $userdata["follower"]); + $userdata["follower_cnt"] = count($followercnts)-1; + + $response = array( + 'user_name' => decode_yajirushi(htmlspecialchars_decode($userdata["username"])), + 'user_id' => decode_yajirushi(htmlspecialchars_decode($userdata["userid"])), + 'profile' => decode_yajirushi(htmlspecialchars_decode($userdata["profile"])), + 'user_icon' => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userdata["iconname"])), + 'user_header' => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userdata["headname"])), + 'registered_date' => decode_yajirushi(htmlspecialchars_decode($userdata["datetime"])), + 'follow' => decode_yajirushi(htmlspecialchars_decode($userdata["follow"])), + 'follow_cnt' => decode_yajirushi(htmlspecialchars_decode($userdata["follow_cnt"])), + 'follower' => decode_yajirushi(htmlspecialchars_decode($userdata["follower"])), + 'follower_cnt' => decode_yajirushi(htmlspecialchars_decode($userdata["follower_cnt"])), + ); + } + echo json_encode($response, JSON_UNESCAPED_UNICODE); + } + } + + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + + if($type === "getltl"){ + + if(isset($_GET['limit'])) { + + $itemsPerPage = htmlentities((int)$_GET['limit']); // 1ページあたりの投稿数 + if(isset($_GET['page'])) { + $pageNumber = htmlentities((int)$_GET['page']); + if(!(is_int($pageNumber))){ + $pageNumber = 1; + } + }else{ + $pageNumber = 1; + } + $offset = ($pageNumber - 1) * $itemsPerPage; + + $messages = array(); + + if($token === 'ice'){ + $err = "this_account_has_been_frozen"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + }elseif($token === ''){ + $err = "token_input_error"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + require('../db.php'); + + $datetime = array(); + $pdo = null; + + session_start(); + + 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 (!empty($pdo)) { + + // データベース接続の設定 + $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, + )); + + $userQuery = $dbh->prepare("SELECT username, userid,role FROM account WHERE token = :token"); + $userQuery->bindValue(':token', $token); + $userQuery->execute(); + $userData = $userQuery->fetch(); + + if(empty($userData["userid"])){ + $err = "token_invalid"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + }elseif($userData["role"] === "ice"){ + $err = "this_account_has_been_frozen"; + $response = array( + 'error_code' => $err, + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + }else{ + + $sql = "SELECT ueuse.* + FROM ueuse + LEFT JOIN account ON ueuse.account = account.userid + WHERE ueuse.rpuniqid = '' AND account.role != 'ice' + ORDER BY ueuse.datetime DESC + LIMIT :offset, :itemsPerPage"; + + $stmt = $pdo->prepare($sql); + $stmt->bindValue(':offset', $offset, PDO::PARAM_INT); + $stmt->bindValue(':itemsPerPage', $itemsPerPage, PDO::PARAM_INT); + $stmt->execute(); + $message_array = $stmt; + + while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) { + + $messages[] = $row; + } + + // ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える + foreach ($messages as &$message) { + $userQuery = $pdo->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid"); + $userQuery->bindValue(':userid', $message["account"]); + $userQuery->execute(); + $userData = $userQuery->fetch(); + + if ($userData) { + $message['username'] = $userData['username']; + $message['role'] = $userData['role']; + } + } + + if (!empty($messages)) { + $response = array(); // ループ外で $response を初期化 + + foreach ($messages as $ueusedata) { + $favcnts = explode(',', $ueusedata["favorite"]); + $ueusedata["favorite_cnt"] = count($favcnts) - 1; + + $item = [ + 'account' => decode_yajirushi(htmlspecialchars_decode($ueusedata["account"])), + 'username' => decode_yajirushi(htmlspecialchars_decode($ueusedata["username"])), + 'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])), + 'ueuse' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])), + 'photo1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo1"]))), + 'photo2' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo2"]))), + 'photo3' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo3"]))), + 'photo4' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo4"]))), + 'video1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["video1"]))), + 'favorite' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"])), + 'favorite_cnt' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite_cnt"])), + 'datetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["datetime"])), + 'abi' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abi"])), + 'abidatetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abidate"])), + 'nsfw' => decode_yajirushi(htmlspecialchars_decode($ueusedata["nsfw"])), + ]; + + $response[$ueusedata["uniqid"]] = $item; // ループ内で $response にデータを追加 + } + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + } else { + $err = "ueuse_not_found"; + $response = array( + 'error_code' => $err, + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + } + + + $pdo = null; + } + } + + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + + if($type === "getueuse"){ + + if(isset($_GET['ueuseid'])) { + + $ueuseid = htmlentities($_GET['ueuseid']); + + if($token === 'ice'){ + $err = "this_account_has_been_frozen"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + }elseif($token === ''){ + $err = "token_input_error"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + require('../db.php'); + + $datetime = array(); + $pdo = null; + + session_start(); + + 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 (!empty($pdo)) { + + // データベース接続の設定 + $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, + )); + + $userQuery = $dbh->prepare("SELECT username, userid,role FROM account WHERE token = :token"); + $userQuery->bindValue(':token', $token); + $userQuery->execute(); + $userData = $userQuery->fetch(); + + if(empty($userData["userid"])){ + $err = "token_invalid"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + }elseif($userData["role"] === "ice"){ + $err = "this_account_has_been_frozen"; + $response = array( + 'error_code' => $err, + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + }else{ + + $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, + )); + + $ueuseQuery = $pdo->prepare("SELECT * FROM ueuse WHERE uniqid = :ueuseid"); + $ueuseQuery->bindValue(':ueuseid', $ueuseid); + $ueuseQuery->execute(); + $ueusedata = $ueuseQuery->fetch(); + + if (empty($ueusedata)){ + $response = array( + 'error_code' => "ueuseid_not_found", + ); + }else{ + $userQuery = $pdo->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid"); + $userQuery->bindValue(':userid', $ueusedata["account"]); + $userQuery->execute(); + $userData = $userQuery->fetch(); + if ($userData) { + $ueusedata['username'] = $userData['username']; + $ueusedata['role'] = $userData['role']; + } + + + $favcnts = explode(',', $ueusedata["favorite"]); + $ueusedata["favorite_cnt"] = count($favcnts)-1; + + $response = array( + 'account' => decode_yajirushi(htmlspecialchars_decode($ueusedata["account"])), + 'username' => decode_yajirushi(htmlspecialchars_decode($ueusedata["username"])), + 'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])), + 'ueuse' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])), + 'photo1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo1"]))), + 'photo2' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo2"]))), + 'photo3' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo3"]))), + 'photo4' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo4"]))), + 'video1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', 'https://' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["video1"]))), + 'favorite' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"])), + 'favorite_cnt' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite_cnt"])), + 'datetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["datetime"])), + 'abi' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abi"])), + 'abidatetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abidate"])), + 'nsfw' => decode_yajirushi(htmlspecialchars_decode($ueusedata["nsfw"])), + ); + } + echo json_encode($response, JSON_UNESCAPED_UNICODE); + + + $pdo = null; + } + } + + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + }else{ $err = "input_not_found"; diff --git a/api/ltl-api.php b/api/ltl-api.php index 5b1213b..ebc48e7 100644 --- a/api/ltl-api.php +++ b/api/ltl-api.php @@ -2,116 +2,12 @@ header("Content-Type: application/json"); header("charset=utf-8"); header("Access-Control-Allow-Origin: *"); -function decode_yajirushi($postText){ - $postText = str_replace('←', '←', $postText); - $postText = str_replace('↓', '↓', $postText); - $postText = str_replace('↑', '↑', $postText); - $postText = str_replace('→', '→', $postText); - return $postText; -} -if(isset($_GET['limit'])) { - $itemsPerPage = htmlentities((int)$_GET['limit']); // 1ページあたりの投稿数 - if(isset($_GET['page'])) { - $pageNumber = htmlentities((int)$_GET['page']); - }else{ - $pageNumber = 1; - } - $offset = ($pageNumber - 1) * $itemsPerPage; +$err = "API_has_been_deleted"; +$response = array( + 'error_code' => $err, +); + +echo json_encode($response, JSON_UNESCAPED_UNICODE); - $messages = array(); - - require('../db.php'); - - $datetime = array(); - $pdo = null; - - session_start(); - - 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 (!empty($pdo)) { - $sql = "SELECT account, username, uniqid, rpuniqid, ueuse, datetime, photo1, photo2, video1, favorite, abi, abidate, nsfw FROM ueuse WHERE rpuniqid = '' ORDER BY datetime DESC LIMIT " . intval($offset) . ", " . intval($itemsPerPage); - $message_array = $pdo->query($sql); - - while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) { - - $messages[] = $row; - } - - // ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える - foreach ($messages as &$message) { - $userQuery = $pdo->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid"); - $userQuery->bindValue(':userid', $message["account"]); - $userQuery->execute(); - $userData = $userQuery->fetch(); - - if ($userData) { - $message['username'] = $userData['username']; - $message['role'] = $userData['role']; - } - } - - if (!empty($messages)) { - $response = array(); // ループ外で $response を初期化 - - foreach ($messages as $ueusedata) { - $favcnts = explode(',', $ueusedata["favorite"]); - $ueusedata["favorite_cnt"] = count($favcnts) - 1; - - $item = [ - 'account' => decode_yajirushi(htmlspecialchars_decode($ueusedata["account"])), - 'username' => decode_yajirushi(htmlspecialchars_decode($ueusedata["username"])), - 'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])), - 'ueuse' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])), - 'photo1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', '' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo1"]))), - 'photo2' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', '' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["photo2"]))), - 'video1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', '' . $_SERVER['HTTP_HOST'] . '/', $ueusedata["video1"]))), - 'favorite' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"])), - 'favorite_cnt' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite_cnt"])), - 'datetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["datetime"])), - 'abi' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abi"])), - 'abidatetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abidate"])), - 'nsfw' => decode_yajirushi(htmlspecialchars_decode($ueusedata["nsfw"])), - ]; - - $response[$ueusedata["uniqid"]] = $item; // ループ内で $response にデータを追加 - } - - echo json_encode($response, JSON_UNESCAPED_UNICODE); - } else { - $err = "ueuse_not_found"; - $response = array( - 'error_code' => $err, - ); - - echo json_encode($response, JSON_UNESCAPED_UNICODE); - } - - - $pdo = null; - } - -}else{ - - $err = "input_not_found"; - $response = array( - 'error_code' => $err, - ); - - echo json_encode($response, JSON_UNESCAPED_UNICODE); -} ?> \ No newline at end of file diff --git a/api/ueuse-api.php b/api/ueuse-api.php index cdcf142..ebc48e7 100644 --- a/api/ueuse-api.php +++ b/api/ueuse-api.php @@ -2,96 +2,12 @@ header("Content-Type: application/json"); header("charset=utf-8"); header("Access-Control-Allow-Origin: *"); -function decode_yajirushi($postText){ - $postText = str_replace('←', '←', $postText); - $postText = str_replace('↓', '↓', $postText); - $postText = str_replace('↑', '↑', $postText); - $postText = str_replace('→', '→', $postText); - return $postText; -} -if(isset($_GET['ueuseid'])) { -$ueuseid = htmlentities($_GET['ueuseid']); +$err = "API_has_been_deleted"; +$response = array( + 'error_code' => $err, +); + +echo json_encode($response, JSON_UNESCAPED_UNICODE); - -require('../db.php'); - -$datetime = array(); -$pdo = null; - -session_start(); - - 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 (!empty($pdo)) { - - $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, - )); - - $ueuseQuery = $pdo->prepare("SELECT account, ueuse, uniqid, rpuniqid, datetime, photo1, photo2, video1, favorite, abi, abidate FROM ueuse WHERE uniqid = :ueuseid"); - $ueuseQuery->bindValue(':ueuseid', $ueuseid); - $ueuseQuery->execute(); - $ueusedata = $ueuseQuery->fetch(); - } - -if (empty($ueusedata)){ - $response = array( - 'error_code' => "ueuseid_not_found", - ); -}else{ - $userQuery = $pdo->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid"); - $userQuery->bindValue(':userid', $ueusedata["account"]); - $userQuery->execute(); - $userData = $userQuery->fetch(); - if ($userData) { - $ueusedata['username'] = $userData['username']; - $ueusedata['role'] = $userData['role']; - } - - - $favcnts = explode(',', $ueusedata["favorite"]); - $ueusedata["favorite_cnt"] = count($favcnts)-1; - - $response = array( - 'userid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["account"])), - 'user_name' => decode_yajirushi(htmlspecialchars_decode($ueusedata["username"])), - 'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])), - 'ueuse' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])), - 'photo1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', ''.$_SERVER['HTTP_HOST'].'/', $ueusedata["photo1"]))), - 'photo2' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', ''.$_SERVER['HTTP_HOST'].'/', $ueusedata["photo2"]))), - 'video1' => decode_yajirushi(htmlspecialchars_decode(str_replace('../', ''.$_SERVER['HTTP_HOST'].'/', $ueusedata["video1"]))), - 'favorite' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"])), - 'favorite_cnt' => decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite_cnt"])), - 'datetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["datetime"])), - 'abi' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abi"])), - 'abidatetime' => decode_yajirushi(htmlspecialchars_decode($ueusedata["abidate"])), - ); -} -echo json_encode($response, JSON_UNESCAPED_UNICODE);; - -}else{ - - $err = "input_not_found"; - $response = array( - 'error_code' => $err, - ); - - echo json_encode($response, JSON_UNESCAPED_UNICODE); -} ?> \ No newline at end of file diff --git a/api/userdata-api.php b/api/userdata-api.php index 4e664f0..ebc48e7 100644 --- a/api/userdata-api.php +++ b/api/userdata-api.php @@ -2,87 +2,12 @@ header("Content-Type: application/json"); header("charset=utf-8"); header("Access-Control-Allow-Origin: *"); -function decode_yajirushi($postText){ - $postText = str_replace('←', '←', $postText); - $postText = str_replace('↓', '↓', $postText); - $postText = str_replace('↑', '↑', $postText); - $postText = str_replace('→', '→', $postText); - return $postText; -} -if(isset($_GET['userid'])) { -$search = htmlentities($_GET['userid']); - -$domain = $_SERVER['HTTP_HOST']; - -require('../db.php'); - -$datetime = array(); -$pdo = null; - -session_start(); - - 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 (!empty($pdo)) { - - $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, - )); - - $userQuery = $pdo->prepare("SELECT username,userid,profile,datetime,follow,follower,iconname,headname FROM account WHERE userid = :userid"); - $userQuery->bindValue(':userid', $search); - $userQuery->execute(); - $userdata = $userQuery->fetch(); - } -if (empty($userdata)){ - $response = array( - 'error_code' => "userid_not_found", - ); -}else{ - $followcnts = explode(',', $userdata["follow"]); - $userdata["follow_cnt"] = count($followcnts)-1; - - $followercnts = explode(',', $userdata["follower"]); - $userdata["follower_cnt"] = count($followercnts)-1; - - $response = array( - 'user_name' => decode_yajirushi(htmlspecialchars_decode($userdata["username"])), - 'user_id' => decode_yajirushi(htmlspecialchars_decode($userdata["userid"])), - 'profile' => decode_yajirushi(htmlspecialchars_decode($userdata["profile"])), - 'user_icon' => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userdata["iconname"])), - 'user_header' => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userdata["headname"])), - 'registered_date' => decode_yajirushi(htmlspecialchars_decode($userdata["datetime"])), - 'follow' => decode_yajirushi(htmlspecialchars_decode($userdata["follow"])), - 'follow_cnt' => decode_yajirushi(htmlspecialchars_decode($userdata["follow_cnt"])), - 'follower' => decode_yajirushi(htmlspecialchars_decode($userdata["follower"])), - 'follower_cnt' => decode_yajirushi(htmlspecialchars_decode($userdata["follower_cnt"])), - ); -} +$err = "API_has_been_deleted"; +$response = array( + 'error_code' => $err, +); + echo json_encode($response, JSON_UNESCAPED_UNICODE); -}else{ - - $err = "input_not_found"; - $response = array( - 'error_code' => $err, - ); - - echo json_encode($response, JSON_UNESCAPED_UNICODE); -} ?> \ No newline at end of file diff --git a/authcodechk.php b/authcodechk.php index c479fca..16c1989 100644 --- a/authcodechk.php +++ b/authcodechk.php @@ -130,6 +130,7 @@ $pdo = null; + diff --git a/authlogin.php b/authlogin.php index 4722141..c283b64 100644 --- a/authlogin.php +++ b/authlogin.php @@ -289,6 +289,7 @@ $pdo = null; + diff --git a/bookmark/index.php b/bookmark/index.php index c6d6ecc..76dac13 100644 --- a/bookmark/index.php +++ b/bookmark/index.php @@ -200,7 +200,7 @@ $pdo = null; - + @@ -282,10 +282,17 @@ $pdo = null;
+
+ +
+ + diff --git a/check.php b/check.php index 641fb07..b64a233 100644 --- a/check.php +++ b/check.php @@ -78,7 +78,7 @@ try { $roleDataArray = array(); foreach ($roles as $roleId) { - $rerole = $dbh->prepare("SELECT rolename, roleauth, rolecolor FROM role WHERE roleidname = :role"); + $rerole = $dbh->prepare("SELECT rolename, roleauth, rolecolor, roleeffect FROM role WHERE roleidname = :role"); $rerole->bindValue(':role', $roleId); $rerole->execute(); $roleDataArray[$roleId] = $rerole->fetch(); @@ -277,6 +277,7 @@ $pdo = null; + @@ -318,9 +319,20 @@ $pdo = null;
-
;"> + +
;">

;"> - +

diff --git a/css/color.css b/css/color.css index edfa731..8532c3c 100644 --- a/css/color.css +++ b/css/color.css @@ -1,7 +1,7 @@ :root { --main-color: #FFC832; --sub-color: #FFFAE6; - --background-color: #f5f5f5; + --background-color: #F5F5F5; --tl-color: #F7F7F7; --ueuse-color:#f5f5f5; --text-color: #252525; diff --git a/css/home.css b/css/home.css index 70f0461..c0fcfa9 100644 --- a/css/home.css +++ b/css/home.css @@ -46,15 +46,12 @@ body{ cursor: pointer; border: none; display: block; - width:50%; + width: fit-content; margin: 32px; - padding: 8px 5%; + padding: 8px 20%; margin-left: auto; margin-right: auto; - padding-top: 8px; - padding-bottom: 8px; - background-color: var(--main-color); text-align: center; @@ -66,31 +63,27 @@ body{ text-decoration:none; text-align: center; box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15); - transition: box-shadow 250ms ease-in-out; - transition: width 250ms ease-out; + transition: all 250ms ease-in-out; } .irobutton:hover{ box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2); - width:55%; + padding: 8px 22%; } .irobutton:active{ box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05); - width:45%; + padding: 8px 18%; } .sirobutton{ cursor: pointer; border: none; display: block; - width:40%; + width: fit-content; margin: 32px; - padding: 8px 10%; + padding: 8px 20%; margin-left: auto; margin-right: auto; - padding-top: 8px; - padding-bottom: 8px; - text-align: center; background-color: var(--sub-color); @@ -102,16 +95,15 @@ body{ font-weight: normal; text-decoration:none; box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15); - transition: box-shadow 250ms ease-in-out; - transition: width 250ms ease-out; + transition: all 250ms ease-in-out; } .sirobutton:hover{ box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2); - width:45%; + padding: 8px 22%; } .sirobutton:active{ - box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05); - width:45%; + box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2); + padding: 8px 18%; } .inbox { @@ -242,41 +234,125 @@ textarea{ } -.rolebox{ - - margin-top: 12px; - margin-bottom: 12px; - - margin-left: auto; - margin-right: auto; - - width: 120px; +.rolebox { + margin: 4px 6px 4px 6px; + width: auto; padding-left: auto; padding-right: auto; - - 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); - } - -.rolebox p{ - - color:var(--main-color); - margin-top: 2px; - margin-bottom: 2px; - margin-left: 10px; - margin-right: 10px; - - text-align: center; + +.rolebox p { + margin: 2px 10px 2px 10px; font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: "Zen Maru Gothic", sans-serif; font-weight: normal; - } +.roleboxes { + margin-left: auto; + margin-right: auto; + display: table; + padding: auto; + flex-wrap: wrap; +} + +.shine { + position: relative; + overflow: hidden; +} +.shine:after { + content: ""; + position: absolute; + top: -50%; + left: -50%; + width: 10%; + height: 150%; + background: #fff; + transform: rotate(45deg); + animation: reflect 3s ease-in-out infinite; +} +@keyframes reflect { + 0%, + 75% { + transform: rotate(45deg) scale(0); + opacity: 1; + } + + 100% { + transform: rotate(45deg) scale(100); + opacity: 0; + } +} +.cyclingmark { + display: flex; +} +.cyclingmark p::before { + content: ""; + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + margin-right: 5px; + background: url("/img/uwuzuicon.png") + no-repeat; + background-size: contain; + animation: cycling 2s infinite; + margin: -6px 0px 0px -2px; +} +@keyframes cycling { + from { + animation-timing-function: ease-in-out; + transform: translate(0px, 0px) scale(1, 1) rotate(0deg) skew(0deg, 0deg); + opacity: 1; + } + + to { + animation-timing-function: ease-in-out; + transform: translate(0px, 0px) scale(1, 1) rotate(360deg) skew(0deg, 0deg); + opacity: 1; + } + + 25% { + animation-timing-function: ease-in-out; + transform: translate(0px, 0px) scale(1, 1) rotate(400deg) skew(0deg, 0deg); + opacity: 1; + } + + 40% { + animation-timing-function: ease-in-out; + transform: translate(0px, 0px) scale(1, 1) rotate(330deg) skew(0deg, 0deg); + opacity: 1; + } + + 60% { + animation-timing-function: ease-in-out; + transform: translate(0px, 0px) scale(1, 1) rotate(360deg) skew(0deg, 0deg); + opacity: 1; + } +} +.rainbow { + animation: rain 5s infinite; +} +@keyframes rain { + 0% { + border: 1px solid magenta; + color: magenta; + } + 33% { + border: 1px solid yellow; + color: yellow; + } + 66% { + border: 1px solid cyan; + color: cyan; + } + 100% { + border: 1px solid magenta; + color: magenta; + } +} .userleftbox{ border-radius: 17px; @@ -576,7 +652,7 @@ main h1{ color:var(--text-color); text-decoration: none; font-family: 'BIZ UDPGothic', sans-serif; - font-weight: bold; + font-weight: normal; } .userheader .profile p img{ vertical-align: middle; @@ -606,23 +682,12 @@ main h1{ .userheader .rolebox{ - - margin-top: 0px; - margin-bottom: 12px; - - margin-left: 0px; - margin-right: 12px; - + margin: 4px 6px 4px 6px; width: auto; padding-left: auto; padding-right: auto; - - 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); - } @@ -1132,6 +1197,7 @@ main h1{ padding-right: 6px; padding-top: 3px; padding-bottom: 3px; + background-color: #F5F5F5; border: solid 1px #CCC; color: #323232; border-radius: 25px; @@ -1319,6 +1385,7 @@ main h1{ width: 100%; height: 350px; border: 1px solid var(--border-color); + cursor: pointer; } .ueuse .photo2{ @@ -1334,6 +1401,7 @@ main h1{ width: 100%; height: 350px; border: 1px solid var(--border-color); + cursor: pointer; } .ueuse .photo3{ @@ -1353,6 +1421,7 @@ main h1{ width: 100%; height: 200px; border: 1px solid var(--border-color); + cursor: pointer; } .ueuse .photo3_btm a img{ object-fit: cover; @@ -1363,6 +1432,7 @@ main h1{ min-width: 100%; height: 200px; border: 1px solid var(--border-color); + cursor: pointer; } .ueuse .photo4{ display: flex; @@ -1377,6 +1447,7 @@ main h1{ width: 100%; height: 200px; border: 1px solid var(--border-color); + cursor: pointer; } .ueuse .video1 video{ object-fit: cover; @@ -2079,6 +2150,16 @@ main h1{ font-size: 12px; color:var(--main-color); } +.ueuse .flebox .user .u_name a img{ + margin-top: 0px; + margin-bottom: 0px; + margin-left: 4px; + margin-right: 4px; + max-height: 22px; + width: auto; + vertical-align: text-top; + border-radius: 0px; +} .tokonone p{ @@ -2277,6 +2358,75 @@ main h1{ color: #FF4848; } +.sendbox .emoji_picker{ + animation: Up_to_down_slideY 0.5s cubic-bezier(0.25, 1, 0.5, 1) 1 forwards; + margin-left: auto; + margin-right: auto; + margin-top: 24px; + margin-bottom: 0px; + border-radius: 10px; + padding-left: 12px; + padding-right: 12px; + padding-top: 16px; + padding-bottom: 16px; + background-color: var(--tl-color); + border: 1px solid var(--border-color); + width: auto; + max-height: 260px; + overflow-x: hidden; + overflow-y: scroll; +} +.sendbox .emoji_picker p{ + margin: 0px; + word-wrap: break-word; + line-height: 20px; + color: var(--subtext-color); + font-size: 12px; + font-family: 'BIZ UDPGothic', sans-serif; + font-weight: normal; +} +.sendbox .emoji_picker .emoji_picker_flex{ + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} +.sendbox .emoji_picker .emoji_picker_flex .one_emoji{ + cursor: pointer; + margin: 6px; + width: 64px; + height: 64px; + background-color: var(--tl-color); + border-radius: 8px; + transition: all 250ms ease-out; +} +.sendbox .emoji_picker .emoji_picker_flex .one_emoji img{ + margin: 8px; + width: 48px; + height: 48px; + object-fit:contain; +} +.sendbox .emoji_picker .emoji_picker_flex .one_emoji:hover{ + background-color: color-mix(in srgb, var(--tl-color) 95%, #000); +} +.sendbox .emoji_picker .tokonone p{ + font-size: 16px; + color:var(--text-color); + text-decoration: none; + font-family: 'BIZ UDPGothic', sans-serif; + font-weight: bold; +} +@keyframes Up_to_down_slideY { + 0% { + transform: translateY(-12px); + opacity: 0; + } + 100% { + transform: translateY(0px); + } + 40%,100% { + opacity: 1; + } +} .ueusebtn{ cursor: pointer; @@ -2880,6 +3030,48 @@ label>input { } } +.Image_modal { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.25); + backdrop-filter: blur(5px); + z-index: 9999; + transition: all 250ms ease-out; +} +.Image_modal .modal-content { + padding: 0px; + border-radius: 15px; + width: fit-content; + height: fit-content; + max-width: 90%; + max-height: 90dvh; + position: absolute; + top: 30dvh; + right: 0; + bottom: 0; + left: 0; + margin: auto; + box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15); + overflow: hidden; + cursor: zoom-out; +} +.Image_modal .modal-content img{ + background: linear-gradient(45deg, #CCC 25%, transparent 25%, transparent 75%, #CCC 75%), + linear-gradient(45deg, #CCC 25%, transparent 25%, transparent 75%, #CCC 75%); + background-color: #FFF; + background-size: 20px 20px; + background-position: 0 0, 10px 10px; + width: 100%; + height: 80dvh; + margin: 0px; + vertical-align:top; + object-fit: contain; +} + .topbox { position: fixed; @@ -3378,8 +3570,8 @@ label>input { } .emojibox{ - margin-left: 12px; - margin-right: 12px; + margin-left: 0px; + margin-right: 0px; padding: 12px; width: auto; } @@ -3429,54 +3621,85 @@ label>input { margin-bottom: 6px; fill: currentColor; } - - -.emojizone{ - margin-left: 0px; - margin-right: 0px; - margin-top: 12px; +.emojibox h1{ + margin-left: 12px; } +.emojizone{ + margin: 0px; + display: flex; + flex-wrap: wrap; + justify-content: space-between; + padding: 12px; + padding-top: 0px; +} +.emojizone .tokonone{ + width: calc(50% - 32px); + height: fit-content; + margin-top: 0px; + margin-left: 0px; + margin-right: 0px; + margin-bottom: 12px; + padding: 12px; +} +.emojizone .tokonone p{ + margin-top: 30px; + margin-bottom: 30px; +} .emjtex{ + width: calc(50% - 32px); background-color: var(--background-color); - margin-top: 12px; - margin-left: auto; - margin-right: auto; + margin-top: 0px; + margin-left: 0px; + margin-right: 0px; + margin-bottom: 12px; padding: 12px; border-radius: 10px; border: 1px solid var(--border-color); + transition: all 250ms ease-out; +} +.emjtex:hover{ + background-color: color-mix(in srgb, var(--background-color) 95%, #000); } .emjtex .fx{ - display: block; + display: flex; max-width: 100%; + flex-wrap: wrap; + justify-content: flex-start; } .emjtex img{ - margin-top: auto; - margin-bottom: auto; + margin-top: 6px; + margin-bottom: 6px; margin-left: 6px; - margin-right: 4px; + margin-right: 6px; max-height: 64px; - max-width: 98%; + max-width: calc(100% - 12px); + object-fit: initial; +} + +.emjtex .btm_zone{ + margin-top: auto; + margin-bottom:auto; } .emjtex h3{ - overflow-wrap: break-word; - margin-top: auto; - margin-bottom: auto; + overflow-wrap: break-word; + margin-top: 6px; + margin-bottom: 6px; margin-left: 6px; font-size: 24px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: 'BIZ UDGothic', sans-serif; font-weight: bold; } .emjtex p{ - overflow-wrap: break-word; - margin-top: 12px; - margin-bottom: auto; + overflow-wrap: break-word; + margin-top: 6px; + margin-bottom: 6px; margin-left: 6px; font-size: 16px; color:var(--text-color); @@ -3498,7 +3721,7 @@ label>input { } .this{ - background-color: var(--sub-color)!important; + background-color: color-mix(in srgb, var(--sub-color) 30%, var(--background-color))!important; } .notification{ animation: slideInY 0.5s cubic-bezier(0.25, 1, 0.5, 1) 1 forwards; @@ -3562,6 +3785,12 @@ label>input { font-family: 'BIZ UDPGothic', sans-serif; font-weight: normal; } +.notification .flebox .username img{ + margin-left: 6px; + margin-right: 6px; + width: 14px; + height: 14px; +} .notification .flebox .idbox{ margin-top: auto; margin-bottom: auto; @@ -4036,7 +4265,7 @@ hr{ font-weight: bold; } .hny .textmain{ - background-color: var(--border-color); + background-color: #F5F5F5; padding-top: 8px; padding-bottom: 8px; padding-left: 24px; @@ -4055,7 +4284,7 @@ hr{ } .hny .textmain p{ text-align: left; - color:var(--text-color); + color:#252525; font-family: 'BIZ UDPGothic', sans-serif; word-wrap: break-word; font-size: 16px; @@ -4064,7 +4293,7 @@ hr{ } .hny .textmain .rp{ text-align: right; - color:var(--text-color); + color:#252525; font-family: 'BIZ UDPGothic', sans-serif; word-wrap: break-word; font-size: 14px; @@ -4279,16 +4508,12 @@ summary { font-weight: normal; text-decoration:none; text-align: center; - transition: box-shadow 250ms ease-in-out; - transition: width 250ms ease-out; transition: all 250ms ease-out; } .delbox .delbtn:hover{ background-color: #FF4848; color: var(--background-color);; - transition: box-shadow 250ms ease-in-out; - transition: width 250ms ease-out; transition: all 250ms ease-out; } .mini_irobtn{ @@ -4311,15 +4536,11 @@ summary { font-weight: normal; text-decoration:none; text-align: center; - transition: box-shadow 250ms ease-in-out; - transition: width 250ms ease-out; transition: all 250ms ease-out; } .mini_irobtn:hover{ background-color: var(--main-color); color: var(--background-color);; - transition: box-shadow 250ms ease-in-out; - transition: width 250ms ease-out; transition: all 250ms ease-out; } @@ -4683,6 +4904,13 @@ summary { .serverhead{ text-align: center; } +.formarea .serverhead img { + object-fit: cover; + width: 100%; + height: 220px; + border-radius: 10px; + margin: 0px; +} .serverhead img { object-fit: cover; width: 60%; @@ -4833,6 +5061,116 @@ summary { text-align: center; } +.graph{ + margin-top: 12px; + margin-bottom: 12px; + margin-left: 0px; + margin-right: 0px; + width: 100%; + height: 32px; + background-color: var(--background-color); + border-radius: 50px; + border: solid 1px var(--border-color); +} +.graph .per{ + margin-top: 4px; + margin-bottom: 4px; + margin-right: 4px; + margin-left: 4px; + height: 24px; + background-color: var(--main-color); + border-radius: 50px; + border: none; +} + +noscript{ + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.25); + backdrop-filter: blur(5px); + z-index: 9999; + transition: all 250ms ease-out; + cursor: not-allowed; +} +noscript .noscript_modal{ + padding: 0px; + border-radius: 15px; + width: fit-content; + height: fit-content; + background-color: var(--background-color); + max-width: 50%; + max-height: 75dvh; + position: absolute; + top: 45%; + right: 0; + bottom: 45%; + left: 0; + margin: auto; + box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15); + overflow: scroll; + cursor: auto; +} +noscript .noscript_modal .inner{ + margin: 64px; +} +noscript .noscript_modal .inner .oops_icon{ + margin-top: -32px; + font-family: 'BIZ UDPGothic', sans-serif; + font-size: 74px; + text-align: center; +} +noscript .noscript_modal .inner h1{ + line-height: 32px; + font-family: 'BIZ UDPGothic', sans-serif; + font-size: 32px; + color:var(--text-color); + text-align: center; + font-weight: bold; +} +noscript .noscript_modal .inner p{ + line-height: 20px; + font-family: 'BIZ UDPGothic', sans-serif; + font-size: 16px; + color:var(--text-color); + text-align: center; +} +noscript .noscript_modal .inner .p2{ + margin-top: 12px; + text-align: center; +} +noscript .noscript_modal .inner .infobtn{ + display: block; + width: 128px; + padding: 6px; + text-align: center; + margin-left: auto; + margin-right: auto; + display: block; + background-color:#FFC832; + color:#ffffff; + border-radius: 32px; + font-size: 20px; + font-family: 'BIZ UDGothic', 'Yu Mincho Regular', 'ヒラギノ角ゴシック', sans-serif; + font-weight: normal; + text-decoration: none; +} +noscript .noscript_modal .inner .center_text{ + margin-top: 12px; + display: block; +} +noscript .noscript_modal .inner .center_text p{ + line-height: 16px; + margin: 0px; + text-align: center; + color:#777; + font-size: 14px; + font-family: 'BIZ UDGothic', 'Yu Mincho Regular', 'ヒラギノ角ゴシック', sans-serif; + font-weight: normal; +} + /*------------------------------------------------------------------------------------------------------------*/ /*--------------------------------------------------スマホ向け--------------------------------------------------*/ /*--------------------------------------------------ここから--------------------------------------------------*/ @@ -4874,8 +5212,8 @@ summary { } .userheader .roleboxes{ - margin-left: 12px; - margin-right: 12px; + margin-left: 6px; + margin-right: 6px; display: flex; padding: 0px; flex-wrap : wrap; @@ -5036,6 +5374,19 @@ summary { font-family: 'BIZ UDPGothic', sans-serif; font-weight: bold; } + .sendbox .emoji_picker .emoji_picker_flex{ + justify-content: flex-start; + } + .sendbox .emoji_picker .emoji_picker_flex .one_emoji{ + margin: 6px; + width: 40px; + height: 40px; + } + .sendbox .emoji_picker .emoji_picker_flex .one_emoji img{ + margin: 3px; + width: 34px; + height: 34px; + } .ueusebtn{ width:30%; @@ -5920,6 +6271,40 @@ summary { transform: translateY(-1%); } } + .Image_modal{ + -moz-box-sizing: border-box; + box-sizing: border-box; + } + .Image_modal .modal-content { + padding: 0px; + border-radius: 15px; + width: fit-content; + height: fit-content; + max-width: 90%; + max-height: 90dvh; + position: absolute; + top: 45%; + right: 0; + bottom: 45%; + left: 0; + margin: auto; + margin-top: 0px; + margin-bottom: 0px; + box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15); + overflow: hidden; + } + .Image_modal .modal-content img{ + background: linear-gradient(45deg, #CCC 25%, transparent 25%, transparent 75%, #CCC 75%), + linear-gradient(45deg, #CCC 25%, transparent 25%, transparent 75%, #CCC 75%); + background-color: #FFF; + background-size: 20px 20px; + background-position: 0 0, 10px 10px; + width: 100%; + height: auto; + margin: 0px; + vertical-align:top; + object-fit: contain; + } .tlchange{ border-radius: 10px; @@ -6152,6 +6537,52 @@ summary { border-radius: 10px; margin: 0px; } + + noscript .noscript_modal{ + border-radius: 15px; + max-width: 90%; + max-height: 90dvh; + overflow: scroll; + } + noscript .noscript_modal .inner{ + margin: 24px; + } + noscript .noscript_modal .inner .oops_icon{ + margin-top: 12px; + font-size: 48px; + } + noscript .noscript_modal .inner h1{ + line-height: 24px; + font-size: 24px; + } + noscript .noscript_modal .inner p{ + line-height: 16px; + font-size: 14px; + text-align: left; + } + noscript .noscript_modal .inner .center_text{ + margin-top: 12px; + display: block; + } + noscript .noscript_modal .inner .center_text p{ + line-height: 14px; + font-size: 12px; + } + + + .emojizone{ + display: block; + } + .emjtex{ + width: auto; + } + .emjtex .fx{ + display: block; + } + .emojizone .tokonone{ + width: auto; + height: fit-content; + } } /*------------------------------------------------------------------------------------------------------------*/ @@ -6161,6 +6592,11 @@ summary { @media (prefers-color-scheme: dark) { + ::selection { + color: var(--dark-background-color); + background: var(--main-color); + } + body{ background-color: var(--dark-background-color); } @@ -6245,6 +6681,11 @@ summary { background-color: var(--dark-ueuse-color); color: var(--dark-text-color); } + .ueuse .unixtime{ + background-color: #323232; + border: solid 1px #CCC; + color: #F5F5F5; + } .ueuse h1{ @@ -6574,12 +7015,32 @@ summary { .sendbox .fxbox p{ color:var(--sub-color); } + + .sendbox .emoji_picker{ + background-color: var(--dark-background-color); + border: none; + } + .sendbox .emoji_picker p{ + color: var(--dark-subtext-color); + } + .sendbox .emoji_picker .emoji_picker_flex .one_emoji{ + background-color: var(--dark-background-color); + } + .sendbox .emoji_picker .emoji_picker_flex .one_emoji:hover{ + background-color: color-mix(in srgb, var(--dark-background-color) 95%, #FFF); + } + .sendbox .emoji_picker .tokonone p{ + color:var(--dark-text-color); + } .emjtex{ background-color: var(--dark-sub-color); border: none; } + .emjtex:hover{ + background-color: color-mix(in srgb, var(--dark-sub-color) 95%, #FFF); + } .emjtex h3{ color:var(--background-color); @@ -6760,7 +7221,7 @@ summary { } .this{ - background-color: var(--link-color) !important; + background-color: color-mix(in srgb, var(--link-color) 30%, var(--dark-background-color))!important; border: none !important; } @@ -7007,4 +7468,29 @@ summary { background-color: #3a3333; color: #ff4848; } + .graph{ + background-color: var(--dark-background-color); + border: solid 1px var(--dark-background-color); + } + .graph .per{ + background-color: var(--main-color); + } + noscript .noscript_modal{ + background-color: var(--dark-background-color); + } + noscript .noscript_modal .inner h1{ + color:var(--dark-text-color); + } + noscript .noscript_modal .inner p{ + color:var(--dark-text-color); + } + noscript .noscript_modal .inner .center_text p{ + line-height: 16px; + margin: 0px; + text-align: center; + color:#CCC; + font-size: 14px; + font-family: 'BIZ UDGothic', 'Yu Mincho Regular', 'ヒラギノ角ゴシック', sans-serif; + font-weight: normal; + } } \ No newline at end of file diff --git a/css/style.css b/css/style.css index 45a2986..26a0c1d 100644 --- a/css/style.css +++ b/css/style.css @@ -414,8 +414,6 @@ label > input { .formarea label{ overflow-wrap: break-word; - margin-top: 24px; - margin-bottom: 24px; font-size: 16px; color:var(--text-color); text-decoration: none; @@ -485,7 +483,7 @@ label > input { transition: border 350ms ease-in-out; transition: border-bottom 150ms ease-out; border: 1px solid var(--border-color); - } +} .inbox::placeholder { color: #999; @@ -592,40 +590,127 @@ label > input { box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05); width:45%; } -.rolebox{ - - margin-top: 12px; - margin-bottom: 12px; - +.roleboxes { margin-left: auto; margin-right: auto; + max-width: 70%; + display: flex; + padding: auto; + flex-wrap: wrap; + justify-content: center; +} - width: 120px; +.rolebox { + margin: 4px 6px 4px 6px; + width: auto; padding-left: auto; padding-right: auto; - - 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); - } - -.rolebox p{ - - color:var(--main-color); - margin-top: 2px; - margin-bottom: 2px; - margin-left: 10px; - margin-right: 10px; - + +.rolebox p { + margin: 2px 10px 2px 10px; font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: "Zen Maru Gothic", sans-serif; font-weight: normal; - } +.shine { + position: relative; + overflow: hidden; +} +.shine:after { + content: ""; + position: absolute; + top: -50%; + left: -50%; + width: 10%; + height: 150%; + background: #fff; + transform: rotate(45deg); + animation: reflect 3s ease-in-out infinite; +} +@keyframes reflect { + 0%, + 75% { + transform: rotate(45deg) scale(0); + opacity: 1; + } + + 100% { + transform: rotate(45deg) scale(100); + opacity: 0; + } +} +.cyclingmark { + display: flex; +} +.cyclingmark p::before { + content: ""; + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + margin-right: 5px; + background: url("/img/uwuzuicon.png") + no-repeat; + background-size: contain; + animation: cycling 2s infinite; + margin: -6px 0px 0px -2px; +} +@keyframes cycling { + from { + animation-timing-function: ease-in-out; + transform: translate(0px, 0px) scale(1, 1) rotate(0deg) skew(0deg, 0deg); + opacity: 1; + } + + to { + animation-timing-function: ease-in-out; + transform: translate(0px, 0px) scale(1, 1) rotate(360deg) skew(0deg, 0deg); + opacity: 1; + } + + 25% { + animation-timing-function: ease-in-out; + transform: translate(0px, 0px) scale(1, 1) rotate(400deg) skew(0deg, 0deg); + opacity: 1; + } + + 40% { + animation-timing-function: ease-in-out; + transform: translate(0px, 0px) scale(1, 1) rotate(330deg) skew(0deg, 0deg); + opacity: 1; + } + + 60% { + animation-timing-function: ease-in-out; + transform: translate(0px, 0px) scale(1, 1) rotate(360deg) skew(0deg, 0deg); + opacity: 1; + } +} +.rainbow { + animation: rain 5s infinite; +} +@keyframes rain { + 0% { + border: 1px solid magenta; + color: magenta; + } + 33% { + border: 1px solid yellow; + color: yellow; + } + 66% { + border: 1px solid cyan; + color: cyan; + } + 100% { + border: 1px solid magenta; + color: magenta; + } +} .userleftbox{ margin-top: 0px; @@ -810,6 +895,92 @@ p img{ text-align: left; } + +.switch_input { + position: absolute; + left: 0; + top: 0; + width: 64%; + height: 64%; + z-index: 5; + opacity: 0; + cursor: pointer; +} +.switch_label { + margin-top: 0px; + margin-bottom: 0px; + width: 48px; + height: 24px; + background: var(--dark-subtext-color); + position: relative; + display: inline-block; + border-radius: 25px; + transition: 0.4s; + box-sizing: border-box; +} +.switch_label:after { + content: ""; + position: absolute; + margin-top: 2px; + margin-left: 2px; + width: 20px; + height: 20px; + border-radius: 50%; + left: 0; + top: 0; + z-index: 2; + background: var(--background-color); + box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); + transition: 0.2s; +} +.switch_input:checked + .switch_label { + background-color: var(--main-color); +} +.switch_input:checked + .switch_label:after { + left: 24px; +} +.switch_button { + position: relative; + width: 48px; + height: 24px; + margin-left: 0px; +} +.switch_flexbox{ + display: flex; + margin-top: 12px; + margin-bottom: 12px; + height: fit-content; +} +.switch_flexbox p{ + margin: 0px; + margin-top: 6px; + margin-left: 6px; + margin-right: 6px; + text-align: left; + word-wrap: break-word; + line-height: 14px; + color: var(--subtext-color); + font-size: 14px; + font-family: 'BIZ UDPGothic', sans-serif; + font-weight: normal; +} +.module_chk{ + padding-top: 16px; + padding-bottom: 16px; + padding-left: 16px; + padding-right: 16px; + border-radius: 15px; + background-color: var(--background-color); + border: 1px solid var(--border-color); + margin-top: 12px; + text-align: left; + margin-left: auto; + margin-right: auto; +} +.module_chk p{ + margin: 0px; + line-height: 24px; +} /*------------------------------------------------------------------------------------------------------------*/ /*--------------------------------------------------スマホ向け--------------------------------------------------*/ /*--------------------------------------------------ここから--------------------------------------------------*/ @@ -1073,6 +1244,7 @@ p img{ .btnbox{ background-color: var(--dark-sub-color); + border: none; } .irobutton{ background-color: var(--main-color); @@ -1085,6 +1257,7 @@ p img{ .formarea{ background-color: var(--dark-sub-color); + border: none; } .formarea label{ color:var(--dark-text-color); @@ -1132,4 +1305,7 @@ p img{ background-color: var(--main-color); color: var(--dark-sub-color); } + .errmsg p{ + color:#ff4848; + } } \ No newline at end of file diff --git a/emoji/index.php b/emoji/index.php index c251e2a..6ea2f52 100644 --- a/emoji/index.php +++ b/emoji/index.php @@ -190,6 +190,11 @@ if (!empty($pdo)) { require('../logout/logout.php'); +if(isset($_GET['q'])){ + $keyword = htmlentities($_GET['q']); +}else{ + $keyword = ""; +} // データベースの接続を閉じる $pdo = null; @@ -199,7 +204,7 @@ $pdo = null; - + @@ -212,7 +217,7 @@ $pdo = null; -
+
    @@ -220,35 +225,125 @@ $pdo = null;
+
+ +
-
-
-

絵文字一覧

-
- '; - echo '
'; - echo ''; - echo '

:'.$value["emojiname"].':

'; - echo '
'; - echo '

'.$value["emojiinfo"].'

'; - echo '
'; - } - }else{ - echo '

カスタム絵文字がありません

'; - } - ?> -
-
+
+
+

絵文字一覧

+
+
+ + +
+
+ +
+ + + + + \ No newline at end of file diff --git a/errorpage/400.php b/errorpage/400.php index 07caf74..31f2207 100644 --- a/errorpage/400.php +++ b/errorpage/400.php @@ -17,7 +17,7 @@ $domain = $_SERVER['HTTP_HOST']; - + diff --git a/errorpage/401.php b/errorpage/401.php index 20f879b..4b40bed 100644 --- a/errorpage/401.php +++ b/errorpage/401.php @@ -17,7 +17,7 @@ $domain = $_SERVER['HTTP_HOST']; - + diff --git a/errorpage/403.php b/errorpage/403.php index d306159..0c7aa5e 100644 --- a/errorpage/403.php +++ b/errorpage/403.php @@ -17,7 +17,7 @@ $domain = $_SERVER['HTTP_HOST']; - + diff --git a/errorpage/404.php b/errorpage/404.php index def5fb9..15c7310 100644 --- a/errorpage/404.php +++ b/errorpage/404.php @@ -19,7 +19,7 @@ $domain = $_SERVER['HTTP_HOST']; - + diff --git a/errorpage/500.php b/errorpage/500.php index 25e7cf9..312d8c8 100644 --- a/errorpage/500.php +++ b/errorpage/500.php @@ -16,7 +16,7 @@ $domain = $_SERVER['HTTP_HOST']; - + diff --git a/errorpage/503.php b/errorpage/503.php index 295fde3..9fa0278 100644 --- a/errorpage/503.php +++ b/errorpage/503.php @@ -22,7 +22,7 @@ $domain = $_SERVER['HTTP_HOST']; - + diff --git a/errorpage/serverstop.php b/errorpage/serverstop.php index 6ed2061..7651dc8 100644 --- a/errorpage/serverstop.php +++ b/errorpage/serverstop.php @@ -19,7 +19,7 @@ if(!empty(file_get_contents($serverstopfile))){ - + diff --git a/function/function.php b/function/function.php index 9c2f160..01aaa6b 100644 --- a/function/function.php +++ b/function/function.php @@ -94,4 +94,209 @@ function check_mime_video($tmp_name){ return false; } } +//文字装飾・URL変換など +function processMarkdownAndWrapEmptyLines($markdownText){ + + //\___________________[注意]__________________\ + // \____ここの順番を変えるとうまく動かなくなります___\ + // \______Markdownうまく動くところを探すべし______\ + + $markdownText = preg_replace('/\[\[buruburu (.+)\]\]/m', '$1', $markdownText);//ぶるぶる + + $markdownText = preg_replace('/(^|[^`])`([^`\n]+)`($|[^`])/m', '$1$2$3', $markdownText);//Inline Code + + $markdownText = preg_replace_callback('/^\[\[time (\d+)\]\]/m', function($matches) { + $timestamp = $matches[1]; + return '' . date("Y/m/d H:i", htmlentities($timestamp, ENT_QUOTES, 'UTF-8', false)) . ''; + }, $markdownText); + + $markdownText = preg_replace('/\*\*\*(.*?)\*\*\*/', '$1', $markdownText);//太字&斜体の全部のせセット + $markdownText = preg_replace('/\_\_\_(.*?)\_\_\_/', '$1', $markdownText);//太字&斜体の全部のせセット + + $markdownText = preg_replace('/\*\*(.*?)\*\*/', '$1', $markdownText);//太字 + $markdownText = preg_replace('/\_\_(.*?)\_\_/', '$1', $markdownText);//太字 + + $markdownText = preg_replace('/\*(.*?)\*/', '$1', $markdownText);//斜体 + $markdownText = preg_replace('/\_(.*?)\_/', '$1', $markdownText);//斜体 + + $markdownText = preg_replace('/\~\~(.*?)\~\~/m', '$1', $markdownText);//打ち消し線 + + $markdownText = preg_replace('/>>> (.*)/m', '$1', $markdownText);//>>> 引用 + + $markdownText = preg_replace('/\|\|(.*)\|\|/m', '$1', $markdownText);//黒塗り + + // タイトル(#、##、###)をHTMLのhタグに変換 + $markdownText = preg_replace('/^# (.+)/m', '

$1

', $markdownText); + $markdownText = preg_replace('/^## (.+)/m', '

$1

', $markdownText); + $markdownText = preg_replace('/^### (.+)/m', '

$1

', $markdownText); + + // 箇条書き(-)をHTMLのul/liタグに変換 + $markdownText = preg_replace('/^- (.+)/m', '

・ $1

', $markdownText); + + // 空行の前に何もない行をHTMLのpタグに変換 + $markdownText = preg_replace('/(^\s*)(?!\s)(.*)/m', '$1

$2

', $markdownText); + + return $markdownText; +} +//Profile +function replaceProfileEmojiImages($postText) { + $postText = str_replace(''', '\'', $postText); + // プロフィール名で絵文字名(:emoji:)を検出して画像に置き換える + $emojiPattern = '/:(\w+):/'; + $postTextWithImages = preg_replace_callback($emojiPattern, function($matches) { + $emojiName = $matches[1]; + //絵文字path取得 + $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, + )); + $emoji_Query = $dbh->prepare("SELECT emojifile, emojiname FROM emoji WHERE emojiname = :emojiname"); + $emoji_Query->bindValue(':emojiname', $emojiName); + $emoji_Query->execute(); + $emoji_row = $emoji_Query->fetch(); + if(empty($emoji_row["emojifile"])){ + $emoji_path = "img/sysimage/errorimage/emoji_404.png"; + }else{ + $emoji_path = $emoji_row["emojifile"]; + } + return ":$emojiName:"; + }, $postText); + return $postTextWithImages; +} +// ユーズ内の絵文字やhashtagを画像に置き換える +function replaceEmojisWithImages($postText) { + $postText = str_replace(''', '\'', $postText); + // ユーズ内で絵文字名(:emoji:)を検出して画像に置き換える + $emojiPattern = '/:(\w+):/'; + $postTextWithImages = preg_replace_callback($emojiPattern, function($matches) { + $emojiName = $matches[1]; + //絵文字path取得 + $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, + )); + $emoji_Query = $dbh->prepare("SELECT emojifile, emojiname FROM emoji WHERE emojiname = :emojiname"); + $emoji_Query->bindValue(':emojiname', $emojiName); + $emoji_Query->execute(); + $emoji_row = $emoji_Query->fetch(); + if(empty($emoji_row["emojifile"])){ + $emoji_path = "img/sysimage/errorimage/emoji_404.png"; + }else{ + $emoji_path = $emoji_row["emojifile"]; + } + return ":$emojiName:"; + }, $postText); + + // @username を検出してリンクに置き換える + $usernamePattern = '/@(\w+)/'; + $postTextWithImagesAndUsernames = preg_replace_callback($usernamePattern, function($matches) { + $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, + )); + + $mentionsuserQuery = $dbh->prepare("SELECT username, userid FROM account WHERE userid = :userid"); + $mentionsuserQuery->bindValue(':userid', $username); + $mentionsuserQuery->execute(); + $mentionsuserData = $mentionsuserQuery->fetch(); + + if(empty($mentionsuserData)){ + return "@$username"; + }else{ + return "@".replaceProfileEmojiImages(htmlentities($mentionsuserData["username"], ENT_QUOTES, 'UTF-8', false)).""; + } + }, $postTextWithImages); + + $hashtagsPattern = '/#([\p{Han}\p{Hiragana}\p{Katakana}A-Za-z0-9ー_]+)/u'; + $postTextWithHashtags = preg_replace_callback($hashtagsPattern, function($matches) { + $hashtags = $matches[1]; + return "" . '#' . $hashtags . ""; + }, $postTextWithImagesAndUsernames); + + return $postTextWithHashtags; +} + +function replaceURLsWithLinks($postText, $maxLength = 48) { + $pattern = '/(https:\/\/[\w!?\/+\-_~;.,*&@#$%()+|https:\/\/[ぁ-んァ-ヶ一-龠々\w\-\/?=&%.]+)/'; + $convertedText = preg_replace_callback($pattern, function($matches) use ($maxLength) { + $link = $matches[0]; + $no_https_link = str_replace("https://", "", $link); + if (mb_strlen($link) > $maxLength) { + $truncatedLink = mb_substr($no_https_link, 0, $maxLength).'...'; + return ''.$truncatedLink.''; + } else { + return ''.$no_https_link.''; + } + }, $postText); + + return $convertedText; +} +function YouTube_and_nicovideo_Links($postText) { + // URLを正規表現を使って検出 + $pattern = '/(https:\/\/[^\s<>\[\]\'"]+)/'; // 改良された正規表現 + preg_match_all($pattern, $postText, $matches); + + if(empty($url)){ + $postText = ""; + } + + // 検出したURLごとに処理を行う + foreach ($matches[0] as $url) { + // ドメイン部分を抽出 + $parsedUrl = parse_url($url); + if($parsedUrl['host'] == "youtube.com" || $parsedUrl['host'] == "youtu.be" || $parsedUrl['host'] == "www.youtube.com" || $parsedUrl['host'] == "m.youtube.com"){ + + if (isset($parsedUrl['query'])) { + if(false !== strpos($parsedUrl['query'], 'v=')) { + $video_id = str_replace('v=', '', htmlentities($parsedUrl['query'], ENT_QUOTES, 'UTF-8', false)); + $iframe = true; + }else{ + $video_id = str_replace('/', '', htmlentities($parsedUrl['path'], ENT_QUOTES, 'UTF-8', false)); + $iframe = true; + } + $video_id = str_replace('&', '?', $video_id); + }elseif(isset($parsedUrl['path'])){ + $video_id = str_replace('/', '', htmlentities($parsedUrl['path'], ENT_QUOTES, 'UTF-8', false)); + $iframe = true; + }else{ + $video_id = ""; + $iframe = false; + } + // 不要な文字を削除してaタグを生成 + if($iframe == true){ + $link = ''; + }else{ + $link = ""; + } + // URLをドメインのみを表示するaタグで置き換え + $postText = $link; + }elseif($parsedUrl['host'] == "nicovideo.jp" || $parsedUrl['host'] == "www.nicovideo.jp"){ + + if(isset($parsedUrl['path'])){ + $video_id = str_replace('/watch/', '', htmlentities($parsedUrl['path'], ENT_QUOTES, 'UTF-8', false)); + $iframe = true; + }else{ + $video_id = ""; + $iframe = false; + } + // 不要な文字を削除してaタグを生成 + if($iframe == true){ + $link = ''; - }else{ - $link = ""; - } - // URLをドメインのみを表示するaタグで置き換え - $postText = $link; - }elseif($parsedUrl['host'] == "nicovideo.jp" || $parsedUrl['host'] == "www.nicovideo.jp"){ - - if(isset($parsedUrl['path'])){ - $video_id = str_replace('/watch/', '', htmlspecialchars($parsedUrl['path'], ENT_QUOTES, 'UTF-8', false)); - $iframe = true; - }else{ - $video_id = ""; - $iframe = false; - } - // 不要な文字を削除してaタグを生成 - if($iframe == true){ - $link = '