diff --git a/.htaccess b/.htaccess index 20a0f69..2fbd7a1 100644 --- a/.htaccess +++ b/.htaccess @@ -3,6 +3,12 @@ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php [L] +RewriteRule ^\.htaccess$ - [F] +RewriteRule ^db\.php$ - [F] +RewriteRule ^settings_admin/CloudflareTurnstile_settings/ - [F] +RewriteRule ^settings_admin/hCaptcha_settings/ - [F] +RewriteRule ^settings_admin/plugin_settings/ - [F] + RewriteBase / RewriteRule ^(@\w+)$ /user/index.php?uwuzuid=$1 [QSA,L] @@ -18,4 +24,4 @@ ErrorDocument 404 /errorpage/404.php ErrorDocument 500 /errorpage/500.php ErrorDocument 503 /errorpage/503.php -Header set X-FRAME-OPTIONS “DENY” \ No newline at end of file +Header set X-FRAME-OPTIONS "DENY" \ No newline at end of file diff --git a/addauthcode.php b/addauthcode.php index a339a18..64e21ae 100644 --- a/addauthcode.php +++ b/addauthcode.php @@ -201,11 +201,11 @@ $pdo = null;
diff --git a/admin/addadmin.php b/admin/addadmin.php index 2edcaa7..4382609 100644 --- a/admin/addadmin.php +++ b/admin/addadmin.php @@ -17,6 +17,10 @@ require('../function/function.php'); $serversettings_file = "../server/serversettings.ini"; $serversettings = parse_ini_file($serversettings_file, true); +$badpassfile = "../server/badpass.txt"; +$badpass_info = file_get_contents($badpassfile); +$badpass = preg_split("/\r\n|\n|\r/", $badpass_info); + session_name('uwuzu_s_id'); session_set_cookie_params(0, '', '', true, true); session_start(); @@ -74,9 +78,6 @@ if($result2 > 0){ if( !empty($_POST['btn_submit']) ) { - - //$row['userid'] = "daichimarukn"; - // 空白除去 $username = $_POST['username']; $userid = $_POST['userid']; @@ -260,74 +261,7 @@ if( !empty($_POST['btn_submit']) ) { $error_message[] = 'パスワードを入力してください。(PASSWORD_INPUT_PLEASE)'; } else { - $weakPasswords = array( - "password", - "123456", - "123456789", - "12345", - "12345678", - "123123", - "1234567890", - "1234567", - "1q2w3e", - "qwerty123", - "aa12345678", - "password1", - "1234", - "qwertyuiop", - "123321", - "12321", - "qwertyui", - "abcd1234", - "zaq12wsx", - "1q2w3e4r", - "qwer1234", - "sakura", - "asdf1234", - "asdfghjkl", - "asdfghjk", - "member", - "1qaz2wsx", - "doraemon", - "makoto", - "takeshi", - "machi1", - "machida", - "machida1", - "tokyo", - "arashi", - "dropbox", - "twitter", - "elonmusk", - "xcorp", - "1234qwer", - "japan", - "nippon", - "tukareta", - "tweet", - "discord", - "misskey", - "qwerty", - "123456789", - "abc123", - "password123", - "admin", - "letmein", - "iloveyou", - "111111", - "12345678910", - "user", - "root", - "system", - // 他にも弱いパスワードを追加できます - ); - - function isWeakPassword($passwords) { - global $weakPasswords; - return in_array($passwords, $weakPasswords); - } - - if (isWeakPassword($password)) { + if(in_array($password, $badpass) === true ){ $error_message[] = "パスワードが弱いです。セキュリティ上変更してください。(PASSWORD_ZEIJAKU)"; } @@ -455,7 +389,7 @@ $pdo = null;

アカウント登録

-

アカウント登録です。

+

管理者アカウント登録です。

必須項目には「*」があります。 @@ -470,11 +404,12 @@ $pdo = null;

- +
+
@@ -545,22 +480,14 @@ function checkForm(inputElement) { window.addEventListener('DOMContentLoaded', function(){ - -// ファイルが選択されたら実行 -document.getElementById("file_upload").addEventListener('change', function(e){ - - var file_reader = new FileReader(); - - // ファイルの読み込みを行ったら実行 - file_reader.addEventListener('load', function(e) { - console.log(e.target.result); - const element = document.querySelector('#wrap'); - const createElement = '

画像を選択しました。

'; - element.insertAdjacentHTML('afterend', createElement); - }); - - file_reader.readAsText(e.target.files[0]); -}); + $('#file_upload').change(function(e) { + var file_reader = new FileReader(); + file_reader.addEventListener('load', function(e) { + $('#img_select').show(); + $('#iconimg').attr('src', file_reader.result); + }); + file_reader.readAsDataURL(e.target.files[0]); + }); }); diff --git a/admin/index.php b/admin/index.php index b9a5d3c..1df93b6 100644 --- a/admin/index.php +++ b/admin/index.php @@ -36,43 +36,49 @@ $stmt = null; $res = null; $option = null; -try { +if(!(empty(DB_NAME) && empty(DB_HOST) && empty(DB_USER) && empty(DB_PASS))){ + try { - $option = array( + $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(); + } + + $aduser = "yes"; + + $options = array( + // SQL実行失敗時に例外をスルー PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::MYSQL_ATTR_MULTI_STATEMENTS => false + // デフォルトフェッチモードを連想配列形式に設定 + PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, + // バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減) + // SELECTで得た結果に対してもrowCountメソッドを使えるようにする + PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, ); - $pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option); - -} catch(PDOException $e) { - - // 接続エラーのときエラー内容を取得する - $error_message[] = $e->getMessage(); -} - -$aduser = "yes"; - -$options = array( - // SQL実行失敗時に例外をスルー - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - // デフォルトフェッチモードを連想配列形式に設定 - PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, - // バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減) - // SELECTで得た結果に対してもrowCountメソッドを使えるようにする - PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, -); - -$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option); - -$query = $dbh->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1'); - -$query->execute(array(':adminuser' => $aduser)); - -$result2 = $query->fetch(); - -if($result2 > 0){ - header("Location: ../login.php"); - exit; + + $dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option); + + $query = $dbh->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1'); + + $query->execute(array(':adminuser' => $aduser)); + + $result2 = $query->fetch(); + + if($result2 > 0){ + header("Location: ../login.php"); + exit; + } + + $db_php = true; +}else{ + $db_php = false; } if (in_array("gd", get_loaded_extensions())) { @@ -118,7 +124,7 @@ $pdo = null; -
+
@@ -136,19 +142,37 @@ $pdo = null;

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

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

-

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

+

これよりuwuzuのセットアップを開始します!
+ セットアップを始める前に、PHPの必須モジュールがインストールされているか、以下の欄をみてご確認ください。
+ Not setが一つでもある場合は再度モジュールの設定を行ってください!
+
+ + db.phpの設定は済んでいるようですね、それでは早速セットアップを開始しましょう! + + また、uwuzuのセットアップを始める前に、以下の情報をあなたが知っている必要があります!
+ - データベース名(空のデータベースを用意してください。)
+ - データベースを管理できるユーザー名
+ - データベースへアクセスできるユーザーのパスワード
+ - データベースのホストアドレス
+ これらの情報はuwuzuがデータベースを使用するために必要で、uwuzu導入フォルダ内のdb.phpに保存されます。
+ もしこのあとうまくセットアップが継続できなければ手動でdb.phpに上の情報を保存してください!
+ これらのデータをあなたが知っているのであれば早速セットアップを開始しましょう!
+ +
+ セットアップ中にエラーに遭遇した場合はuwuzu.comを確認し、解消に向けて取り組みましょう!

-

GD :

-

Fileinfo :

-

mbstring :

-

pdo_mysql :

+
Already setが設定済みでNot setが未設定です。
+

GD :

+

Fileinfo :

+

mbstring :

+

pdo_mysql :

uwuzu
Version :

- @@ -165,26 +189,6 @@ function checkForm(inputElement) { } inputElement.value = str; } - - -window.addEventListener('DOMContentLoaded', function(){ - -// ファイルが選択されたら実行 -document.getElementById("file_upload").addEventListener('change', function(e){ - - var file_reader = new FileReader(); - - // ファイルの読み込みを行ったら実行 - file_reader.addEventListener('load', function(e) { - console.log(e.target.result); - const element = document.querySelector('#wrap'); - const createElement = '

画像を選択しました。

'; - element.insertAdjacentHTML('afterend', createElement); - }); - - file_reader.readAsText(e.target.files[0]); -}); -}); diff --git a/admin/setup_db_php.php b/admin/setup_db_php.php new file mode 100644 index 0000000..8c956eb --- /dev/null +++ b/admin/setup_db_php.php @@ -0,0 +1,235 @@ + 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(); + } + + $aduser = "yes"; + + $options = array( + // SQL実行失敗時に例外をスルー + PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, + // デフォルトフェッチモードを連想配列形式に設定 + PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, + // バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減) + // SELECTで得た結果に対してもrowCountメソッドを使えるようにする + PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, + ); + + $dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option); + + $query = $dbh->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1'); + + $query->execute(array(':adminuser' => $aduser)); + + $result2 = $query->fetch(); + + if($result2 > 0){ + header("Location: ../login.php"); + exit; + }else{ + header("Location: setup_uwuzu_db.php"); + exit; + } + + $db_php = true; +}else{ + $db_php = false; +} + +if(!(empty($_POST['btn_submit']))){ + $DataBase_Name = htmlentities($_POST['db_name'], ENT_QUOTES, 'UTF-8', false); + $DataBase_User = htmlentities($_POST['db_user'], ENT_QUOTES, 'UTF-8', false); + $DataBase_Pass = htmlentities($_POST['db_pass'], ENT_QUOTES, 'UTF-8', false); + $DataBase_Host = htmlentities($_POST['db_host'], ENT_QUOTES, 'UTF-8', false); + + try { + + $option = array( + PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, + PDO::MYSQL_ATTR_MULTI_STATEMENTS => false + ); + $pdo = new PDO('mysql:charset=utf8mb4;dbname='.$DataBase_Name.';host='.$DataBase_Host , $DataBase_User, $DataBase_Pass, $option); + + } catch(PDOException $e) { + $error_message[] = "データベースに接続できませんでした。\n設定は間違っていませんか?"; + } + + if(empty($error_message)){ + $DB_Settings = " + + "; + + //設定上書き + $file = fopen('../db.php', 'w'); + $data = $DB_Settings; + fputs($file, $data); + fclose($file); + + header("Location: setup_uwuzu_db.php"); + exit; + } +} + + +// データベースの接続を閉じる +$pdo = null; + +?> + + + + + + + + + + + +db.phpのセットアップ - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?> + + + + + + + +
+ + +
+

db.phpのセットアップ

+ +
    + +

    + +
+ + + +

db.phpのセットアップを行います。
+ db.phpはuwuzuがデータベースへ接続するための設定ファイルです。
+ これが設定されていないとuwuzuはデータベースに接続できません。

+ +
+
+

データベース名

+
空のデータベースを用意してください
+ +
+
+

ユーザー名

+
データベースを操作できるユーザー名を入力してください。
+ +
+
+

パスワード

+
上のユーザーのパスワードを入力してください。
+ +
+
+
+ + +
+

パスワードを表示する

+
+ +
+

データベースのホスト名

+
データベースのホスト名を入力してください。
localhostであることが多いです。
+ +
+ + +
+ +
+ 戻る +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/admin/setup_uwuzu_db.php b/admin/setup_uwuzu_db.php new file mode 100644 index 0000000..f2c01ff --- /dev/null +++ b/admin/setup_uwuzu_db.php @@ -0,0 +1,214 @@ + 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(); + } + + $aduser = "yes"; + + $options = array( + // SQL実行失敗時に例外をスルー + PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, + // デフォルトフェッチモードを連想配列形式に設定 + PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, + // バッファードクエリを使う(一度に結果セットを全て取得し、サーバー負荷を軽減) + // SELECTで得た結果に対してもrowCountメソッドを使えるようにする + PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, + ); + + $dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option); + + try{ + $table_query = $dbh->prepare('SELECT 1 FROM role LIMIT 1;'); + $table_query->execute(); + $table_result = $table_query->fetch(); + if($table_result > 0){ + $query = $dbh->prepare('SELECT * FROM account WHERE admin = :adminuser limit 1'); + + $query->execute(array(':adminuser' => $aduser)); + + $result2 = $query->fetch(); + + if($result2 > 0){ + header("Location: ../login.php"); + exit; + } + header("Location: addadmin.php"); + exit; + } + } catch(PDOException $e) { + + } + + $db_php = true; +}else{ + $db_php = false; +} + +if(!(empty($_POST['btn_submit']))){ + $sqlfile = "../uwuzu_database.sql"; + $sqldata = file_get_contents($sqlfile); + if ($sqldata === false) { + $error_message[] = "SQLファイルの読み込みに失敗しました。"; + exit(); + } + if(empty($error_message)){ + try { + $option = array( + PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION + ); + $pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option); + + $pdo->exec($sqldata); + $db_setup = true; + + $role_sql = "insert into role (rolename, roleauth, rolecolor, roleidname) VALUES ('凍結済み', 'ice', 'CCCCCC', 'ice'); + insert into role (rolename, roleauth, rolecolor, roleidname) VALUES ('公式', 'official', 'CCCCCC', 'official'); + insert into role (rolename, roleauth, rolecolor, roleidname) VALUES ('ゆーざー', 'user', 'CCCCCC', 'user');"; + $pdo->exec($role_sql); + $role_setup = true; + + } catch (PDOException $e) { + $error_message[] = 'SQL実行エラー: ' . $e->getMessage(); + } + if(empty($error_message)){ + header("Location: addadmin.php"); + exit; + } + } +} + + +// データベースの接続を閉じる +$pdo = null; + +?> + + + + + + + + + + + +データベースのセットアップ - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?> + + + + + + + +
+ + +
+

データベースのセットアップ

+ +
    + +

    + +
+ + + +

データベースのセットアップを行います。
+ データベース内にテーブルというデータを保存する場所と必須ロールを作成します!
+ 作成にあたり、uwuzuにデフォルトで同梱されているuwuzu_database.sqlというファイルを使用します。
+ このファイルに悪質な命令などが含まれているとあなたのサーバーが死んでしまうおそれがあります!
+
+ uwuzuをuwuzuの公式ダウンロードページ(Github)からダウンロードしているならおそらく安全かと思われますが、
+ uwuzu_database.sqlが安全なことを確認したうえで以下のデータベースのセットアップを実行してください。
+
+ また、このセットアップには時間がかかる事があります!
+ 処理が終わるまで再起動などはせずに、そのままお待ち下さい!
+
+ データベースのセットアップが完了すると、管理者アカウントの登録へ進みます。

+ +
+ +
+ +
+ 戻る +
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/admin/success.php b/admin/success.php index 9508344..44879b3 100644 --- a/admin/success.php +++ b/admin/success.php @@ -65,12 +65,12 @@ if($result2 > 0){ exit; } -$servernamefile = "../server/servername.txt"; -if(!(empty($_SESSION['backupcode']))){ - $backupcode = $_SESSION['backupcode']; -}else{ - $backupcode = null; +$_SESSION = array(); +if (isset($_COOKIE[session_name()])) { + setcookie(session_name(), '', time()-1000, '/'); } +session_destroy(); + ?> @@ -85,7 +85,7 @@ if(!(empty($_SESSION['backupcode']))){ -アカウント登録完了!!! - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?> +管理者アカウント登録完了!!! - <?php echo htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8');?> @@ -99,9 +99,9 @@ if(!(empty($_SESSION['backupcode']))){
-

アカウント作成完了!

+

管理者アカウント登録完了!


いぇ~い!

-

88888888888

+

🎉🎉🎉🎊🎊🎊✨✨✨

管理者アカウントの登録が完了しました!

以下のログインボタンよりログインしてください!
ログイン後は画面左側メニューの「サーバー設定」よりサーバーの情報を設定することをおすすめします!
また、左側メニューの「設定」から二段階認証の設定をすることもおすすめします。

diff --git a/api/me/index.php b/api/me/index.php new file mode 100644 index 0000000..2d7bd0d --- /dev/null +++ b/api/me/index.php @@ -0,0 +1,228 @@ + 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; +} + +$pdo = null; +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(); +} + +$Get_Post_Json = file_get_contents("php://input"); +if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) { + //トークン取得 + if(!(empty($_GET['token']))){ + $token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false); + }else{ + $post_json = json_decode($Get_Post_Json, true); + if(isset($post_json["token"])){ + $token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false); + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + if($token == ""){ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + session_start(); + + if( !empty($pdo) ) { + $userQuery = $pdo->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{ + $DataQuery = $pdo->prepare("SELECT username,userid,profile,datetime,follow,follower,iconname,headname,role,sacinfo,admin FROM account WHERE userid = :userid"); + $DataQuery->bindValue(':userid', $userData["userid"]); + $DataQuery->execute(); + $userdata = $DataQuery->fetch(); + + if (empty($userdata)){ + $response = array( + 'error_code' => "critical_error_userdata_not_found", + ); + }else{ + $roles = explode(',', $userdata["role"]); + if(!(empty($roles))){ + foreach ($roles as $roleId) { + $Getrole = $pdo->prepare("SELECT roleidname, rolename, roleauth, rolecolor, roleeffect FROM role WHERE roleidname = :role"); + $Getrole->bindValue(':role', $roleId); + $Getrole->execute(); + $roleData[$roleId] = $Getrole->fetch(); + + if($roleData[$roleId]['roleeffect'] == '' || $roleData[$roleId]['roleeffect'] == 'none'){ + $role_view_effect = "none"; + }elseif($roleData[$roleId]['roleeffect'] == 'shine'){ + $role_view_effect = "shine"; + }elseif($roleData[$roleId]['roleeffect'] == 'rainbow'){ + $role_view_effect = "rainbow"; + }else{ + $role_view_effect = "none"; + } + + $roleinfo = array( + "name" => decode_yajirushi(htmlspecialchars_decode($roleData[$roleId]['rolename'])), + "color" => decode_yajirushi(htmlspecialchars_decode($roleData[$roleId]['rolecolor'])), + "effect" => decode_yajirushi(htmlspecialchars_decode($role_view_effect)), + "id" => decode_yajirushi(htmlspecialchars_decode($roleData[$roleId]['roleidname'])), + ); + + $role[] = $roleinfo; + } + }else{ + $role[] = ""; + } + + if(!(empty($userdata["sacinfo"]))){ + if($userdata["sacinfo"] == "bot"){ + $isBot = true; + }else{ + $isBot = false; + } + }else{ + $isBot = false; + } + + if(!(empty($userdata["admin"]))){ + if($userdata["admin"] == "yes"){ + $isAdmin = true; + }else{ + $isAdmin = false; + } + }else{ + $isAdmin = false; + } + if(!(empty($userdata["follow"]))){ + $followee = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($userdata["follow"]))); + array_shift($followee); + }else{ + $followee = array(); + } + if(!(empty($userdata["follower"]))){ + $follower = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($userdata["follower"]))); + array_shift($follower); + }else{ + $follower = array(); + } + + $followcnts = explode(',', $userdata["follow"]); + $userdata["follow_cnt"] = (int)count($followcnts)-1; + + $followercnts = explode(',', $userdata["follower"]); + $userdata["follower_cnt"] = (int)count($followercnts)-1; + + $allueuse = $pdo->prepare("SELECT account FROM ueuse WHERE account = :userid"); + $allueuse->bindValue(':userid', $userdata["userid"]); + $allueuse->execute(); + $All_ueuse = $allueuse->rowCount(); + + $response = array( + 'username' => decode_yajirushi(htmlspecialchars_decode($userdata["username"])), + 'userid' => 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"])), + 'followee' => $followee, + 'followee_cnt' => $userdata["follow_cnt"], + 'follower' => $follower, + 'follower_cnt' => $userdata["follower_cnt"], + 'ueuse_cnt' => $All_ueuse, + 'isBot' => $isBot, + 'isAdmin' => $isAdmin, + 'role' => $role, + 'language' => "ja-JP", + ); + } + 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/migration-api.php b/api/migration-api.php new file mode 100644 index 0000000..b7b50fd --- /dev/null +++ b/api/migration-api.php @@ -0,0 +1,249 @@ + PDO::ERRMODE_EXCEPTION, + PDO::MYSQL_ATTR_MULTI_STATEMENTS => false + ); + $pdo = new PDO('mysql:charset=utf8mb4;dbname=' . DB_NAME . ';host=' . DB_HOST, DB_USER, DB_PASS, $option); +} catch (PDOException $e) { + // 接続エラーのときエラー内容を取得する + $error_message[] = $e->getMessage(); +} + +if(isset($_GET['migration_code'])) { + if(isset($_GET['check'])) { + //移行後----------------------------------------------------------------------------------------------- + $migration_code = htmlentities($_GET['migration_code'], ENT_QUOTES, 'UTF-8', false); + $check = urldecode($_GET['check']); + $request_domain = htmlentities($_SERVER['REMOTE_ADDR'], ENT_QUOTES, 'UTF-8', false); + + $migrationQuery = $pdo->prepare("SELECT * FROM migration WHERE migration_code = :migration_code"); + $migrationQuery->bindValue(':migration_code', $migration_code); + $migrationQuery->execute(); + $migrationData = $migrationQuery->fetch(PDO::FETCH_ASSOC); + + if(!(empty($migrationData))){ + $UserdataQuery = $pdo->prepare("SELECT userid FROM account WHERE userid = :userid"); + $UserdataQuery->bindValue(':userid', $migrationData['account'], PDO::PARAM_STR); + $UserdataQuery->execute(); + $UserData = $UserdataQuery->fetch(PDO::FETCH_ASSOC); + + $done_chk = openssl_decrypt($check, "AES-256-CBC", $migrationData['encryption_key'], 0, $migrationData['encryption_ivkey']); + //下の文字列はアカウント移行が完了しているかの確認用!変えないで!!! + if($done_chk == "QYrLCSQIHqOLHuhJ"){ + $account = htmlentities($UserData["userid"], ENT_QUOTES, 'UTF-8', false); + $pdo->beginTransaction(); + try { + $deleteQuery = $pdo->prepare("DELETE FROM migration WHERE account = :account"); + $deleteQuery->bindValue(':account',$account, PDO::PARAM_STR); + $res = $deleteQuery->execute(); + $res = $pdo->commit(); + } catch(Exception $e) { + $pdo->rollBack(); + } + $newrole = "ice"; + $newtoken = "ice"; + $newadmin = "none"; + + // トランザクション開始 + $pdo->beginTransaction(); + try { + $stmt = $pdo->prepare("UPDATE account SET role = :role,token = :newtoken,admin = :newadmin WHERE userid = :userid"); + + $stmt->bindValue(':role', $newrole, PDO::PARAM_STR); + $stmt->bindValue(':newtoken', $newtoken, PDO::PARAM_STR); + $stmt->bindValue(':newadmin', $newadmin, PDO::PARAM_STR); + + $stmt->bindValue(':userid', $account, PDO::PARAM_STR); + + // SQLクエリの実行 + $res = $stmt->execute(); + + // コミット + $res = $pdo->commit(); + + + } catch (Exception $e) { + + // エラーが発生した時はロールバック + $pdo->rollBack(); + } + //メール送信はナシ + //------------ + $pdo->beginTransaction(); + + try { + $datetime = date("Y-m-d H:i:s"); + $msg = "アカウントの移行が完了したためこのアカウントの不正コピーを防ぐためアカウントを凍結しました!\n引き続きこのアカウントを利用するには管理者に凍結を解除してもらってください!"; + $title = "✨アカウントの移行が完了しました!🔄️"; + $url = "/rule/serverabout"; + $userchk = 'none'; + $from_userid = "uwuzu-fromsys"; + + $stmt = $pdo->prepare("INSERT INTO notification (fromuserid, touserid, msg, url, datetime, userchk, title) VALUES (:fromuserid, :touserid, :msg, :url, :datetime, :userchk, :title)"); + + $stmt->bindParam(':fromuserid', $from_userid, PDO::PARAM_STR); + $stmt->bindParam(':touserid', $account, 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 ($res) { + $item = array( + 'done' => 'success', + ); + $noencriptjson = json_encode($item, JSON_UNESCAPED_UNICODE); + $encriptjson = openssl_encrypt($noencriptjson, "AES-256-CBC", $migrationData['encryption_key'], 0, $migrationData['encryption_ivkey']); + $response = array( + 'data' => $encriptjson, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + } else { + $err = "migration_bad_success"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + } + + }else { + $err = "migration_bad_success"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + } + }else{ + $err = "migration_notfound"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + } + }else{ + //移行データ + $migration_code = htmlentities($_GET['migration_code'], ENT_QUOTES, 'UTF-8', false); + $request_domain = htmlentities($_SERVER['REMOTE_ADDR'], ENT_QUOTES, 'UTF-8', false); + + $migrationQuery = $pdo->prepare("SELECT * FROM migration WHERE migration_code = :migration_code"); + $migrationQuery->bindValue(':migration_code', $migration_code); + $migrationQuery->execute(); + $migrationData = $migrationQuery->fetch(PDO::FETCH_ASSOC); + + if(!(empty($migrationData))){ + $UserdataQuery = $pdo->prepare("SELECT * FROM account WHERE userid = :userid"); + $UserdataQuery->bindValue(':userid', $migrationData['account'], PDO::PARAM_STR); + $UserdataQuery->execute(); + $UserData = $UserdataQuery->fetch(PDO::FETCH_ASSOC); + + /* + // 投稿内容の取得(新しい順に1000件取得) + $ueuseQuery = $pdo->prepare("SELECT * FROM ueuse WHERE account = :userid AND rpuniqid = '' ORDER BY datetime DESC LIMIT 1000"); + $ueuseQuery->bindValue(':userid', $migrationData['account'], PDO::PARAM_STR); + $ueuseQuery->execute(); + $ueuse_array = $ueuseQuery->fetchAll(); + */ + if(!(empty($UserData))){ + /* + if(!(empty($ueuse_array))){ + foreach ($ueuse_array as $value) { + $ueuses = array( + "username" => decode_yajirushi(htmlentities($value['username'], ENT_QUOTES, 'UTF-8', false)), + "account" => decode_yajirushi(htmlentities($value['account'], ENT_QUOTES, 'UTF-8', false)), + "uniqid" => decode_yajirushi(htmlentities($value['uniqid'], ENT_QUOTES, 'UTF-8', false)), + "ueuse" => decode_yajirushi(htmlentities($value['ueuse'], ENT_QUOTES, 'UTF-8', false)), + "datetime" => decode_yajirushi(htmlentities($value['datetime'], ENT_QUOTES, 'UTF-8', false)), + "abi" => decode_yajirushi(htmlentities($value['abi'], ENT_QUOTES, 'UTF-8', false)), + "abidate" => decode_yajirushi(htmlentities($value['abidate'], ENT_QUOTES, 'UTF-8', false)), + "nsfw" => decode_yajirushi(htmlentities($value['nsfw'], ENT_QUOTES, 'UTF-8', false)), + ); + + $ueuse[] = $ueuses; + } + }else{ + $ueuse[] = ""; + } + */ + $item = [ + "userdata" => array( + "user_name" => htmlentities($UserData["username"], ENT_QUOTES, 'UTF-8', false), + "user_id" => htmlentities($UserData["userid"], ENT_QUOTES, 'UTF-8', false), + "user_icon" => (empty($_SERVER['HTTPS']) ? 'http://' : 'https://').$domain."/".htmlentities($UserData["iconname"], ENT_QUOTES, 'UTF-8', false), + "user_header" => (empty($_SERVER['HTTPS']) ? 'http://' : 'https://').$domain."/".htmlentities($UserData["headname"], ENT_QUOTES, 'UTF-8', false), + "user_profile" => htmlentities($UserData["profile"], ENT_QUOTES, 'UTF-8', false), + "mail_adds" => htmlentities($UserData["mailadds"], ENT_QUOTES, 'UTF-8', false), + ), + ]; + + $noencriptjson = json_encode($item, JSON_UNESCAPED_UNICODE); + $encriptjson = openssl_encrypt($noencriptjson, "AES-256-CBC", $migrationData['encryption_key'], 0, $migrationData['encryption_ivkey']); + + $response = array( + 'data' => $encriptjson, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + }else{ + $err = "data_notfound"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + } + }else{ + $err = "migration_notfound"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + } + } + + +}else{ + $err = "migration_code_notfound"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); +} +?> \ No newline at end of file diff --git a/api/serverinfo-api.php b/api/serverinfo-api.php index f7f9863..9e294a2 100644 --- a/api/serverinfo-api.php +++ b/api/serverinfo-api.php @@ -75,16 +75,25 @@ function decode_yajirushi($postText){ }else{ $invitation_code = false; } + if(htmlspecialchars($serversettings["serverinfo"]["server_account_migration"], ENT_QUOTES, 'UTF-8') === "true"){ + $account_migration = true; + }else{ + $account_migration = false; + } - foreach ($notices as $value) { - $notices = array( - "title" => decode_yajirushi(htmlspecialchars_decode($value['title'])), - "note" => decode_yajirushi(htmlspecialchars_decode($value['note'])), - "editor" => decode_yajirushi(htmlspecialchars_decode($value['account'])), - "datetime" => decode_yajirushi(htmlspecialchars_decode($value['datetime'])), - ); + if(!(empty($notices))){ + foreach ($notices as $value) { + $notices = array( + "title" => decode_yajirushi(htmlspecialchars_decode($value['title'])), + "note" => decode_yajirushi(htmlspecialchars_decode($value['note'])), + "editor" => decode_yajirushi(htmlspecialchars_decode($value['account'])), + "datetime" => decode_yajirushi(htmlspecialchars_decode($value['datetime'])), + ); - $notice[] = $notices; + $notice[] = $notices; + } + }else{ + $notice[] = ""; } $item = [ @@ -103,6 +112,7 @@ function decode_yajirushi($postText){ "max_ueuse_length" => (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8'), "invitation_code" => $invitation_code, + "account_migration" => $account_migration, "usage" => [ "users" => $count1, diff --git a/api/ueuse/create.php b/api/ueuse/create.php new file mode 100644 index 0000000..bac12be --- /dev/null +++ b/api/ueuse/create.php @@ -0,0 +1,379 @@ + 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; +} + +$pdo = null; +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(); +} + +$Get_Post_Json = file_get_contents("php://input"); +if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) { + //トークン取得 + if(!(empty($_GET['token']))){ + $token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false); + }else{ + $post_json = json_decode($Get_Post_Json, true); + if(isset($post_json["token"])){ + $token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false); + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + if($token == ""){ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + session_start(); + + if( !empty($pdo) ) { + $userQuery = $pdo->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{ + //本文取得 + if(!(empty($_GET['text']))){ + $ueuse = htmlentities($_GET['text'], ENT_QUOTES, 'UTF-8', false); + }elseif(!(empty($post_json["text"]))){ + $ueuse = htmlentities($post_json["text"], ENT_QUOTES, 'UTF-8', false); + } + //リプライ先取得 + if(!(empty($_GET['replyid']))){ + $replyid = htmlentities($_GET['replyid'], ENT_QUOTES, 'UTF-8', false); + }elseif(!(empty($post_json["replyid"]))){ + $replyid = htmlentities($post_json["replyid"], ENT_QUOTES, 'UTF-8', false); + }else{ + $replyid = ""; + } + + //NSFWの有無 + if(!(empty($_GET['nsfw']))){ + $nsfwchk = htmlentities($_GET['nsfw'], ENT_QUOTES, 'UTF-8', false); + if($nsfwchk == "true"){ + $nsfw = "true"; + }else{ + $nsfw = "false"; + } + }elseif(!(empty($post_json["nsfw"]))){ + $nsfwchk = htmlentities($post_json["nsfw"], ENT_QUOTES, 'UTF-8', false); + if($nsfwchk == true){ + $nsfw = "true"; + }else{ + $nsfw = "false"; + } + }else{ + $nsfw = "false"; + } + + //Base64での画像送信の確認(POSTのみ&デコードは関数(Base64_mime)側でやってくれる) + $img_uid = htmlspecialchars($userData["userid"], ENT_QUOTES, 'UTF-8', false);//UserID必須 + if(!(empty($post_json["image1"]))){ + $image1 = htmlentities($post_json["image1"], ENT_QUOTES, 'UTF-8', false); + $UploadPath1 = base64_mime($image1,$img_uid); + if($UploadPath1 == false){ + $UploadPath1 = "none"; + } + }else{ + $UploadPath1 = "none"; + } + if(!(empty($post_json["image2"]))){ + $image2 = htmlentities($post_json["image2"], ENT_QUOTES, 'UTF-8', false); + $UploadPath2 = base64_mime($image2,$img_uid); + if($UploadPath2 == false){ + $UploadPath2 = "none"; + } + }else{ + $UploadPath2 = "none"; + } + if(!(empty($post_json["image3"]))){ + $image3 = htmlentities($post_json["image3"], ENT_QUOTES, 'UTF-8', false); + $UploadPath3 = base64_mime($image3,$img_uid); + if($UploadPath3 == false){ + $UploadPath3 = "none"; + } + }else{ + $UploadPath3 = "none"; + } + if(!(empty($post_json["image4"]))){ + $image4 = htmlentities($post_json["image4"], ENT_QUOTES, 'UTF-8', false); + $UploadPath4 = base64_mime($image4,$img_uid); + if($UploadPath4 == false){ + $UploadPath4 = "none"; + } + }else{ + $UploadPath4 = "none"; + } + //ここまで----------------------------------------- + + $old_datetime = date("Y-m-d H:i:00"); + $now_datetime = date("Y-m-d H:i:00",strtotime("+1 minute")); + $rate_Query = $pdo->prepare("SELECT * FROM ueuse WHERE account = :userid AND TIME(datetime) BETWEEN :old_datetime AND :now_datetime"); + $rate_Query->bindValue(':userid', $userData["userid"]); + $rate_Query->bindValue(':old_datetime', $old_datetime); + $rate_Query->bindValue(':now_datetime', $now_datetime); + $rate_Query->execute(); + $rate_count = $rate_Query->rowCount(); + if(!($rate_count > $max_ueuse_rate_limit-1)){ + if( empty($ueuse) ) { + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } else { + // 文字数を確認 + if( (int)htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8') < mb_strlen($ueuse, 'UTF-8') ) { + $err = "content_to_".htmlspecialchars(file_get_contents($mojisizefile), ENT_QUOTES, 'UTF-8')."_characters"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + // 禁止url確認 + for($i = 0; $i < count($banurl); $i++) { + if(!($banurl[$i] == "")){ + if (false !== strpos($ueuse, 'https://'.$banurl[$i])) { + $err = "contains_prohibited_url"; + $response = array( + 'error_code' => $err, + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + } + } + if(!(empty($replyid))){ + $rpChkQuery = $pdo->prepare("SELECT * FROM ueuse WHERE uniqid = :rpuniqid"); + $rpChkQuery->bindValue(':rpuniqid', $replyid); + $rpChkQuery->execute(); + $rpChkcount = $rpChkQuery->rowCount(); + if(empty($rpChkcount)){ + $err = "no_reply_destination"; + $response = array( + 'error_code' => $err, + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + + // 書き込み日時を取得 + $username = htmlspecialchars($userData["username"], ENT_QUOTES, 'UTF-8', false); + $userid = htmlspecialchars($userData["userid"], ENT_QUOTES, 'UTF-8', false); + $datetime = htmlspecialchars(date("Y-m-d H:i:s"), ENT_QUOTES, 'UTF-8', false); + $uniqid = htmlspecialchars(createUniqId(), ENT_QUOTES, 'UTF-8', false); + $abi = "none"; + $nones = "none"; + + // トランザクション開始 + $pdo->beginTransaction(); + + try { + + // SQL作成 + $stmt = $pdo->prepare("INSERT INTO ueuse (username, account, uniqid, rpuniqid, ueuse, photo1, photo2, photo3, photo4, video1, datetime, abi, nsfw) VALUES (:username, :account, :uniqid, :rpuniqid, :ueuse, :photo1, :photo2, :photo3, :photo4, :video1, :datetime, :abi, :nsfw)"); + + $stmt->bindParam(':username', $username, PDO::PARAM_STR); + $stmt->bindParam(':account', $userid, PDO::PARAM_STR); + $stmt->bindParam(':uniqid', $uniqid, PDO::PARAM_STR); + $stmt->bindParam(':rpuniqid', $replyid, PDO::PARAM_STR); + $stmt->bindParam(':ueuse', $ueuse, PDO::PARAM_STR); + + $stmt->bindParam(':photo1', $UploadPath1, PDO::PARAM_STR); + $stmt->bindParam(':photo2', $UploadPath2, PDO::PARAM_STR); + $stmt->bindParam(':photo3', $UploadPath3, PDO::PARAM_STR); + $stmt->bindParam(':photo4', $UploadPath4, PDO::PARAM_STR); + $stmt->bindParam(':video1', $nones, PDO::PARAM_STR); + + $stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR); + + $stmt->bindParam(':abi', $abi, PDO::PARAM_STR); + $stmt->bindParam(':nsfw', $nsfw, PDO::PARAM_STR); + + // SQLクエリの実行 + $res = $stmt->execute(); + + // コミット + $res = $pdo->commit(); + + $mentionedUsers = array_unique(get_mentions_userid($ueuse)); + + foreach ($mentionedUsers as $mentionedUser) { + + $pdo->beginTransaction(); + + try { + $fromuserid = htmlspecialchars($userid, ENT_QUOTES, 'UTF-8', false); + $touserid = htmlspecialchars($mentionedUser, ENT_QUOTES, 'UTF-8', false); + $datetime = htmlspecialchars(date("Y-m-d H:i:s"), ENT_QUOTES, 'UTF-8', false); + $msg = "" . $ueuse . ""; + $title = "" . htmlspecialchars($username, ENT_QUOTES, 'UTF-8', false) . "さんにメンションされました!"; + $url = "/!" . htmlspecialchars($uniqid, ENT_QUOTES, 'UTF-8', false) . ""; + $userchk = 'none'; + + // 通知用SQL作成 + $stmt = $pdo->prepare("INSERT INTO notification (fromuserid, touserid, msg, url, datetime, userchk, title) VALUES (:fromuserid, :touserid, :msg, :url, :datetime, :userchk, :title)"); + + $stmt->bindParam(':fromuserid', $fromuserid, PDO::PARAM_STR); + $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(); + } + + } + + } catch(Exception $e) { + + // エラーが発生した時はロールバック + $pdo->rollBack(); + } + + if( $res ) { + $response = array( + 'uniqid' => decode_yajirushi(htmlspecialchars_decode($uniqid)), + 'userid' => decode_yajirushi(htmlspecialchars_decode($userid)), + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + } else { + $err = "db_error_".$e->getMessage(); + $response = array( + 'error_code' => $err, + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + } + + // プリペアドステートメントを削除 + $stmt = null; + }else{ + $err = "over_rate_limit"; + $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/api/ueuse/delete.php b/api/ueuse/delete.php new file mode 100644 index 0000000..d958de7 --- /dev/null +++ b/api/ueuse/delete.php @@ -0,0 +1,244 @@ + 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; +} + +$pdo = null; +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(); +} + +$Get_Post_Json = file_get_contents("php://input"); +if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) { + //トークン取得 + if(!(empty($_GET['token']))){ + $token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false); + }else{ + $post_json = json_decode($Get_Post_Json, true); + if(isset($post_json["token"])){ + $token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false); + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + if($token == ""){ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + if(!(empty($_GET['uniqid']))){ + $ueuseid = $_GET['uniqid']; + }elseif(!(empty($post_json["uniqid"]))){ + $ueuseid = $post_json["uniqid"]; + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + session_start(); + + if( !empty($pdo) ) { + $userQuery = $pdo->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{ + $query = $pdo->prepare('SELECT * FROM ueuse WHERE uniqid = :uniqid limit 1'); + + $query->execute(array(':uniqid' => $ueuseid)); + + $result = $query->fetch(); + + if(!(empty($result))){ + if($result["account"] === $userData["userid"]){ + + $Userid = $userData["userid"]; + $photo_query = $pdo->prepare("SELECT * FROM ueuse WHERE account = :userid AND uniqid = :uniqid"); + $photo_query->bindValue(':userid', $Userid); + $photo_query->bindValue(':uniqid', $ueuseid); + $photo_query->execute(); + $photo_and_video = $photo_query->fetch(); + + if(!($photo_and_video["photo1"] == "none")){ + $photoDelete1 = glob("../".$photo_and_video["photo1"]); // 「-ユーザーID.拡張子」というパターンを検索 + foreach ($photoDelete1 as $photo1) { + if (is_file($photo1)) { + unlink($photo1); + } + } + } + if(!($photo_and_video["photo2"] == "none")){ + $photoDelete2 = glob("../".$photo_and_video["photo2"]); // 「-ユーザーID.拡張子」というパターンを検索 + foreach ($photoDelete2 as $photo2) { + if (is_file($photo2)) { + unlink($photo2); + } + } + } + if(!($photo_and_video["photo3"] == "none")){ + $photoDelete3 = glob("../".$photo_and_video["photo3"]); // 「-ユーザーID.拡張子」というパターンを検索 + foreach ($photoDelete3 as $photo3) { + if (is_file($photo3)) { + unlink($photo3); + } + } + } + if(!($photo_and_video["photo4"] == "none")){ + $photoDelete4 = glob("../".$photo_and_video["photo4"]); // 「-ユーザーID.拡張子」というパターンを検索 + foreach ($photoDelete4 as $photo4) { + if (is_file($photo4)) { + unlink($photo4); + } + } + } + if(!($photo_and_video["video1"] == "none")){ + $videoDelete1 = glob("../".$photo_and_video["video1"]); // 「-ユーザーID.拡張子」というパターンを検索 + foreach ($videoDelete1 as $video1) { + if (is_file($video1)) { + unlink($video1); + } + } + } + + + try { + $deleteQuery = $pdo->prepare("DELETE FROM ueuse WHERE uniqid = :uniqid AND account = :userid"); + $deleteQuery->bindValue(':uniqid', $ueuseid, PDO::PARAM_STR); + $deleteQuery->bindValue(':userid', $Userid, PDO::PARAM_STR); + $res = $deleteQuery->execute(); + + if ($res) { + $response = array( + 'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueuseid)), + 'userid' => decode_yajirushi(htmlspecialchars_decode($userData["userid"])), + 'success' => true + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } else { + $response = array( + 'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueuseid)), + 'userid' => decode_yajirushi(htmlspecialchars_decode($Userid)), + 'success' => false + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } catch(PDOException $e) { + $response = array( + 'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueuseid)), + 'userid' => decode_yajirushi(htmlspecialchars_decode($userData["userid"])), + 'success' => false + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + + } else { + $err = "ueuse_not_found"; + $response = array( + 'error_code' => $err, + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + } + } +}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/get.php b/api/ueuse/get.php new file mode 100644 index 0000000..4a6469a --- /dev/null +++ b/api/ueuse/get.php @@ -0,0 +1,213 @@ + 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; +} + +$pdo = null; +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(); +} + +$Get_Post_Json = file_get_contents("php://input"); +if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) { + //トークン取得 + if(!(empty($_GET['token']))){ + $token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false); + }else{ + $post_json = json_decode($Get_Post_Json, true); + if(isset($post_json["token"])){ + $token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false); + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + if($token == ""){ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + if(!(empty($_GET['uniqid']))){ + $ueuseid = $_GET['uniqid']; + }elseif(!(empty($post_json["uniqid"]))){ + $ueuseid = $post_json["uniqid"]; + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + session_start(); + + if( !empty($pdo) ) { + $userQuery = $pdo->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 * FROM ueuse WHERE uniqid = :ueuseid ORDER BY datetime ASC LIMIT 1"; + $stmt = $pdo->prepare($sql); + $stmt->bindValue(':ueuseid', $ueuseid, PDO::PARAM_STR); + $stmt->execute(); + $message_array = $stmt; + + while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) { + + $messages[] = $row; + } + + if (!empty($messages)) { + $response = array(); // ループ外で $response を初期化 + + foreach ($messages as $ueusedata) { + if(!(empty($ueusedata["favorite"]))){ + $favorite = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"]))); + array_shift($favorite); + }else{ + $favorite = array(); + } + $favcnts = explode(',', $ueusedata["favorite"]); + $ueusedata["favorite_cnt"] = count($favcnts) - 1; + + $userQuery = $pdo->prepare("SELECT username, userid, iconname, headname, role FROM account WHERE userid = :userid"); + $userQuery->bindValue(':userid', $ueusedata["account"]); + $userQuery->execute(); + $userData = $userQuery->fetch(); + + if ($userData) { + $now_userdata = array( + "username" => decode_yajirushi(htmlspecialchars_decode($userData['username'])), + "userid" => decode_yajirushi(htmlspecialchars_decode($userData['userid'])), + "user_icon" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['iconname'])), + "user_head" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['headname'])), + ); + } + + if($ueusedata["nsfw"] == "true"){ + $nsfw = true; + }else{ + $nsfw = false; + } + + $item = [ + 'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])), + 'replyid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["rpuniqid"])), + 'text' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])), + 'account' => $now_userdata, + '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' => $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' => $nsfw, + ]; + + $response[] = $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); + } + } + } +}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/index.php b/api/ueuse/index.php new file mode 100644 index 0000000..c2d5702 --- /dev/null +++ b/api/ueuse/index.php @@ -0,0 +1,226 @@ + 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; +} + +$pdo = null; +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(); +} + +$Get_Post_Json = file_get_contents("php://input"); +if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) { + //トークン取得 + if(!(empty($_GET['token']))){ + $token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false); + }else{ + $post_json = json_decode($Get_Post_Json, true); + if(isset($post_json["token"])){ + $token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false); + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + if($token == ""){ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + if(!(empty($_GET['limit']))){ + $limit = (int)$_GET['limit']; + }elseif(!(empty($post_json["limit"]))){ + $limit = (int)$post_json["limit"]; + }else{ + $limit = 25; + } + if($limit > 100){ + $limit = 100; + } + + if(!(empty($_GET['page']))){ + $page = (int)$_GET['page']; + }elseif(!(empty($post_json["page"]))){ + $page = (int)$post_json["page"]; + }else{ + $page = 1; + } + $offset = ($page - 1) * $limit; + + session_start(); + + if( !empty($pdo) ) { + $userQuery = $pdo->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', $limit, PDO::PARAM_INT); + $stmt->execute(); + $message_array = $stmt; + + while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) { + + $messages[] = $row; + } + + if (!empty($messages)) { + $response = array(); // ループ外で $response を初期化 + + foreach ($messages as $ueusedata) { + if(!(empty($ueusedata["favorite"]))){ + $favorite = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"]))); + array_shift($favorite); + }else{ + $favorite = array(); + } + $favcnts = explode(',', $ueusedata["favorite"]); + $ueusedata["favorite_cnt"] = count($favcnts) - 1; + + $userQuery = $pdo->prepare("SELECT username, userid, iconname, headname, role FROM account WHERE userid = :userid"); + $userQuery->bindValue(':userid', $ueusedata["account"]); + $userQuery->execute(); + $userData = $userQuery->fetch(); + + if ($userData) { + $now_userdata = array( + "username" => decode_yajirushi(htmlspecialchars_decode($userData['username'])), + "userid" => decode_yajirushi(htmlspecialchars_decode($userData['userid'])), + "user_icon" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['iconname'])), + "user_head" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['headname'])), + ); + } + + if($ueusedata["nsfw"] == "true"){ + $nsfw = true; + }else{ + $nsfw = false; + } + + $item = [ + 'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])), + 'replyid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["rpuniqid"])), + 'text' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])), + 'account' => $now_userdata, + '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' => $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' => $nsfw, + ]; + + $response[] = $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); + } + } + } +}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/mentions.php b/api/ueuse/mentions.php new file mode 100644 index 0000000..40615dc --- /dev/null +++ b/api/ueuse/mentions.php @@ -0,0 +1,224 @@ + 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; +} + +$pdo = null; +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(); +} + +$Get_Post_Json = file_get_contents("php://input"); +if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) { + //トークン取得 + if(!(empty($_GET['token']))){ + $token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false); + }else{ + $post_json = json_decode($Get_Post_Json, true); + if(isset($post_json["token"])){ + $token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false); + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + if($token == ""){ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + if(!(empty($_GET['limit']))){ + $limit = (int)$_GET['limit']; + }elseif(!(empty($post_json["limit"]))){ + $limit = (int)$post_json["limit"]; + }else{ + $limit = 25; + } + if($limit > 100){ + $limit = 100; + } + + if(!(empty($_GET['page']))){ + $page = (int)$_GET['page']; + }elseif(!(empty($post_json["page"]))){ + $page = (int)$post_json["page"]; + }else{ + $page = 1; + } + $offset = ($page - 1) * $limit; + + session_start(); + + if( !empty($pdo) ) { + $userQuery = $pdo->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{ + $Userid = $userData["userid"]; + + $sql = "SELECT * FROM ueuse WHERE ueuse LIKE :keyword OR abi LIKE :keyword ORDER BY datetime DESC LIMIT :offset, :itemsPerPage"; + + $stmt = $pdo->prepare($sql); + $stmt->bindValue(':offset', $offset, PDO::PARAM_INT); + $stmt->bindValue(':itemsPerPage', $limit, PDO::PARAM_INT); + $stmt->bindValue(':keyword', '%@' . $Userid . '%', PDO::PARAM_STR); + $stmt->execute(); + $message_array = $stmt; + + while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) { + + $messages[] = $row; + } + + if (!empty($messages)) { + $response = array(); // ループ外で $response を初期化 + + foreach ($messages as $ueusedata) { + if(!(empty($ueusedata["favorite"]))){ + $favorite = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"]))); + array_shift($favorite); + }else{ + $favorite = array(); + } + $favcnts = explode(',', $ueusedata["favorite"]); + $ueusedata["favorite_cnt"] = count($favcnts) - 1; + + $userQuery = $pdo->prepare("SELECT username, userid, iconname, headname, role FROM account WHERE userid = :userid"); + $userQuery->bindValue(':userid', $ueusedata["account"]); + $userQuery->execute(); + $userData = $userQuery->fetch(); + + if ($userData) { + $now_userdata = array( + "username" => decode_yajirushi(htmlspecialchars_decode($userData['username'])), + "userid" => decode_yajirushi(htmlspecialchars_decode($userData['userid'])), + "user_icon" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['iconname'])), + "user_head" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['headname'])), + ); + } + + if($ueusedata["nsfw"] == "true"){ + $nsfw = true; + }else{ + $nsfw = false; + } + + $item = [ + 'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])), + 'replyid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["rpuniqid"])), + 'text' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])), + 'account' => $now_userdata, + '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' => $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' => $nsfw, + ]; + + $response[] = $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); + } + } + } +}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/replies.php b/api/ueuse/replies.php new file mode 100644 index 0000000..23798b3 --- /dev/null +++ b/api/ueuse/replies.php @@ -0,0 +1,235 @@ + 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; +} + +$pdo = null; +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(); +} + +$Get_Post_Json = file_get_contents("php://input"); +if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) { + //トークン取得 + if(!(empty($_GET['token']))){ + $token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false); + }else{ + $post_json = json_decode($Get_Post_Json, true); + if(isset($post_json["token"])){ + $token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false); + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + if($token == ""){ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + if(!(empty($_GET['uniqid']))){ + $ueuseid = $_GET['uniqid']; + }elseif(!(empty($post_json["uniqid"]))){ + $ueuseid = $post_json["uniqid"]; + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + if(!(empty($_GET['limit']))){ + $limit = (int)$_GET['limit']; + }elseif(!(empty($post_json["limit"]))){ + $limit = (int)$post_json["limit"]; + }else{ + $limit = 25; + } + if($limit > 100){ + $limit = 100; + } + + if(!(empty($_GET['page']))){ + $page = (int)$_GET['page']; + }elseif(!(empty($post_json["page"]))){ + $page = (int)$post_json["page"]; + }else{ + $page = 1; + } + $offset = ($page - 1) * $limit; + + session_start(); + + if( !empty($pdo) ) { + $userQuery = $pdo->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 * FROM ueuse WHERE uniqid = :ueuseid OR rpuniqid = :ueuseid ORDER BY datetime ASC LIMIT :offset, :itemsPerPage"; + $stmt = $pdo->prepare($sql); + $stmt->bindValue(':ueuseid', $ueuseid, PDO::PARAM_STR); + $stmt->bindValue(':offset', $offset, PDO::PARAM_INT); + $stmt->bindValue(':itemsPerPage', $limit, PDO::PARAM_INT); + $stmt->execute(); + $message_array = $stmt; + + while ($row = $message_array->fetchA(PDO::FETCH_ASSOC)) { + + $messages[] = $row; + } + + if (!empty($messages)) { + $response = array(); // ループ外で $response を初期化 + + foreach ($messages as $ueusedata) { + if(!(empty($ueusedata["favorite"]))){ + $favorite = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"]))); + array_shift($favorite); + }else{ + $favorite = array(); + } + $favcnts = explode(',', $ueusedata["favorite"]); + $ueusedata["favorite_cnt"] = count($favcnts) - 1; + + $userQuery = $pdo->prepare("SELECT username, userid, iconname, headname, role FROM account WHERE userid = :userid"); + $userQuery->bindValue(':userid', $ueusedata["account"]); + $userQuery->execute(); + $userData = $userQuery->fetch(); + + if ($userData) { + $now_userdata = array( + "username" => decode_yajirushi(htmlspecialchars_decode($userData['username'])), + "userid" => decode_yajirushi(htmlspecialchars_decode($userData['userid'])), + "user_icon" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['iconname'])), + "user_head" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['headname'])), + ); + } + + if($ueusedata["nsfw"] == "true"){ + $nsfw = true; + }else{ + $nsfw = false; + } + + $item = [ + 'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])), + 'replyid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["rpuniqid"])), + 'text' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])), + 'account' => $now_userdata, + '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' => $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' => $nsfw, + ]; + + $response[] = $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); + } + } + } +}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/search.php b/api/ueuse/search.php new file mode 100644 index 0000000..663dea8 --- /dev/null +++ b/api/ueuse/search.php @@ -0,0 +1,238 @@ + 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; +} + +$pdo = null; +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(); +} + +$Get_Post_Json = file_get_contents("php://input"); +if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) { + //トークン取得 + if(!(empty($_GET['token']))){ + $token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false); + }else{ + $post_json = json_decode($Get_Post_Json, true); + if(isset($post_json["token"])){ + $token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false); + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + if($token == ""){ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + if(!(empty($_GET['keyword']))){ + $keyword = $_GET['keyword']; + }elseif(!(empty($post_json["keyword"]))){ + $keyword = $post_json["keyword"]; + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + if(!(empty($_GET['limit']))){ + $limit = (int)$_GET['limit']; + }elseif(!(empty($post_json["limit"]))){ + $limit = (int)$post_json["limit"]; + }else{ + $limit = 25; + } + if($limit > 100){ + $limit = 100; + } + + if(!(empty($_GET['page']))){ + $page = (int)$_GET['page']; + }elseif(!(empty($post_json["page"]))){ + $page = (int)$post_json["page"]; + }else{ + $page = 1; + } + $offset = ($page - 1) * $limit; + + session_start(); + + if( !empty($pdo) ) { + $userQuery = $pdo->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{ + $Userid = $userData["userid"]; + + $sql = "SELECT * FROM ueuse WHERE ueuse LIKE :keyword OR abi LIKE :keyword ORDER BY datetime DESC LIMIT :offset, :itemsPerPage"; + + $stmt = $pdo->prepare($sql); + $stmt->bindValue(':offset', $offset, PDO::PARAM_INT); + $stmt->bindValue(':itemsPerPage', $limit, PDO::PARAM_INT); + $stmt->bindValue(':keyword', '%' . $keyword . '%', PDO::PARAM_STR); + $stmt->execute(); + $message_array = $stmt; + + while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) { + + $messages[] = $row; + } + + if (!empty($messages)) { + $response = array(); // ループ外で $response を初期化 + + foreach ($messages as $ueusedata) { + if(!(empty($ueusedata["favorite"]))){ + $favorite = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($ueusedata["favorite"]))); + array_shift($favorite); + }else{ + $favorite = array(); + } + $favcnts = explode(',', $ueusedata["favorite"]); + $ueusedata["favorite_cnt"] = count($favcnts) - 1; + + $userQuery = $pdo->prepare("SELECT username, userid, iconname, headname, role FROM account WHERE userid = :userid"); + $userQuery->bindValue(':userid', $ueusedata["account"]); + $userQuery->execute(); + $userData = $userQuery->fetch(); + + if ($userData) { + $now_userdata = array( + "username" => decode_yajirushi(htmlspecialchars_decode($userData['username'])), + "userid" => decode_yajirushi(htmlspecialchars_decode($userData['userid'])), + "user_icon" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['iconname'])), + "user_head" => decode_yajirushi(htmlspecialchars_decode("https://".$domain."/".$userData['headname'])), + ); + } + + if($ueusedata["nsfw"] == "true"){ + $nsfw = true; + }else{ + $nsfw = false; + } + + $item = [ + 'uniqid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["uniqid"])), + 'replyid' => decode_yajirushi(htmlspecialchars_decode($ueusedata["rpuniqid"])), + 'text' => decode_yajirushi(htmlspecialchars_decode($ueusedata["ueuse"])), + 'account' => $now_userdata, + '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' => $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' => $nsfw, + ]; + + $response[] = $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); + } + } + } +}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/users/follow.php b/api/users/follow.php new file mode 100644 index 0000000..8e11380 --- /dev/null +++ b/api/users/follow.php @@ -0,0 +1,250 @@ + 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; +} + +$pdo = null; +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(); +} + +$Get_Post_Json = file_get_contents("php://input"); +if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) { + //トークン取得 + if(!(empty($_GET['token']))){ + $token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false); + }else{ + $post_json = json_decode($Get_Post_Json, true); + if(isset($post_json["token"])){ + $token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false); + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + if($token == ""){ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + session_start(); + + if( !empty($pdo) ) { + $userQuery = $pdo->prepare("SELECT username, userid, role, follow, follower 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{ + //本文取得 + if(!(empty($_GET['userid']))){ + $follow_userid = htmlentities($_GET['userid'], ENT_QUOTES, 'UTF-8', false); + }elseif(!(empty($post_json["userid"]))){ + $follow_userid = htmlentities($post_json["userid"], ENT_QUOTES, 'UTF-8', false); + } + + if(!(empty($follow_userid))){ + $DataQuery = $pdo->prepare("SELECT username,userid,follow,follower FROM account WHERE userid = :userid"); + $DataQuery->bindValue(':userid', $follow_userid); + $DataQuery->execute(); + $Follow_userdata = $DataQuery->fetch(); + + $userid = $userData["userid"]; + + if(!(empty($Follow_userdata))){ + if(!($userid == $Follow_userdata['userid'])){ + $followerList = explode(',', $Follow_userdata['follower']); + if (!(in_array($userid, $followerList))) { + // 自分が相手をフォローしていない場合、相手のfollowerカラムと自分のfollowカラムを更新 + $followerList[] = $userid; + $newFollowerList = implode(',', $followerList); + + // UPDATE文を実行してフォロー情報を更新 + $updateQuery = $pdo->prepare("UPDATE account SET follower = :follower WHERE userid = :userid"); + $updateQuery->bindValue(':follower', $newFollowerList, PDO::PARAM_STR); + $updateQuery->bindValue(':userid', $Follow_userdata['userid'], PDO::PARAM_STR); + $res = $updateQuery->execute(); + + // 自分のfollowカラムを更新 + $updateQuery = $pdo->prepare("UPDATE account SET follow = CONCAT_WS(',', follow, :follow) WHERE userid = :userid"); + $updateQuery->bindValue(':follow', $Follow_userdata["userid"], PDO::PARAM_STR); + $updateQuery->bindValue(':userid', $userid, PDO::PARAM_STR); + $res_follow = $updateQuery->execute(); + + $datetime = date("Y-m-d H:i:s"); + $pdo->beginTransaction(); + + try { + $fromuserid = htmlentities($userid, ENT_QUOTES, 'UTF-8', false); + $touserid = htmlentities($Follow_userdata["userid"], ENT_QUOTES, 'UTF-8', false); + $datetime = htmlentities(date("Y-m-d H:i:s"), ENT_QUOTES, 'UTF-8', false); + $msg = htmlentities("".$userid."さんにフォローされました。", ENT_QUOTES, 'UTF-8', false); + $title = htmlentities("🎉".$userid."さんにフォローされました!🎉", ENT_QUOTES, 'UTF-8', false); + $url = htmlentities("/@" . $userid . "", ENT_QUOTES, 'UTF-8', false); + $userchk = htmlentities('none', ENT_QUOTES, 'UTF-8', false); + + // 通知用SQL作成 + $stmt = $pdo->prepare("INSERT INTO notification (fromuserid, touserid, msg, url, datetime, userchk, title) VALUES (:fromuserid, :touserid, :msg, :url, :datetime, :userchk, :title)"); + + $stmt->bindParam(':fromuserid', $fromuserid, PDO::PARAM_STR); + $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) { + //フォロー完了 + $response = array( + 'userid' => decode_yajirushi(htmlspecialchars_decode($Follow_userdata["userid"])), + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + } else { + $err = "db_error_".$e->getMessage(); + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + } + $stmt = null; + }else{ + $err = "already_been_completed"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + } + }else{ + $err = "you_cant_it_to_yourself"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + } + }else{ + $err = "critical_error_userdata_not_found"; + $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); + } + } + } +}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/users/index.php b/api/users/index.php new file mode 100644 index 0000000..634c617 --- /dev/null +++ b/api/users/index.php @@ -0,0 +1,243 @@ + 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; +} + +$pdo = null; +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(); +} + +$Get_Post_Json = file_get_contents("php://input"); +if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) { + + //トークン取得 + if(!(empty($_GET['token']))){ + $token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false); + }else{ + $post_json = json_decode($Get_Post_Json, true); + if(isset($post_json["token"])){ + $token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false); + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + if($token == ""){ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + if(!(empty($_GET['userid']))){ + $userid = $_GET['userid']; + }elseif(!(empty($post_json["userid"]))){ + $userid = $post_json["userid"]; + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + session_start(); + + if( !empty($pdo) ) { + $userQuery = $pdo->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{ + $DataQuery = $pdo->prepare("SELECT username,userid,profile,datetime,follow,follower,iconname,headname,role,sacinfo,admin FROM account WHERE userid = :userid"); + $DataQuery->bindValue(':userid', $userid); + $DataQuery->execute(); + $userdata = $DataQuery->fetch(); + + if (empty($userdata)){ + $response = array( + 'error_code' => "critical_error_userdata_not_found", + ); + }else{ + $roles = explode(',', $userdata["role"]); + if(!(empty($roles))){ + foreach ($roles as $roleId) { + $Getrole = $pdo->prepare("SELECT roleidname, rolename, roleauth, rolecolor, roleeffect FROM role WHERE roleidname = :role"); + $Getrole->bindValue(':role', $roleId); + $Getrole->execute(); + $roleData[$roleId] = $Getrole->fetch(); + + if($roleData[$roleId]['roleeffect'] == '' || $roleData[$roleId]['roleeffect'] == 'none'){ + $role_view_effect = "none"; + }elseif($roleData[$roleId]['roleeffect'] == 'shine'){ + $role_view_effect = "shine"; + }elseif($roleData[$roleId]['roleeffect'] == 'rainbow'){ + $role_view_effect = "rainbow"; + }else{ + $role_view_effect = "none"; + } + + $roleinfo = array( + "name" => decode_yajirushi(htmlspecialchars_decode($roleData[$roleId]['rolename'])), + "color" => decode_yajirushi(htmlspecialchars_decode($roleData[$roleId]['rolecolor'])), + "effect" => decode_yajirushi(htmlspecialchars_decode($role_view_effect)), + "id" => decode_yajirushi(htmlspecialchars_decode($roleData[$roleId]['roleidname'])), + ); + + $role[] = $roleinfo; + } + }else{ + $role[] = ""; + } + + if(!(empty($userdata["sacinfo"]))){ + if($userdata["sacinfo"] == "bot"){ + $isBot = true; + }else{ + $isBot = false; + } + }else{ + $isBot = false; + } + + if(!(empty($userdata["admin"]))){ + if($userdata["admin"] == "yes"){ + $isAdmin = true; + }else{ + $isAdmin = false; + } + }else{ + $isAdmin = false; + } + if(!(empty($userdata["follow"]))){ + $followee = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($userdata["follow"]))); + array_shift($followee); + }else{ + $followee = array(); + } + if(!(empty($userdata["follower"]))){ + $follower = preg_split("/,/", decode_yajirushi(htmlspecialchars_decode($userdata["follower"]))); + array_shift($follower); + }else{ + $follower = array(); + } + + $followcnts = explode(',', $userdata["follow"]); + $userdata["follow_cnt"] = (int)count($followcnts)-1; + + $followercnts = explode(',', $userdata["follower"]); + $userdata["follower_cnt"] = (int)count($followercnts)-1; + + $allueuse = $pdo->prepare("SELECT account FROM ueuse WHERE account = :userid"); + $allueuse->bindValue(':userid', $userdata["userid"]); + $allueuse->execute(); + $All_ueuse = $allueuse->rowCount(); + + $response = array( + 'username' => decode_yajirushi(htmlspecialchars_decode($userdata["username"])), + 'userid' => 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"])), + 'followee' => $followee, + 'followee_cnt' => $userdata["follow_cnt"], + 'follower' => $follower, + 'follower_cnt' => $userdata["follower_cnt"], + 'ueuse_cnt' => $All_ueuse, + 'isBot' => $isBot, + 'isAdmin' => $isAdmin, + 'role' => $role, + 'language' => "ja-JP", + ); + } + 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/users/unfollow.php b/api/users/unfollow.php new file mode 100644 index 0000000..cc50883 --- /dev/null +++ b/api/users/unfollow.php @@ -0,0 +1,228 @@ + 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; +} + +$pdo = null; +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(); +} + +$Get_Post_Json = file_get_contents("php://input"); +if(isset($_GET['token']) || (!(empty($Get_Post_Json)))) { + //トークン取得 + if(!(empty($_GET['token']))){ + $token = htmlentities($_GET['token'], ENT_QUOTES, 'UTF-8', false); + }else{ + $post_json = json_decode($Get_Post_Json, true); + if(isset($post_json["token"])){ + $token = htmlentities($post_json["token"], ENT_QUOTES, 'UTF-8', false); + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + } + if($token == ""){ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + session_start(); + + if( !empty($pdo) ) { + $userQuery = $pdo->prepare("SELECT username, userid, role, follow, follower 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{ + //本文取得 + if(!(empty($_GET['userid']))){ + $unfollow_userid = htmlentities($_GET['userid'], ENT_QUOTES, 'UTF-8', false); + }elseif(!(empty($post_json["userid"]))){ + $unfollow_userid = htmlentities($post_json["userid"], ENT_QUOTES, 'UTF-8', false); + } + + if(!(empty($unfollow_userid))){ + $DataQuery = $pdo->prepare("SELECT username,userid,follow,follower FROM account WHERE userid = :userid"); + $DataQuery->bindValue(':userid', $unfollow_userid); + $DataQuery->execute(); + $Follow_userdata = $DataQuery->fetch(); + + $userid = $userData["userid"]; + $myfollowlist = $userData["follow"]; + + if(!(empty($Follow_userdata))){ + if(!($userid == $Follow_userdata['userid'])){ + $followerList = explode(',', $Follow_userdata['follower']); + if (in_array($userid, $followerList)) { + // 自分が相手をフォローしている場合、相手のfollowerカラムと自分のfollowカラムを更新 + $followerList = array_diff($followerList, array($userid)); + $newFollowerList = implode(',', $followerList); + + // UPDATE文を実行してフォロー情報を更新 + $updateQuery = $pdo->prepare("UPDATE account SET follower = :follower WHERE userid = :userid"); + $updateQuery->bindValue(':follower', $newFollowerList, PDO::PARAM_STR); + $updateQuery->bindValue(':userid', $Follow_userdata['userid'], PDO::PARAM_STR); + $res = $updateQuery->execute(); + + $myflwlist = explode(',', $myfollowlist); + $delfollowList = array_diff($myflwlist, array($Follow_userdata['userid'])); + $deluserid = implode(',', $delfollowList); + + // 自分のfollowカラムから相手のユーザーIDを削除 + $updateQuery = $pdo->prepare("UPDATE account SET follow = :follow WHERE userid = :userid"); + $updateQuery->bindValue(':follow', $deluserid, PDO::PARAM_STR); + $updateQuery->bindValue(':userid', $userid, PDO::PARAM_STR); + $res_follow = $updateQuery->execute(); + + if ($res && $res_follow) { + $response = array( + 'userid' => decode_yajirushi(htmlspecialchars_decode($Follow_userdata["userid"])), + 'success' => true + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } else { + $err = "db_error_".$e->getMessage(); + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + $stmt = null; + }else{ + $err = "already_been_completed"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + }else{ + $err = "you_cant_it_to_yourself"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + }else{ + $err = "critical_error_userdata_not_found"; + $response = array( + 'error_code' => $err, + ); + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + }else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; + } + + } + } +}else{ + $err = "input_not_found"; + $response = array( + 'error_code' => $err, + ); + + echo json_encode($response, JSON_UNESCAPED_UNICODE); + exit; +} +?> \ No newline at end of file diff --git a/authcodechk.php b/authcodechk.php index 16c1989..a164c81 100644 --- a/authcodechk.php +++ b/authcodechk.php @@ -146,11 +146,11 @@ $pdo = null;
diff --git a/authlogin.php b/authlogin.php index c283b64..077f0b9 100644 --- a/authlogin.php +++ b/authlogin.php @@ -4,7 +4,9 @@ $serversettings_file = "server/serversettings.ini"; $serversettings = parse_ini_file($serversettings_file, true); require('db.php'); - +//関数呼び出し +//- ユーザーエージェントからdevice名とるやつ +require('function/function.php'); // 変数の初期化 $current_date = null; @@ -88,6 +90,9 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset } if( !empty($_POST['btn_submit']) ) { + $useragent = htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, 'UTF-8', false); + $device = UserAgent_to_Device($useragent); + $userbackupcode = $_POST['userbackupcode']; $options = array( @@ -118,7 +123,7 @@ if( !empty($_POST['btn_submit']) ) { try { $touserid = $userid; $datetime = date("Y-m-d H:i:s"); - $msg = "バックアップコードを使用しログインされました!\nバックアップコード変更のために二段階認証を再設定することを強くおすすめします。\nまた、もしバックアップコードを利用してログインした覚えがない場合は「その他」より全てのセッションを終了し、設定画面よりパスワードを変更し、二段階認証を再設定してください!"; + $msg = "バックアップコードを使用しログインされました!\nバックアップコード変更のために二段階認証を再設定することを強くおすすめします。\nまた、もしバックアップコードを利用してログインした覚えがない場合は「その他」よりセッショントークンを再生成し、設定画面よりパスワードを変更し、二段階認証を再設定してください!\n\nログインした端末 : ".$device; $title = '🔴バックアップコード使用のお知らせ🔴'; $url = '/settings'; $userchk = 'none'; @@ -146,6 +151,46 @@ if( !empty($_POST['btn_submit']) ) { $pdo->rollBack(); } + clearstatcache(); + + if (isset($_SERVER['HTTP_COOKIE'])) { + $cookies = explode(';', $_SERVER['HTTP_COOKIE']); + foreach($cookies as $cookie) { + $parts = explode('=', $cookie); + $name = trim($parts[0]); + setcookie($name, '', time()-1000); + } + } + + setcookie('userid', $userid,[ + 'expires' => time() + 60 * 60 * 24 * 14, + 'path' => '/', + 'samesite' => 'lax', + 'secure' => true, + 'httponly' => true, + ]); + setcookie('loginid', $row["loginid"],[ + 'expires' => time() + 60 * 60 * 24 * 14, + 'path' => '/', + 'samesite' => 'lax', + 'secure' => true, + 'httponly' => true, + ]); + setcookie('username', $row["username"],[ + 'expires' => time() + 60 * 60 * 24 * 14, + 'path' => '/', + 'samesite' => 'lax', + 'secure' => true, + 'httponly' => true, + ]); + setcookie('admin_login', true,[ + 'expires' => time() + 60 * 60 * 24 * 14, + 'path' => '/', + 'samesite' => 'lax', + 'secure' => true, + 'httponly' => true, + ]); + $_SESSION['admin_login'] = true; $_SESSION['userid'] = $userid; $_SESSION['loginid'] = $row["loginid"]; @@ -186,7 +231,7 @@ if( !empty($_POST['btn_submit']) ) { try { $touserid = $userid; $datetime = date("Y-m-d H:i:s"); - $msg = "アカウントにログインがありました。\nもしログインした覚えがない場合は「その他」よりセッションを終了し、パスワードを変更し、二段階認証を再設定してください。"; + $msg = "アカウントにログインがありました。\nもしログインした覚えがない場合は「その他」よりセッショントークンを再生成し、パスワードを変更し、二段階認証を再設定してください。\n\nログインした端末 : ".$device; $title = '🚪ログイン通知🚪'; $url = '/settings'; $userchk = 'none'; @@ -303,11 +348,11 @@ $pdo = null;
@@ -332,7 +377,7 @@ $pdo = null;

バックアップコード

-
もし二段階認証が出来ない場合は8桁英数字のバックアップコードを入力してください。
+
もし二段階認証が出来ない場合は32桁英数字のバックアップコードを入力してください。
diff --git a/check.php b/check.php index b64a233..d2ecc59 100644 --- a/check.php +++ b/check.php @@ -4,7 +4,9 @@ $serversettings_file = "server/serversettings.ini"; $serversettings = parse_ini_file($serversettings_file, true); require('db.php'); - +//関数呼び出し +//- ユーザーエージェントからdevice名とるやつ +require('function/function.php'); // 変数の初期化 $current_date = null; @@ -137,12 +139,14 @@ if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true && isset } if( !empty($_POST['btn_submit']) ) { + $useragent = htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, 'UTF-8', false); + $device = UserAgent_to_Device($useragent); $pdo->beginTransaction(); try { $touserid = $userid; $datetime = date("Y-m-d H:i:s"); - $msg = "アカウントにログインがありました。\nもしログインした覚えがない場合は「その他」よりセッションを終了し、パスワードを変更してください。"; + $msg = "アカウントにログインがありました。\nもしログインした覚えがない場合は「その他」よりセッショントークンを再生成し、パスワードを変更してください。\n\nログインした端末 : ".$device; $title = '🚪ログイン通知🚪'; $url = '/settings'; $userchk = 'none'; @@ -239,34 +243,6 @@ if( !empty($_POST['btn_submit2']) ) { // すべての出力を終了 exit; } - - - -// プロフィールの絵文字対応 -function replaceProfileEmojiImages($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; -} // データベースの接続を閉じる $pdo = null; @@ -291,11 +267,11 @@ $pdo = null;
diff --git a/css/color.css b/css/color.css index 8532c3c..8be0755 100644 --- a/css/color.css +++ b/css/color.css @@ -1,4 +1,5 @@ :root { + /*Maincolor*/ --main-color: #FFC832; --sub-color: #FFFAE6; --background-color: #F5F5F5; @@ -13,4 +14,10 @@ --dark-background-color: #0c0c0c; --dark-subtext-color: #CCC; --dark-text-color: #FFF; + /*HeadingFonts*/ + --Head-fonts: "Zen Maru Gothic"; + /*TextFonts*/ + --Text-fonts: "BIZ UDPGothic"; + /*MonospacedFonts*/ + --Mono-fonts: "BIZ UDGothic"; } \ No newline at end of file diff --git a/css/font.css b/css/font.css new file mode 100644 index 0000000..a0bbc4d --- /dev/null +++ b/css/font.css @@ -0,0 +1,17 @@ +/*GoogleFontsから使用*/ +@import url('https://fonts.googleapis.com/css2?family=BIZ+UDGothic:wght@400;700&family=BIZ+UDPGothic:wght@400;700&family=Zen+Maru+Gothic:wght@500&display=swap') + +/* +ローカルから独自フォントを読み込む際はこれを使用 +color.cssの方のフォント変数にも同じ名前を書いて~ +@font-face { + font-family: 'HeadingFont'; + src: url(/Fonts/HeadingFont.woff); + + font-family: 'TextFont'; + src: url(/Fonts/TextFont.woff); + + font-family: 'MonospacedFont'; + src: url(/Fonts/MOnospacedtFont.woff); +} +*/ \ No newline at end of file diff --git a/css/home.css b/css/home.css index 3b7249b..94c3bca 100644 --- a/css/home.css +++ b/css/home.css @@ -1,4 +1,4 @@ -@import url('https://fonts.googleapis.com/css2?family=BIZ+UDPGothic:wght@400;700&family=Josefin+Sans:ital,wght@1,700&family=Kosugi+Maru&family=Zen+Maru+Gothic:wght@500&display=swap'); +@import url("font.css"); @import url("color.css"); ::-webkit-scrollbar{ @@ -58,7 +58,7 @@ body{ border-radius: 50px; color:var(--background-color); font-size: 22px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -91,7 +91,7 @@ body{ border-radius: 50px; color:var(--main-color); font-size: 22px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15); @@ -109,13 +109,13 @@ body{ .inbox { margin-top: 4px; margin-bottom: 4px; - width: 96%; + width: calc(100% - 24px); padding: 8px 10px; border-radius: 10px; background: var(--background-color); - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; color: rgb(32,32,32); - font-size: 1em; + font-size: 16px; line-height: 1.5; white-space: nowrap; box-shadow:0px 0px 25px rgba(0,0,0,0.03); @@ -156,7 +156,7 @@ textarea{ margin: 12px; text-align: left; color:#ff4848; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; word-wrap: break-word; line-height: 20px; border: 1px solid #FF4848; @@ -183,7 +183,7 @@ textarea{ border-radius: 50px; color:var(--background-color); font-size: 26px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15); @@ -217,7 +217,7 @@ textarea{ border-radius: 50px; color:var(--main-color); font-size: 26px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15); @@ -248,7 +248,7 @@ textarea{ .rolebox p { margin: 2px 10px 2px 10px; font-size: 16px; - font-family: "Zen Maru Gothic", sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; } @@ -372,7 +372,7 @@ textarea{ } .userleftbox h1{ - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; margin-left: 20px; color:var(--background-color); font-size: 32px; @@ -392,7 +392,7 @@ textarea{ } .userleftbox .logo p{ color:var(--main-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 32px; margin-left: 8px; @@ -420,12 +420,11 @@ textarea{ border-radius: 50px; color:var(--main-color); font-size: 20px; - font-family: 'Zen Maru Gothic', sans-serif; - font-weight: normal; + font-family: var(--Head-fonts), sans-serif; + font-weight: bold; text-decoration:none; text-align: left; - transition: box-shadow 250ms ease-in-out; - transition: width 250ms ease-out; + align-items: center; transition: all 250ms ease-out; } .leftbutton_on:hover{ @@ -460,12 +459,11 @@ textarea{ border-radius: 50px; color:var(--main-color); font-size: 20px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: left; - transition: box-shadow 250ms ease-in-out; - transition: width 250ms ease-out; + align-items: center; transition: all 250ms ease-out; } .leftbutton:hover{ @@ -499,7 +497,7 @@ textarea{ margin-right: auto; color:#FFF; font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -557,7 +555,7 @@ main{ main h1{ color:var(--text-color); font-size: 32px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; } .userheader{ @@ -615,7 +613,7 @@ main h1{ margin-bottom: 12px; color:var(--text-color); font-size: 32px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: 900; } @@ -627,7 +625,7 @@ main h1{ margin-bottom: 14px; color: var(--subtext-color); font-size: 18px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: 900; } @@ -639,7 +637,7 @@ main h1{ margin-bottom: 14px; color: var(--dark-subtext-color); font-size: 18px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: 900; } @@ -653,7 +651,7 @@ main h1{ font-size: 18px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } .userheader .profile p img{ @@ -671,7 +669,7 @@ main h1{ font-size: 16px; color:var(--link-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -704,7 +702,7 @@ main h1{ margin-right: 10px; font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; } @@ -717,7 +715,7 @@ main h1{ font-size: 16px; color:var(--main-color); text-decoration: none; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: bold; } @@ -755,7 +753,7 @@ main h1{ border-radius: 50px; color:var(--sub-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -797,7 +795,7 @@ main h1{ color:var(--main-color); border: 1px solid var(--main-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -838,7 +836,7 @@ main h1{ color:var(--main-color); border: 1px solid var(--main-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -878,7 +876,7 @@ main h1{ color:var(--main-color); border: 1px solid var(--main-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -920,7 +918,7 @@ main h1{ text-align: left; font-size: 12px; color:var(--subtext-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } .fzone .time a{ @@ -929,7 +927,7 @@ main h1{ text-align: left; font-size: 12px; color:var(--subtext-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } .fzone .follow_yes{ @@ -983,7 +981,7 @@ main h1{ background: var(--tl-color); color: var(--dark-subtext-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; display: inline-block; @@ -1076,7 +1074,7 @@ main h1{ font-size: 18px; color: var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -1111,7 +1109,7 @@ main h1{ font-size: 12px; color:var(--subtext-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } .ueuse .flebox .bot{ @@ -1122,7 +1120,7 @@ main h1{ border-radius: 10px; background-color: var(--sub-color); border: 1px solid var(--border-color); - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: bold; text-align: center; font-size: 12px; @@ -1137,7 +1135,7 @@ main h1{ font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } .ueuse .inline{ @@ -1153,7 +1151,7 @@ main h1{ border-radius: 5px; font-size: calc(100% - 2px); text-decoration: none; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: bold; vertical-align: top; } @@ -1170,7 +1168,7 @@ main h1{ padding-bottom: 4px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } @@ -1207,7 +1205,7 @@ main h1{ border-radius: 25px; font-size: calc(100% - 2px); text-decoration: none; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: bold; vertical-align: top; } @@ -1220,7 +1218,7 @@ main h1{ font-size: 48px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -1232,7 +1230,7 @@ main h1{ font-size: 32px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -1244,7 +1242,7 @@ main h1{ font-size: 24px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -1255,7 +1253,7 @@ main h1{ margin-left: auto; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -1271,7 +1269,7 @@ main h1{ font-size: 14px; color:var(--main-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; transition: all 250ms ease-out; } @@ -1296,7 +1294,7 @@ main h1{ font-size: 16px; color:var(--link-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .ueuse p img{ @@ -1352,7 +1350,7 @@ main h1{ text-align: right; font-size: 12px; color:var(--subtext-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } .ueuse .photo1 a{ width: 48%; @@ -1501,7 +1499,7 @@ main h1{ font-size: 14px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } @@ -1521,7 +1519,7 @@ main h1{ font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .ueuse .abi .back h1 img{ @@ -1541,7 +1539,7 @@ main h1{ font-size: 42px; color: var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .ueuse .abi h2{ @@ -1552,7 +1550,7 @@ main h1{ font-size: 32px; color: var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .ueuse .abi h3{ @@ -1563,7 +1561,7 @@ main h1{ font-size: 24px; color: var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .ueuse .abi .h3s{ @@ -1574,7 +1572,7 @@ main h1{ font-size: 12px; color:var(--subtext-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .ueuse .favbox{ @@ -1606,7 +1604,7 @@ main h1{ border-radius: 50px; color:var(--main-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -1637,7 +1635,7 @@ main h1{ border-radius: 50px; color:var(--sub-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -1684,7 +1682,7 @@ main h1{ border-radius: 50px; color:var(--main-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -1710,7 +1708,7 @@ main h1{ border-radius: 50px; color:var(--sub-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -1743,7 +1741,7 @@ main h1{ border-radius: 50px; color:#FF4848; font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -1773,7 +1771,7 @@ main h1{ border-radius: 50px; color: var(--background-color);; font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -1808,7 +1806,7 @@ main h1{ border-radius: 50px; color:var(--main-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -1839,7 +1837,7 @@ main h1{ border-radius: 50px; color: var(--sub-color);; font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -1880,7 +1878,7 @@ main h1{ border-radius: 50px; color:var(--main-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -1910,7 +1908,7 @@ main h1{ border-radius: 50px; color: var(--sub-color);; font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -1952,7 +1950,7 @@ main h1{ border-radius: 50px; color:var(--main-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -1982,7 +1980,7 @@ main h1{ border-radius: 50px; color: var(--sub-color);; font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -2026,7 +2024,7 @@ main h1{ font-size: 16px; color:var(--main-color); text-decoration: none; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: normal; } .ueuse .nsfw{ @@ -2078,7 +2076,7 @@ main h1{ font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .ueuse .headbox a{ @@ -2118,7 +2116,7 @@ main h1{ font-size: 22px; color: var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .ueuse .flebox .user .idbox{ @@ -2138,7 +2136,7 @@ main h1{ font-size: 12px; color:var(--subtext-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } .ueuse .flebox .user .bot{ margin-top: auto; @@ -2148,7 +2146,7 @@ main h1{ border-radius: 10px; background-color: var(--sub-color); border: 1px solid var(--border-color); - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: bold; text-align: center; font-size: 12px; @@ -2173,7 +2171,7 @@ main h1{ font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -2211,7 +2209,7 @@ main h1{ font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -2227,7 +2225,7 @@ main h1{ border: none; resize: none; font-size: 18px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } @@ -2260,7 +2258,7 @@ main h1{ border-radius: 50px; color:var(--sub-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -2298,7 +2296,7 @@ main h1{ font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -2355,7 +2353,7 @@ main h1{ font-size: 16px; color: var(--main-color); text-decoration: none; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: normal; } .sendbox .fxbox .red{ @@ -2386,7 +2384,7 @@ main h1{ line-height: 20px; color: var(--subtext-color); font-size: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } .sendbox .emoji_picker .emoji_picker_flex{ @@ -2416,7 +2414,7 @@ main h1{ font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @keyframes Up_to_down_slideY { @@ -2450,7 +2448,7 @@ main h1{ border-radius: 50px; color:var(--sub-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -2505,7 +2503,7 @@ main h1{ font-size: 26px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -2526,7 +2524,7 @@ main h1{ font-size: 16px; color:var(--subtext-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } .ueuse2 p{ @@ -2537,7 +2535,7 @@ main h1{ font-size: 22px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .ueuse2 a{ @@ -2547,7 +2545,7 @@ main h1{ font-size: 16px; color:var(--link-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .ueuse2 p img{ @@ -2567,7 +2565,7 @@ main h1{ text-align: right; font-size: 12px; color:var(--subtext-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } .ueuse2 .photo1 img{ @@ -2627,8 +2625,8 @@ main h1{ font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; - font-weight: bold; + font-family: var(--Text-fonts), sans-serif; + font-weight: normal; } .formarea li{ line-height: 20px; @@ -2638,7 +2636,7 @@ main h1{ font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -2692,7 +2690,7 @@ main h1{ line-height: 20px; color: var(--subtext-color); font-size: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } @@ -2703,7 +2701,7 @@ main h1{ line-height: 20px; color: var(--subtext-color); font-size: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } @@ -2728,7 +2726,7 @@ label>input { border-radius: 50px; color:var(--sub-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -2766,7 +2764,7 @@ label>input { border-radius: 50px; color:var(--sub-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -2834,8 +2832,8 @@ label>input { font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; - font-weight: bold; + font-family: var(--Text-fonts), sans-serif; + font-weight: normal; } .modal-content p img{ margin-top: 0px; @@ -2852,7 +2850,7 @@ label>input { font-size: 24px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .modal-content h1 img{ @@ -2880,7 +2878,7 @@ label>input { width:120px; padding: 8px auto; - margin-left: 6px; + margin-left: auto; margin-right: 6px; margin-bottom: 0px; @@ -2893,7 +2891,7 @@ label>input { border-radius: 50px; color:var(--sub-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -2919,7 +2917,7 @@ label>input { width:120px; padding: 8px auto; - margin-left: 6px; + margin-left: auto; margin-right: 6px; margin-bottom: 0px; @@ -2933,7 +2931,7 @@ label>input { color:var(--main-color); border: 1px solid var(--main-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -2982,7 +2980,7 @@ label>input { font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .modal-content .action_userlist .userabout .username a img{ @@ -3001,7 +2999,7 @@ label>input { font-size: 14px; color:var(--subtext-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -3089,7 +3087,7 @@ label>input { background-color: var(--main-color); box-shadow: 0px 0px 30px rgba(0,0,0,0.1); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 2em; text-align: left; @@ -3116,7 +3114,7 @@ label>input { .terms h1{ line-height:32px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 48px; text-align: left; @@ -3125,7 +3123,7 @@ label>input { .terms h2{ line-height:32px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 48px; text-align: left; @@ -3134,7 +3132,7 @@ label>input { .terms h3{ line-height:28px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 32px; text-align: left; @@ -3143,7 +3141,7 @@ label>input { .terms h4{ line-height:24px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 24px; text-align: left; @@ -3154,7 +3152,7 @@ label>input { margin-top: 2px; margin-bottom: 2px; line-height:24px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; font-size: 16px; text-align: left; @@ -3185,7 +3183,7 @@ label>input { line-height:24px; margin-right: 12px; margin-left: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; font-size: 16px; text-align: left; @@ -3214,7 +3212,7 @@ label>input { margin-right: auto; color: #00b96c; font-size: 14px; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: normal; vertical-align:middle; align-items: center; @@ -3238,7 +3236,7 @@ label>input { margin-right: auto; color: #e6890f; font-size: 14px; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: normal; vertical-align:middle; align-items: center; @@ -3262,7 +3260,7 @@ label>input { margin-right: auto; color: #1d9bf0; font-size: 14px; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: normal; vertical-align:middle; align-items: center; @@ -3286,7 +3284,7 @@ label>input { margin-right: auto; color: #FF4848; font-size: 14px; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: normal; vertical-align:middle; align-items: center; @@ -3304,7 +3302,7 @@ label>input { line-height: 20px; color: var(--subtext-color); font-size: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } .terms .p3{ @@ -3314,7 +3312,7 @@ label>input { line-height: 24px; color: var(--text-color); font-size: 22px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -3326,7 +3324,7 @@ label>input { line-height: 20px; color: var(--subtext-color); font-size: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } .terms .sp3{ @@ -3336,14 +3334,14 @@ label>input { line-height: 24px; color: var(--text-color); font-size: 22px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .terms ul{ margin-top: 6px; margin-bottom: 6px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; line-height: 20px; } @@ -3361,7 +3359,7 @@ label>input { .terms .err404 h1{ margin-top: 64px; line-height:64px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 64px; text-align: center; @@ -3372,7 +3370,7 @@ label>input { margin-top: 2px; margin-bottom: 2px; line-height:32px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; font-size: 16px; text-align: center; @@ -3398,7 +3396,7 @@ label>input { margin-top: 12px; margin-bottom: 0px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 28px; text-align: left; @@ -3407,7 +3405,8 @@ label>input { .rightbox .noticearea{ width: auto; - height: 50dvh; + height: fit-content; + max-height: 50dvh; overflow: scroll; border-radius: 10px; } @@ -3429,7 +3428,7 @@ label>input { .rightbox .noticebox h4{ margin-top: 2px; margin-bottom: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 20px; text-align: left; @@ -3440,7 +3439,7 @@ label>input { line-height: 20px; margin-top: 2px; margin-bottom: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; font-size: 16px; text-align: left; @@ -3453,7 +3452,7 @@ label>input { font-size: 16px; color:var(--link-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -3470,7 +3469,7 @@ label>input { line-height: 20px; margin-top: 2px; margin-bottom: 2px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; font-size: 16px; text-align: left; @@ -3484,7 +3483,7 @@ label>input { font-size: 16px; color:var(--link-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -3500,22 +3499,24 @@ label>input { text-align: left; font-size: 12px; color:var(--subtext-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } .rightbox .btmbox{ position: absolute; - bottom: 36px; /*下に固定*/ - height: 320px; + bottom: 6px; /*下に固定*/ + height: fit-content; + max-width: 45dvh; width: 90%; + overflow: scroll; } .rightbox .btmbox h2{ margin-top: 12px; margin-bottom: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 20px; text-align: left; @@ -3525,7 +3526,7 @@ label>input { .rightbox .btmbox h3{ margin-top: 2px; margin-bottom: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; font-size: 20px; text-align: left; @@ -3537,7 +3538,7 @@ label>input { line-height: 20px; margin-top: 2px; margin-bottom: 2px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; font-size: 14px; text-align: left; @@ -3552,7 +3553,7 @@ label>input { font-size: 14px; color:var(--link-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -3606,7 +3607,7 @@ label>input { border-radius: 50px; color:var(--main-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -3652,7 +3653,7 @@ label>input { } .emjtex{ width: calc(50% - 32px); - background-color: var(--background-color); + background-color: var(--ueuse-color); margin-top: 0px; margin-left: 0px; margin-right: 0px; @@ -3696,7 +3697,7 @@ label>input { font-size: 24px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: bold; } @@ -3708,7 +3709,7 @@ label>input { font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -3720,7 +3721,7 @@ label>input { font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -3762,7 +3763,7 @@ label>input { font-size: 18px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .notification .flebox .icon img{ @@ -3786,7 +3787,7 @@ label>input { color:var(--subtext-color); font-size: 14px; text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } .notification .flebox .username img{ @@ -3812,21 +3813,9 @@ label>input { font-size: 12px; color:var(--subtext-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } -.notification p{ - line-height: 20px; - overflow-wrap: break-word; - margin-top: auto; - margin-bottom: auto; - margin-left: 12px; - font-size: 16px; - color:var(--text-color); - text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; - font-weight: bold; -} .notification p{ line-height:20px; overflow-wrap: break-word; @@ -3836,7 +3825,7 @@ label>input { font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } .notification .inline{ @@ -3852,7 +3841,7 @@ label>input { border-radius: 5px; font-size: calc(100% - 2px); text-decoration: none; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: bold; vertical-align: top; } @@ -3869,7 +3858,7 @@ label>input { padding-bottom: 4px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } @@ -3900,7 +3889,7 @@ label>input { font-size: 48px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -3912,7 +3901,7 @@ label>input { font-size: 32px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -3924,7 +3913,7 @@ label>input { font-size: 24px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -3935,7 +3924,7 @@ label>input { margin-left: auto; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -3951,7 +3940,7 @@ label>input { font-size: 14px; color:var(--main-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; transition: all 250ms ease-out; } @@ -3977,7 +3966,7 @@ label>input { font-size: 16px; color:var(--link-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .notification p img{ @@ -4026,7 +4015,7 @@ label>input { text-align: right; font-size: 12px; color:var(--subtext-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } .notification a{ @@ -4037,7 +4026,7 @@ label>input { font-size: 16px; color:var(--link-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } hr{ @@ -4069,7 +4058,7 @@ hr{ border-radius: 50px; color:var(--sub-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -4145,7 +4134,7 @@ hr{ padding-left: 0px; padding-right: 0px; color:var(--background-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } @keyframes slideDown { 0%, 100% { transform: translateY(-64px); } @@ -4232,7 +4221,7 @@ hr{ font-size: 24px; color:var(--dark-subtext-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .tlchange .on{ @@ -4246,7 +4235,7 @@ hr{ font-size: 24px; color:var(--main-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; border-bottom: 1px solid var(--main-color); } @@ -4265,7 +4254,7 @@ hr{ padding-top: 8px; padding-bottom: 8px; color:#F5F4F0; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .hny .textmain{ @@ -4279,7 +4268,7 @@ hr{ background-color: #dcae64; text-align: left; color:#FCFAF2; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; word-wrap: break-word; font-size: 32px; line-height: 32px; @@ -4289,7 +4278,7 @@ hr{ .hny .textmain p{ text-align: left; color:#252525; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; word-wrap: break-word; font-size: 16px; line-height: 22px; @@ -4298,7 +4287,7 @@ hr{ .hny .textmain .rp{ text-align: right; color:#252525; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; word-wrap: break-word; font-size: 14px; line-height: 22px; @@ -4373,7 +4362,7 @@ input[type=radio] { box-sizing: border-box; color:var(--dark-text-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; word-wrap: break-word; font-size: 16px; line-height: 22px; @@ -4437,7 +4426,7 @@ summary { margin-bottom: 0px; text-align: left; color:var(--text-color); - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; word-wrap: break-word; font-size: 18px; line-height: 22px; @@ -4470,7 +4459,7 @@ summary { margin-bottom: 4px; text-align: left; color:var(--text-color); - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; word-wrap: break-word; font-size: 14px; line-height: 22px; @@ -4486,7 +4475,7 @@ summary { margin-bottom: auto; text-align: left; color:var(--text-color); - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; word-wrap: break-word; font-size: 14px; line-height: 22px; @@ -4508,7 +4497,7 @@ summary { border-radius: 50px; color:#FF4848; font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -4536,7 +4525,7 @@ summary { border-radius: 50px; color: var(--main-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -4584,7 +4573,7 @@ summary { border-radius: 50px; color:var(--main-color); font-size: 18px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: left; @@ -4631,7 +4620,7 @@ summary { margin-bottom: auto; color:var(--text-color); font-size: 32px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: 900; } .admin_userinfo .icon .tatext p{ @@ -4642,7 +4631,7 @@ summary { margin-bottom: 14px; color: var(--subtext-color); font-size: 18px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: 900; } @@ -4656,7 +4645,7 @@ summary { font-size: 18px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .admin_userinfo .roleboxes{ @@ -4686,7 +4675,7 @@ summary { margin-left: 10px; margin-right: 10px; font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; } .admin_userinfo .about{ @@ -4699,7 +4688,7 @@ summary { line-height: 20px; color:var(--subtext-color); font-size: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } .admin_userinfo .about p{ @@ -4710,7 +4699,7 @@ summary { margin-bottom: 14px; color: var(--text-color); font-size: 18px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: 900; } .admin_userinfo .banzone{ @@ -4735,7 +4724,7 @@ summary { border-radius: 50px; color:var(--background-color); font-size: 22px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -4770,7 +4759,7 @@ summary { border-radius: 50px; color:var(--main-color); font-size: 22px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -4805,7 +4794,7 @@ summary { border-radius: 50px; color:var(--background-color); font-size: 22px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -4844,13 +4833,13 @@ summary { background-color: var(--main-color); color: var(--background-color); font-size: 22px; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: bold; } .error p{ color: var(--text-color); font-size: 18px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: 900; } @@ -4881,13 +4870,13 @@ summary { .overview p{ color: var(--text-color); font-size: 32px; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: bold; } .overview .p2{ color: var(--subtext-color); font-size: 12px; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: normal; } .servericon{ @@ -4963,7 +4952,7 @@ summary { font-size: 20px; color: var(--main-color); text-decoration: none; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: normal; text-align: center; } @@ -4994,7 +4983,7 @@ summary { margin-left: 12px; margin-right: 12px; line-height: 24px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-size: 16px; color:var(--tl-color); color: transparent; @@ -5027,7 +5016,7 @@ summary { margin-left: 12px; margin-right: 12px; line-height: 24px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-size: 16px; color:var(--tl-color); color: transparent; @@ -5057,7 +5046,7 @@ summary { margin-left: 12px; margin-right: 12px; line-height: 24px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-size: 16px; color:var(--tl-color); color: transparent; @@ -5122,13 +5111,13 @@ noscript .noscript_modal .inner{ } noscript .noscript_modal .inner .oops_icon{ margin-top: -32px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-size: 74px; text-align: center; } noscript .noscript_modal .inner h1{ line-height: 32px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-size: 32px; color:var(--text-color); text-align: center; @@ -5136,7 +5125,7 @@ noscript .noscript_modal .inner h1{ } noscript .noscript_modal .inner p{ line-height: 20px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-size: 16px; color:var(--text-color); text-align: center; @@ -5157,7 +5146,7 @@ noscript .noscript_modal .inner .infobtn{ color:#ffffff; border-radius: 32px; font-size: 20px; - font-family: 'BIZ UDGothic', 'Yu Mincho Regular', 'ヒラギノ角ゴシック', sans-serif; + font-family: var(--Mono-fonts), 'Yu Mincho Regular', 'ヒラギノ角ゴシック', sans-serif; font-weight: normal; text-decoration: none; } @@ -5171,10 +5160,165 @@ noscript .noscript_modal .inner .center_text p{ text-align: center; color:#777; font-size: 14px; - font-family: 'BIZ UDGothic', 'Yu Mincho Regular', 'ヒラギノ角ゴシック', sans-serif; + font-family: var(--Mono-fonts), 'Yu Mincho Regular', 'ヒラギノ角ゴシック', sans-serif; font-weight: normal; } +.special:hover span{ + display:inline-block; + vertical-align: top; + animation: cycling 500ms; +} +@keyframes cycling { + from { + animation-timing-function: ease-in-out; + transform: scale(1.0, 1.0) translate(0%, 0%) rotate(0deg) skew(0deg, 0deg); + opacity: 1; + } + 50%{ + animation-timing-function: ease-in-out; + transform: scale(1.5, 1.5) translate(0%, 0%) rotate(-15deg) skew(0deg, 0deg); + opacity: 1; + } + to { + animation-timing-function: ease-out; + transform: scale(1.0, 1.0) translate(0%, 0%) rotate(0deg) skew(0deg, 0deg); + opacity: 1; + } +} + +.tutorial_background{ + 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; +} +.tutorial_background .tutorial_modal{ + padding: 0px; + border-radius: 15px; + width: 720px; + height: 640px; + 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; +} +.tutorial_background .tutorial_modal .tutorial{ + margin: 64px; + height: calc(100% - 128px); + width: calc(100% - 128px); +} +.tutorial_background .tutorial_modal .tutorial .page{ + position: relative; + transition: all 250ms ease-out; + animation: slideInX 0.5s cubic-bezier(0.25, 1, 0.5, 1) 1 forwards; + height: 100%; + width: 100%; +} +.tutorial_background .tutorial_modal .tutorial .page h1{ + line-height: 32px; + font-family: var(--Text-fonts), sans-serif; + font-size: 32px; + color:var(--text-color); + text-align: center; + font-weight: bold; +} +.tutorial_background .tutorial_modal .tutorial .page h2{ + line-height: 28px; + font-family: var(--Text-fonts), sans-serif; + font-size: 24px; + color:var(--text-color); + text-align: left; + font-weight: bold; +} +.tutorial_background .tutorial_modal .tutorial .page p{ + line-height: 20px; + font-family: var(--Text-fonts), sans-serif; + font-size: 16px; + color:var(--text-color); + text-align: left; +} +.tutorial_background .tutorial_modal .tutorial .page img{ + margin-left: auto; + margin-right: auto; + text-align: center; + max-width: 100%; + object-fit: contain; + border-radius: 10px; +} +.tutorial_background .tutorial_modal .tutorial .page .btm_area{ + width: 100%; + position: absolute; + bottom: 0px; + display: flex; + justify-content:flex-end; + margin:auto 0px 0px 0px; +} +.tutorial_background .tutorial_modal .tutorial .page .btm_area .iro_btn{ + cursor: pointer; + border: none; + display: block; + width:20%; + padding: 4px 4px; + margin-left: 12px; + margin-right: 0px; + background-color: var(--main-color); + border-radius: 50px; + color:var(--sub-color); + font-size: 18px; + font-family: var(--Head-fonts), sans-serif; + font-weight: normal; + text-decoration:none; + text-align: center; + transition: all 250ms ease-out; +} +.tutorial_background .tutorial_modal .tutorial .page .btm_area .iro_btn:hover{ + background-color: var(--main-color); + color: var(--sub-color); + box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2); + width:21%; +} +.tutorial_background .tutorial_modal .tutorial .page .btm_area .iro_btn:active{ + box-shadow:0 0px 48px 0 rgba(0, 0, 0, .0); + width:19%; +} +.tutorial_background .tutorial_modal .tutorial .page .btm_area .backcolor{ + background-color: #CCC; + color: #FFF; +} +.tutorial_background .tutorial_modal .tutorial .page .btm_area .backcolor:hover{ + background-color: #CCC; + color: #FFF; +} +.clear{ + opacity: 0; +} + +@keyframes slideInX { + 0% { + transform: translateX(24px); + opacity: 0; + } + 100% { + transform: translateX(0px); + } + 40%,100% { + opacity: 1; + } +} /*------------------------------------------------------------------------------------------------------------*/ /*--------------------------------------------------スマホ向け--------------------------------------------------*/ /*--------------------------------------------------ここから--------------------------------------------------*/ @@ -5277,7 +5421,7 @@ noscript .noscript_modal .inner .center_text p{ text-align: left; font-size: 12px; color:var(--subtext-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } .sp_time_area .time a{ margin-top: 0px; @@ -5285,7 +5429,7 @@ noscript .noscript_modal .inner .center_text p{ text-align: left; font-size: 12px; color:var(--subtext-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } main{ @@ -5306,7 +5450,7 @@ noscript .noscript_modal .inner .center_text p{ main h1{ color:var(--text-color); font-size: 32px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; } .fzone .follow_yes p{ @@ -5340,7 +5484,7 @@ noscript .noscript_modal .inner .center_text p{ font-size: 14px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -5360,8 +5504,8 @@ noscript .noscript_modal .inner .center_text p{ height: 24px; padding: 6px 6px; - margin-left: 6px; - margin-right: 6px; + margin-left: 0px; + margin-right: 12px; padding-top: 6px; padding-bottom: 6px; @@ -5382,7 +5526,7 @@ noscript .noscript_modal .inner .center_text p{ font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .sendbox .emoji_picker .emoji_picker_flex{ @@ -5448,7 +5592,7 @@ noscript .noscript_modal .inner .center_text p{ border-radius: 0px; color:var(--main-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -5640,7 +5784,7 @@ noscript .noscript_modal .inner .center_text p{ font-size: 18px; color: var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -5652,7 +5796,7 @@ noscript .noscript_modal .inner .center_text p{ text-align: right; font-size: 12px; color:var(--subtext-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } .ueuse .headbox{ @@ -5689,7 +5833,7 @@ noscript .noscript_modal .inner .center_text p{ padding: 3px 8px; margin-left: 6px; border-radius: 10px; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: bold; text-align: center; font-size: 12px; @@ -5712,7 +5856,7 @@ noscript .noscript_modal .inner .center_text p{ } .leftbox h1{ - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; margin-left: 20px; color:var(--background-color); font-size: 32px; @@ -5732,7 +5876,7 @@ noscript .noscript_modal .inner .center_text p{ } .leftbox .logo p{ color:var(--main-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 32px; margin-left: 8px; @@ -5773,7 +5917,7 @@ noscript .noscript_modal .inner .center_text p{ border-radius: 50px; color:var(--sub-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -5827,7 +5971,7 @@ noscript .noscript_modal .inner .center_text p{ .terms h1{ line-height:52px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 48px; text-align: left; @@ -5836,7 +5980,7 @@ noscript .noscript_modal .inner .center_text p{ .terms h2{ line-height:52px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 48px; text-align: left; @@ -5845,7 +5989,7 @@ noscript .noscript_modal .inner .center_text p{ .terms h3{ line-height:36px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 32px; text-align: left; @@ -5854,7 +5998,7 @@ noscript .noscript_modal .inner .center_text p{ .terms h4{ line-height:24px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 24px; text-align: left; @@ -5865,7 +6009,7 @@ noscript .noscript_modal .inner .center_text p{ margin-top: 2px; margin-bottom: 2px; line-height:24px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; font-size: 16px; text-align: left; @@ -5894,7 +6038,7 @@ noscript .noscript_modal .inner .center_text p{ line-height:24px; margin-right: 12px; margin-left: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; font-size: 16px; text-align: left; @@ -5910,7 +6054,7 @@ noscript .noscript_modal .inner .center_text p{ line-height: 20px; color: var(--subtext-color); font-size: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } @@ -5921,14 +6065,14 @@ noscript .noscript_modal .inner .center_text p{ line-height: 24px; color: var(--text-color); font-size: 22px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .terms .err404 h1{ margin-top: 128px; line-height:64px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 64px; text-align: center; @@ -5941,7 +6085,7 @@ noscript .noscript_modal .inner .center_text p{ padding: 3px 8px; margin-left: 6px; border-radius: 10px; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: bold; text-align: center; font-size: 12px; @@ -6023,7 +6167,7 @@ noscript .noscript_modal .inner .center_text p{ font-size: 18px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -6044,7 +6188,7 @@ noscript .noscript_modal .inner .center_text p{ font-size: 12px; color:var(--subtext-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } .notification p{ @@ -6056,7 +6200,7 @@ noscript .noscript_modal .inner .center_text p{ font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -6068,7 +6212,7 @@ noscript .noscript_modal .inner .center_text p{ font-size: 18px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -6081,7 +6225,7 @@ noscript .noscript_modal .inner .center_text p{ text-align: right; font-size: 12px; color:var(--subtext-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } .notification a{ @@ -6092,7 +6236,7 @@ noscript .noscript_modal .inner .center_text p{ font-size: 16px; color:var(--link-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -6103,7 +6247,7 @@ noscript .noscript_modal .inner .center_text p{ font-size: 18px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -6124,7 +6268,7 @@ noscript .noscript_modal .inner .center_text p{ font-size: 12px; color:var(--subtext-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } .notification2 p{ @@ -6136,7 +6280,7 @@ noscript .noscript_modal .inner .center_text p{ font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -6148,7 +6292,7 @@ noscript .noscript_modal .inner .center_text p{ font-size: 18px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -6161,7 +6305,7 @@ noscript .noscript_modal .inner .center_text p{ text-align: right; font-size: 12px; color:var(--subtext-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; } .notification2 a{ @@ -6172,7 +6316,7 @@ noscript .noscript_modal .inner .center_text p{ font-size: 16px; color:var(--link-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -6230,7 +6374,7 @@ noscript .noscript_modal .inner .center_text p{ padding-bottom: 6px; border-radius: 50px; font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -6258,7 +6402,7 @@ noscript .noscript_modal .inner .center_text p{ padding-bottom: 6px; border-radius: 50px; font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -6308,7 +6452,7 @@ noscript .noscript_modal .inner .center_text p{ .Image_modal .modal-content { padding: 0px; border-radius: 15px; - width: fit-content; + width: 100%; height: fit-content; max-width: 90%; max-height: 90dvh; @@ -6378,7 +6522,7 @@ noscript .noscript_modal .inner .center_text p{ padding-top: 8px; padding-bottom: 8px; color:#FCFAF2; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .hny .textmain{ @@ -6392,7 +6536,7 @@ noscript .noscript_modal .inner .center_text p{ background-color: transparent; text-align: left; color:var(--text-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; overflow-wrap:break-word; font-size: 22px; line-height: 32px; @@ -6403,7 +6547,7 @@ noscript .noscript_modal .inner .center_text p{ margin: 0px; text-align: left; color:var(--text-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; overflow-wrap:break-word; font-size: 16px; line-height: 22px; @@ -6413,7 +6557,7 @@ noscript .noscript_modal .inner .center_text p{ margin-top: 6px; text-align: right; color:var(--text-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; overflow-wrap:break-word; font-size: 14px; line-height: 22px; @@ -6465,7 +6609,7 @@ noscript .noscript_modal .inner .center_text p{ border-radius: 50px; color:var(--main-color); font-size: 18px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: left; @@ -6517,7 +6661,7 @@ noscript .noscript_modal .inner .center_text p{ fill: currentColor; } .menubutton div{ - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; word-wrap: break-word; font-size: 12px; line-height: 22px; @@ -6613,6 +6757,49 @@ noscript .noscript_modal .inner .center_text p{ width: auto; height: fit-content; } + + .tutorial_background .tutorial_modal{ + padding: 0px; + border-radius: 0px; + width: 100%; + height: 100%; + max-width: 100%; + max-height: 100%; + top: 0; + right: 0; + bottom: 0; + left: 0; + } + .tutorial_background .tutorial_modal .tutorial{ + margin: 64px 32px; + height: calc(100% - 128px); + width: calc(100% - 64px); + } + .tutorial_background .tutorial_modal .tutorial .page h1{ + line-height: 32px; + font-size: 28px; + } + .tutorial_background .tutorial_modal .tutorial .page h2{ + line-height: 28px; + font-size: 22px; + } + .tutorial_background .tutorial_modal .tutorial .page p{ + line-height: 20px; + font-size: 18px; + } + .tutorial_background .tutorial_modal .tutorial .page .btm_area .iro_btn{ + width:30%; + padding: 4px 8px; + margin-left: 12px; + margin-right: 0px; + font-size: 22px; + } + .tutorial_background .tutorial_modal .tutorial .page .btm_area .iro_btn:hover{ + width:31%; + } + .tutorial_background .tutorial_modal .tutorial .page .btm_area .iro_btn:active{ + width:29%; + } } /*------------------------------------------------------------------------------------------------------------*/ @@ -6666,7 +6853,7 @@ noscript .noscript_modal .inner .center_text p{ main h1{ color:var(--sub-color); font-size: 32px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; } @@ -6933,7 +7120,7 @@ noscript .noscript_modal .inner .center_text p{ color:var(--main-color); border: 1px solid var(--main-color); font-size: 16px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -7285,7 +7472,7 @@ noscript .noscript_modal .inner .center_text p{ border-radius: 5px; font-size: calc(100% - 2px); text-decoration: none; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: bold; vertical-align: top; } @@ -7312,7 +7499,7 @@ noscript .noscript_modal .inner .center_text p{ padding-bottom: 4px; color:var(--dark-text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } @@ -7474,13 +7661,13 @@ noscript .noscript_modal .inner .center_text p{ .overview p{ color: var(--dark-text-color); font-size: 32px; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: bold; } .overview .p2{ color: var(--dark-subtext-color); font-size: 12px; - font-family: 'BIZ UDGothic', sans-serif; + font-family: var(--Mono-fonts), sans-serif; font-weight: normal; } .servericon img{ @@ -7527,7 +7714,36 @@ noscript .noscript_modal .inner .center_text p{ text-align: center; color:#CCC; font-size: 14px; - font-family: 'BIZ UDGothic', 'Yu Mincho Regular', 'ヒラギノ角ゴシック', sans-serif; + font-family: var(--Mono-fonts), 'Yu Mincho Regular', 'ヒラギノ角ゴシック', sans-serif; font-weight: normal; } + + .tutorial_background .tutorial_modal{ + background-color: var(--dark-background-color); + } + .tutorial_background .tutorial_modal .tutorial .page h1{ + color:var(--dark-text-color); + } + .tutorial_background .tutorial_modal .tutorial .page h2{ + color:var(--dark-text-color); + } + .tutorial_background .tutorial_modal .tutorial .page p{ + color:var(--dark-text-color); + } + .tutorial_background .tutorial_modal .tutorial .page .btm_area .iro_btn{ + background-color: var(--main-color); + color:var(--dark-sub-color); + } + .tutorial_background .tutorial_modal .tutorial .page .btm_area .iro_btn:hover{ + background-color: var(--main-color); + color:var(--dark-sub-color); + } + .tutorial_background .tutorial_modal .tutorial .page .btm_area .backcolor{ + background-color: var(--dark-background-color); + color: var(--dark-text-color); + } + .tutorial_background .tutorial_modal .tutorial .page .btm_area .backcolor:hover{ + background-color: var(--dark-background-color); + color: var(--dark-text-color); + } } \ No newline at end of file diff --git a/css/style.css b/css/style.css index 26a0c1d..c1bb108 100644 --- a/css/style.css +++ b/css/style.css @@ -1,5 +1,8 @@ -@import url('https://fonts.googleapis.com/css2?family=BIZ+UDPGothic:wght@400;700&family=Josefin+Sans:ital,wght@1,700&family=Kosugi+Maru&family=Zen+Maru+Gothic:wght@500&display=swap'); +@import url("font.css"); @import url("color.css"); +::-webkit-scrollbar { + display: none; +} body{ display: flex; @@ -27,7 +30,8 @@ body{ margin-bottom: 0px; background-color: var(--main-color); width: 600px; - height: 100%; + min-height: 100dvh; + height: fit-content; margin-left: 0px; padding: 32px; } @@ -50,7 +54,7 @@ body{ } .leftbox .logo p{ color:var(--background-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 32px; margin-left: 8px; @@ -86,7 +90,7 @@ body{ } .leftbox2 .logo p{ color:var(--background-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 32px; margin-left: 8px; @@ -111,7 +115,7 @@ body{ margin: 0px; color: var(--main-color); font-size: 32px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; margin-bottom: 12px; } @@ -121,7 +125,7 @@ body{ color: var(--text-color); text-align: center; font-size: 32px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; } .textbox h3{ @@ -130,7 +134,7 @@ body{ color: var(--text-color); text-align: center; font-size: 18px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; } @@ -139,7 +143,7 @@ body{ line-height: 20px; color: var(--text-color); font-size: 16px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } @@ -150,7 +154,7 @@ body{ line-height: 20px; color: var(--subtext-color); font-size: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } @@ -162,7 +166,7 @@ body{ line-height: 20px; color: var(--subtext-color); font-size: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } @@ -173,7 +177,7 @@ body{ line-height: 24px; color: var(--text-color); font-size: 22px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -183,7 +187,7 @@ body{ color: var(--link-color); text-decoration: none; font-size: 16px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } @@ -212,7 +216,7 @@ body{ word-wrap: break-word; color: var(--subtext-color); font-size: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } @@ -224,7 +228,7 @@ body{ line-height: 24px; color: var(--text-color); font-size: 20px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } @@ -276,7 +280,7 @@ body{ line-height: 24px; color: var(--text-color); font-size: 24px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .servericon .textzone .p2c{ @@ -287,7 +291,7 @@ body{ line-height: 20px; color: var(--subtext-color); font-size: 14px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } @@ -314,51 +318,44 @@ label > input { 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; - background-color: var(--main-color); text-align: center; border-radius: 50px; color:var(--background-color); font-size: 22px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; 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:45%; + padding: 8px 22%; } .irobutton:active{ box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05); - width:35%; + 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); @@ -366,20 +363,19 @@ label > input { border-radius: 50px; color:var(--main-color); font-size: 22px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; 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%; } .formarea{ @@ -410,6 +406,7 @@ label > input { height:100px; border-radius: 50%; box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15); + object-fit: cover; } .formarea label{ @@ -417,7 +414,7 @@ label > input { font-size: 16px; color:var(--text-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } @@ -452,7 +449,7 @@ label > input { line-height: 20px; color: var(--subtext-color); font-size: 12px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } .ueuse2 a{ @@ -462,19 +459,19 @@ label > input { font-size: 16px; color:var(--link-color); text-decoration: none; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; } .inbox { - width: 96%; + width: calc(100% - 24px); padding: 8px 10px; border: none; border-radius: 10px; background: var(--background-color); - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; color: var(--text-color); - font-size: 1em; + font-size: 16px; line-height: 1.5; white-space: nowrap; box-shadow: 0px 0px 25px rgba(0,0,0,0.03); @@ -499,6 +496,10 @@ label > input { border: 1px solid var(--main-color); border-bottom: 3px solid var(--main-color); } +textarea { + height: 100px; + resize: vertical; +} .errmsg{ @@ -514,7 +515,7 @@ label > input { margin-left: auto; margin-right: auto; color:#ff4848; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; word-wrap: break-word; line-height: 20px; border: 1px solid #FF4848; @@ -541,7 +542,7 @@ label > input { border-radius: 50px; color:var(--background-color); font-size: 26px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15); @@ -575,7 +576,7 @@ label > input { border-radius: 50px; color:var(--main-color); font-size: 26px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15); @@ -612,7 +613,7 @@ label > input { .rolebox p { margin: 2px 10px 2px 10px; font-size: 16px; - font-family: "Zen Maru Gothic", sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; } @@ -723,7 +724,7 @@ label > input { } .userleftbox h1{ - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; margin-left: 20px; color:var(--background-color); font-size: 32px; @@ -741,7 +742,7 @@ label > input { } .userleftbox .logo p{ color:var(--background-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 32px; margin-left: 8px; @@ -768,7 +769,7 @@ label > input { border-radius: 50px; color:var(--sub-color); font-size: 20px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -801,7 +802,7 @@ main{ main h1{ color:var(--text-color); font-size: 32px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; } @@ -834,7 +835,7 @@ main h1{ color:var(--sub-color); font-size: 16px; text-align: center; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -961,7 +962,7 @@ p img{ line-height: 14px; color: var(--subtext-color); font-size: 14px; - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: normal; } .module_chk{ @@ -992,6 +993,14 @@ p img{ backdrop-filter: blur(10px); } + .formarea{ + padding-top: 16px; + padding-bottom: 16px; + padding-left: 16px; + padding-right: 16px; + margin-top: 32px; + } + .leftbox{ margin-top: 0px; margin-bottom: 0px; @@ -1022,7 +1031,7 @@ p img{ } .leftbox .logo p{ color:var(--background-color); - font-family: 'BIZ UDPGothic', sans-serif; + font-family: var(--Text-fonts), sans-serif; font-weight: bold; font-size: 32px; margin-left: 8px; @@ -1050,7 +1059,7 @@ p img{ margin: 0px; color: var(--main-color); font-size: 32px; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; } @@ -1070,27 +1079,22 @@ p img{ } .irobutton{ - width:60%; + padding: 8px 5%; } .irobutton:hover{ - box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2); - width:65%; + padding: 8px 6%; } .irobutton:active{ - box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05); - width:55%; + padding: 8px 4%; } - .sirobutton{ - width:60%; + padding: 8px 5%; } .sirobutton:hover{ - box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2); - width:65%; + padding: 8px 6%; } .sirobutton:active{ - box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05); - width:55%; + padding: 8px 4%; } @@ -1105,16 +1109,16 @@ p img{ cursor: pointer; border: none; display: block; - width:50%; + width:100%; padding: 8px auto; margin-top: 12px; - margin-left: 12px; - margin-right: 12px; + margin-left: auto; + margin-right: auto; margin-bottom: 0px; - padding-top: 12px; - padding-bottom: 12px; + padding-top: 6px; + padding-bottom: 6px; background-color: var(--main-color); @@ -1123,7 +1127,7 @@ p img{ color:var(--sub-color); font-size: 16px; text-align: center; - font-family: 'Zen Maru Gothic', sans-serif; + font-family: var(--Head-fonts), sans-serif; font-weight: normal; text-decoration:none; text-align: center; @@ -1135,11 +1139,11 @@ p img{ background-color: var(--main-color); color: var(--sub-color); box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2); - width:55%; + width: 100%; } .fbtn:active{ box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05); - width:45%; + width: 100%; } .leftbox2{ diff --git a/db.php b/db.php index 60f08e6..adcb0c8 100644 --- a/db.php +++ b/db.php @@ -1,8 +1,8 @@
diff --git a/errorpage/401.php b/errorpage/401.php index 4b40bed..f870386 100644 --- a/errorpage/401.php +++ b/errorpage/401.php @@ -31,11 +31,11 @@ $domain = $_SERVER['HTTP_HOST'];
diff --git a/errorpage/403.php b/errorpage/403.php index 0c7aa5e..7f631ae 100644 --- a/errorpage/403.php +++ b/errorpage/403.php @@ -31,11 +31,11 @@ $domain = $_SERVER['HTTP_HOST'];
diff --git a/errorpage/404.php b/errorpage/404.php index 15c7310..4890580 100644 --- a/errorpage/404.php +++ b/errorpage/404.php @@ -33,11 +33,11 @@ $domain = $_SERVER['HTTP_HOST'];
diff --git a/errorpage/500.php b/errorpage/500.php index 312d8c8..fae9c33 100644 --- a/errorpage/500.php +++ b/errorpage/500.php @@ -30,11 +30,11 @@ $domain = $_SERVER['HTTP_HOST'];
diff --git a/errorpage/503.php b/errorpage/503.php index 9fa0278..0f7a9f5 100644 --- a/errorpage/503.php +++ b/errorpage/503.php @@ -36,11 +36,11 @@ $domain = $_SERVER['HTTP_HOST'];
diff --git a/errorpage/serverstop.php b/errorpage/serverstop.php index 7651dc8..62d44e8 100644 --- a/errorpage/serverstop.php +++ b/errorpage/serverstop.php @@ -34,11 +34,11 @@ if(!empty(file_get_contents($serverstopfile))){
diff --git a/function/function.php b/function/function.php index 2bd9bfe..6305e4e 100644 --- a/function/function.php +++ b/function/function.php @@ -62,7 +62,8 @@ function delete_exif($extension, $path){ //----------Check_Extension------ //ファイル形式チェック(画像かどうか) function check_mime($tmp_name){ - $tmp_ext = mime_content_type($tmp_name); + $finfo = new finfo(); + $tmp_ext = $finfo->file($tmp_name, FILEINFO_MIME_TYPE); $safe_img_mime = array( "image/gif", "image/jpeg", @@ -81,7 +82,8 @@ function check_mime($tmp_name){ } //ファイル形式チェック(画像かどうか) function check_mime_video($tmp_name){ - $tmp_ext = mime_content_type($tmp_name); + $finfo = new finfo(); + $tmp_ext = $finfo->file($tmp_name, FILEINFO_MIME_TYPE); $safe_vid_mime = array( "video/mpeg", "video/mp4", @@ -94,6 +96,43 @@ function check_mime_video($tmp_name){ return false; } } +//ファイル形式チェック(Base64の場合) +function base64_mime($Base64,$userid){ + $Base64 = base64_decode($Base64); + $finfo = finfo_open(FILEINFO_MIME_TYPE); + $mime_type = finfo_buffer($finfo, $Base64); + + $safe_img_mime = [ + "image/gif" => 'gif', + "image/jpeg" => 'jpg', + "image/png" => 'png', + "image/svg+xml" => 'svg', + "image/webp" => 'webp', + "image/bmp" => 'bmp', + "image/x-icon" => 'ico', + "image/tiff" => 'tiff' + ]; + + if(isset($safe_img_mime[$mime_type])){ + $extension = $safe_img_mime[$mime_type]; + $temp_file = tempnam(sys_get_temp_dir(), 'img'); + file_put_contents($temp_file, $Base64); + + delete_exif($extension, $temp_file); + + $newFilename = uniqid() . '-' . $userid . '.' . $extension; + $uploadedPath = '../ueuseimages/' . $newFilename; + + $result = copy($temp_file, "../".$uploadedPath); + if($result){ + return $uploadedPath; + } else { + return false; + } + } else { + return false; + } +} //文字装飾・URL変換など function processMarkdownAndWrapEmptyLines($markdownText){ @@ -112,7 +151,7 @@ function processMarkdownAndWrapEmptyLines($markdownText){ //太字&斜体------------------------------------------------------------------------ $markdownText = preg_replace('/\*\*\*(.+)\*\*\*(?=\s)/', '$1', $markdownText);//太字&斜体の全部のせセット - $markdownText = preg_replace('/\b\*\*\*(.+)\*\*\*\b/', '$1', $markdownText);//太字&斜体の全部のせセット + $markdownText = preg_replace('/\*\*\*(.+)\*\*\*/', '$1', $markdownText);//太字&斜体の全部のせセット $markdownText = preg_replace('/\_\_\_(.+)\_\_\_(?=\s)/', '$1', $markdownText);//太字&斜体の全部のせセット $markdownText = preg_replace('/\b\_\_\_(.+)\_\_\_\b/', '$1', $markdownText);//太字&斜体の全部のせセット @@ -318,4 +357,162 @@ function YouTube_and_nicovideo_Links($postText) { return $postText; } + +function UserAgent_to_Device($useragent) { + if(preg_match('/Windows\sNT\s10.0/', $useragent)) { + $device = "Windows 10/11"; + }elseif(preg_match('/Windows\sNT\s6.3/', $useragent)) { + $device = "Windows 8.1"; + }elseif(preg_match('/Windows\sNT\s6.2/', $useragent)) { + $device = "Windows 8"; + }elseif(preg_match('/Windows\sNT\s6.1/', $useragent)) { + $device = "Windows 7"; + }elseif(preg_match('/Windows\sNT\s6.0/', $useragent)) { + $device = "Windows Vista"; + }elseif(preg_match('/Windows\sNT\s5.2/', $useragent)) { + $device = "Windows XP"; + }elseif(preg_match('/Windows\sNT\s5.1/', $useragent)) { + $device = "Windows XP"; + }elseif(preg_match('/Windows\sPhone/', $useragent)) { + $device = "Windows Phone"; + }elseif(preg_match('/iPhone/', $useragent)) { + $device = "iPhone"; + }elseif(preg_match('/iPad/', $useragent)) { + $device = "iPad"; + }elseif(preg_match('/iPod\stouch/', $useragent)) { + $device = "iPod touch"; + }elseif(preg_match('/Mac\sOS\sX/', $useragent)) { + $device = "macOS"; + }elseif(preg_match('/Android/', $useragent)) { + $device = "Android"; + }elseif(preg_match('/BlackBerry/', $useragent)) { + $device = "BlackBerry"; + }elseif(preg_match('/Linux/', $useragent)) { + $device = "Linux"; + }elseif(preg_match('/Nintendo\sWiiU/', $useragent)) { + $device = "Nintendo WiiU"; + }elseif(preg_match('/PlayStation\s4/', $useragent)) { + $device = "PlayStation 4"; + }elseif(preg_match('/PlayStation\s5/', $useragent)) { + $device = "PlayStation 5"; + }elseif(preg_match('/Nintendo\sSwitch/', $useragent)) { + $device = "Nintendo Switch"; + }elseif(preg_match('/Nintendo\s3DS/', $useragent)) { + $device = "Nintendo 3DS"; + }else{ + $device = "Others"; + } + return $device; +} +function File_MaxUploadSize(){ + $memory_max = ini_get('memory_limit'); + $post_max = ini_get('post_max_size'); + $upload_max = ini_get('upload_max_filesize'); + if(!($memory_max == "-1")){ + $memory_max_s = ini_parse_quantity($memory_max); + }else{ + $memory_max_s = PHP_INT_MAX; + } + if(!($post_max == "-1")){ + $post_max_s = ini_parse_quantity($post_max); + }else{ + $post_max_s = PHP_INT_MAX; + } + if(!($upload_max == "-1")){ + $upload_max_s = ini_parse_quantity($upload_max); + }else{ + $upload_max_s = PHP_INT_MAX; + } + + if($memory_max_s >= $post_max_s){ + $maxsize = $post_max_s; + }else{ + $maxsize = $memory_max_s; + } + + if($maxsize >= $upload_max_s){ + $file_maxsize = $upload_max_s; + }else{ + $file_maxsize = $maxsize; + } + return $file_maxsize; +} +function x1024($byte){ + $n_mb = $byte / 1024; + return round($n_mb, 1); +} +function uwuzu_ver($select,$path){ + $softwaredata = file_get_contents($path); + + $softwaredata = explode( "\n", $softwaredata ); + $cnt = count( $softwaredata ); + for( $i=0;$i<$cnt;$i++ ){ + $software_info[$i] = ($softwaredata[$i]); + } + if($select == "name"){ + $ret = $software_info[0]; + }elseif($select == "ver_"){ + $ret = $software_info[1]; + }elseif($select == "date"){ + $ret = $software_info[2]; + }elseif($select == "dev_"){ + $ret = $software_info[3]; + }else{ + $ret = "no_data"; + } + return htmlentities($ret, ENT_QUOTES, 'UTF-8', false); +} +function send_notification($to,$from,$title,$message,$url){ + // データベースに接続 + 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) { + return false; + } + + if(!(empty($pdo))){ + + $pdo->beginTransaction(); + + try { + $fromuserid = htmlentities($from, ENT_QUOTES, 'UTF-8', false); + $touserid = htmlentities($to, ENT_QUOTES, 'UTF-8', false); + $datetime = date("Y-m-d H:i:s"); + $msg = htmlentities($message, ENT_QUOTES, 'UTF-8', false); + $title = htmlentities($title, ENT_QUOTES, 'UTF-8', false); + $url = htmlentities($url, ENT_QUOTES, 'UTF-8', false); + $userchk = 'none'; + + // 通知用SQL作成 + $stmt = $pdo->prepare("INSERT INTO notification (fromuserid, touserid, msg, url, datetime, userchk, title) VALUES (:fromuserid, :touserid, :msg, :url, :datetime, :userchk, :title)"); + + $stmt->bindParam(':fromuserid', $fromuserid, PDO::PARAM_STR); + $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); + + $res = $stmt->execute(); + + $res = $pdo->commit(); + + if($res){ + return true; + }else{ + return false; + } + + } catch(Exception $e) { + return false; + } + } +} + ?> \ No newline at end of file diff --git a/home/ftl.php b/home/ftl.php index efb9c41..1e5fac6 100644 --- a/home/ftl.php +++ b/home/ftl.php @@ -195,15 +195,6 @@ if(isset($_GET['text'])) { }elseif(isset($_COOKIE['ueuse'])) { $ueuse = htmlentities($_COOKIE['ueuse'], ENT_QUOTES, 'UTF-8', false); } -//-----------------絵文字の取得---------------- -if (!empty($pdo)) { - $custom_emoji_Query = "SELECT emojifile,emojiname,emojiinfo,emojidate FROM emoji ORDER BY emojidate DESC"; - $custom_emoji_array = $pdo->query($custom_emoji_Query); - - while ($row = $custom_emoji_array->fetch(PDO::FETCH_ASSOC)) { - $custom_emoji[] = $row; - } -} //------------------------------------------- function get_mentions_userid($postText) { @@ -529,43 +520,7 @@ if( !empty($_POST['btn_submit']) ) { $mentionedUsers = array_unique(get_mentions_userid($ueuse)); foreach ($mentionedUsers as $mentionedUser) { - - $pdo->beginTransaction(); - - try { - $fromuserid = $userid; - $touserid = $mentionedUser; - $datetime = date("Y-m-d H:i:s"); - $msg = "" . $ueuse . ""; - $title = "" . $userid . "さんにメンションされました!"; - $url = "/!" . $uniqid . ""; - $userchk = 'none'; - - // 通知用SQL作成 - $stmt = $pdo->prepare("INSERT INTO notification (fromuserid, touserid, msg, url, datetime, userchk, title) VALUES (:fromuserid, :touserid, :msg, :url, :datetime, :userchk, :title)"); - - - $stmt->bindParam(':fromuserid', htmlentities($fromuserid, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR); - $stmt->bindParam(':touserid', htmlentities($touserid, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR); - $stmt->bindParam(':msg', htmlentities($msg, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR); - $stmt->bindParam(':url', htmlentities($url, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR); - $stmt->bindParam(':userchk', htmlentities($userchk, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR); - $stmt->bindParam(':title', htmlentities($title, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR); - - $stmt->bindParam(':datetime', htmlentities($datetime, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR); - - // SQLクエリの実行 - $res = $stmt->execute(); - - // コミット - $res = $pdo->commit(); - - } catch(Exception $e) { - - // エラーが発生した時はロールバック - $pdo->rollBack(); - } - + send_notification($mentionedUser,$userid,"".$userid."さんにメンションされました!",$ueuse,"/!".$uniqid.""); } } catch(Exception $e) { @@ -645,8 +600,8 @@ if ("serviceWorker" in navigator) {
@@ -702,98 +657,12 @@ if ("serviceWorker" in navigator) {
- -
@@ -816,8 +685,8 @@ if ("serviceWorker" in navigator) {
@@ -830,8 +699,8 @@ if ("serviceWorker" in navigator) {
- - + +
@@ -1149,6 +1018,125 @@ $(document).on('click', '.addabi', function (event) { osho_gats.style.display = 'none'; }); + //---------------------------------------------------------------------------------------------------------------------- + //-------------------------------------------------------send_box------------------------------------------------------- + //---------------------------------------------------------------------------------------------------------------------- + document.getElementById("upload_videos1").addEventListener('change', function(e){ + var file_reader = new FileReader(); + // ファイルの読み込みを行ったら実行 + file_reader.addEventListener('load', function(e) { + $('#videos1').addClass('label_set'); + }); + file_reader.readAsText(e.target.files[0]); + }); + document.getElementById("upload_images4").addEventListener('change', function(e){ + var file_reader = new FileReader(); + // ファイルの読み込みを行ったら実行 + file_reader.addEventListener('load', function(e) { + $('#images4').addClass('label_set'); + }); + file_reader.readAsText(e.target.files[0]); + }); + + document.getElementById("upload_images3").addEventListener('change', function(e){ + var file_reader = new FileReader(); + // ファイルの読み込みを行ったら実行 + file_reader.addEventListener('load', function(e) { + $('#images3').addClass('label_set'); + $("#images4").show(); + }); + file_reader.readAsText(e.target.files[0]); + }); + + document.getElementById("upload_images2").addEventListener('change', function(e){ + var file_reader = new FileReader(); + // ファイルの読み込みを行ったら実行 + file_reader.addEventListener('load', function(e) { + $('#images2').addClass('label_set'); + $("#images3").show(); + }); + file_reader.readAsText(e.target.files[0]); + }); + document.getElementById("upload_images").addEventListener('change', function(e){ + var file_reader = new FileReader(); + // ファイルの読み込みを行ったら実行 + file_reader.addEventListener('load', function(e) { + $('#images').addClass('label_set'); + $("#images2").show(); + }); + file_reader.readAsText(e.target.files[0]); + }); + + $('#ueuse').on('input', function () { + var mojisize = ''; + var mojicount = Number(mojisize) - $(this).val().length; + if(mojicount >= 0){ + $('#moji_cnt').removeClass('red'); + $('#moji_cnt').html(mojicount); + $('#ueusebtn').prop('disabled', false); + }else{ + $('#moji_cnt').addClass('red'); + $('#moji_cnt').html(mojicount); + $('#ueusebtn').prop('disabled', true); + } + document.cookie = "ueuse=" + encodeURIComponent($(this).val()) + "; Secure; SameSite=Lax; path=/home;"; + }); + loadEmojis(); + $("#emoji_picker_btn").click(function () { + if ($("#emoji_picker_btn").prop("checked") == true) { + $("#emoji_picker").show(); + } else { + $("#emoji_picker").hide(); + } + }); + $('.emoji_picker').on('scroll', function() { + var innerHeight = $('.emoji_picker_flex').innerHeight(), + outerHeight = $('.emoji_picker').innerHeight(), + outerBottom = innerHeight - outerHeight; + if (outerBottom <= $('.emoji_picker').scrollTop()) { + if ($('#noemoji').length){ + return; + } else { + loadEmojis(); + } + } + }); + var Emoji_pageNumber = 1; + var isLoading = false; + function loadEmojis() { + if (isLoading) return; + isLoading = true; + + var userid = ''; + var account_id = ''; + var search_query = ''; + var viewmode = 'picker' + $.ajax({ + url: '../nextpage/emojiview.php', // PHPファイルへのパス + method: 'GET', + data: { page: Emoji_pageNumber, userid: userid , account_id: account_id , search_query: search_query, view_mode: viewmode}, + dataType: 'html', + timeout: 300000, + success: function(response) { + $('.emoji_picker_flex').append(response); + Emoji_pageNumber++; + isLoading = false; + EmojiClickEvent(); + }, + error: function (xhr, textStatus, errorThrown) { // エラーと判定された場合 + isLoading = false; + EmojiClickEvent(); + }, + }); + } + function EmojiClickEvent() { + $(".one_emoji").click(function (event) { + event.preventDefault(); + var children = $(this).children("img"); + var custom_emojiname = children.attr("title"); + $("#ueuse").val($("#ueuse").val() + custom_emojiname); + }); + } }); diff --git a/home/index.php b/home/index.php index c06d67c..4aa0b97 100644 --- a/home/index.php +++ b/home/index.php @@ -194,15 +194,6 @@ if(isset($_GET['text'])) { }elseif(isset($_COOKIE['ueuse'])) { $ueuse = htmlentities($_COOKIE['ueuse'], ENT_QUOTES, 'UTF-8', false); } -//-----------------絵文字の取得---------------- -if (!empty($pdo)) { - $custom_emoji_Query = "SELECT emojifile,emojiname,emojiinfo,emojidate FROM emoji ORDER BY emojidate DESC"; - $custom_emoji_array = $pdo->query($custom_emoji_Query); - - while ($row = $custom_emoji_array->fetch(PDO::FETCH_ASSOC)) { - $custom_emoji[] = $row; - } -} //------------------------------------------- function get_mentions_userid($postText) { @@ -528,43 +519,7 @@ if( !empty($_POST['btn_submit']) ) { $mentionedUsers = array_unique(get_mentions_userid($ueuse)); foreach ($mentionedUsers as $mentionedUser) { - - $pdo->beginTransaction(); - - try { - $fromuserid = $userid; - $touserid = $mentionedUser; - $datetime = date("Y-m-d H:i:s"); - $msg = "" . $ueuse . ""; - $title = "" . $userid . "さんにメンションされました!"; - $url = "/!" . $uniqid . ""; - $userchk = 'none'; - - // 通知用SQL作成 - $stmt = $pdo->prepare("INSERT INTO notification (fromuserid, touserid, msg, url, datetime, userchk, title) VALUES (:fromuserid, :touserid, :msg, :url, :datetime, :userchk, :title)"); - - - $stmt->bindParam(':fromuserid', htmlentities($fromuserid, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR); - $stmt->bindParam(':touserid', htmlentities($touserid, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR); - $stmt->bindParam(':msg', htmlentities($msg, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR); - $stmt->bindParam(':url', htmlentities($url, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR); - $stmt->bindParam(':userchk', htmlentities($userchk, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR); - $stmt->bindParam(':title', htmlentities($title, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR); - - $stmt->bindParam(':datetime', htmlentities($datetime, ENT_QUOTES, 'UTF-8', false), PDO::PARAM_STR); - - // SQLクエリの実行 - $res = $stmt->execute(); - - // コミット - $res = $pdo->commit(); - - } catch(Exception $e) { - - // エラーが発生した時はロールバック - $pdo->rollBack(); - } - + send_notification($mentionedUser,$userid,"".$userid."さんにメンションされました!",$ueuse,"/!".$uniqid.""); } } catch(Exception $e) { @@ -674,8 +629,8 @@ if ("serviceWorker" in navigator) {
- LTL - FTL + ローカル + フォロー