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

uwuzu version 1.2.25

This commit is contained in:
daichimarukana
2023-10-22 23:45:14 +09:00
parent 0ecf4b9fb1
commit 884f8043a3
33 changed files with 814 additions and 113 deletions
+17 -1
View File
@@ -13,6 +13,9 @@ $mojisizefile = "../server/textsize.txt";
$colorfile = "../css/color.css";
$color_info = file_get_contents($colorfile);
$manifestfile = "../manifest/manifest.json";
$manifest_info = file_get_contents($manifestfile);
$err404imagefile = "../server/404imagepath.txt";
$robots = "../robots.txt";
@@ -220,6 +223,7 @@ if( !empty($_POST['btn_submit']) ) {
// 空白除去
$colordata = $_POST['colordata'];
$manifestdata = $_POST['manifestdata'];
//鯖名
$file = fopen($colorfile, 'w');
@@ -227,6 +231,12 @@ if( !empty($_POST['btn_submit']) ) {
fputs($file, $data);
fclose($file);
//manifest
$file = fopen($manifestfile, 'w');
$data = $manifestdata;
fputs($file, $data);
fclose($file);
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location:".$url."");
exit;
@@ -268,7 +278,13 @@ require('../logout/logout.php');
<div>
<p>CSS</p>
<div class="p2">ここで指定されている色が適用されます。<br>もし適用されなかった場合はキャッシュを削除し再読み込みしてください。<br>表示がおかしくなってしまった場合はカラーコードを再度確認してください。</div>
<textarea id="colordata" placeholder="uwuzu" class="inbox" type="text" name="colordata"><?php $sinfo = explode("\r", $color_info); foreach ($sinfo as $info) { echo $info; }?></textarea>
<textarea id="colordata" placeholder="CSS" class="inbox" type="text" name="colordata"><?php $sinfo = explode("\r", $color_info); foreach ($sinfo as $info) { echo $info; }?></textarea>
</div>
<div>
<p>PWA(manifest)</p>
<div class="p2">ここでPWAの設定を変更できます。<br>"short_name"、"name"が表示されるアプリ名、"theme_color"、"background_color"がテーマカラーとPWA起動時のスプラッシュ画面の背景色です。<br>いま記載したもの以外の設定は変更しないことをお勧めします。</div>
<textarea id="manifestdata" placeholder="manifest.json" class="inbox" type="text" name="manifestdata"><?php $sinfo = explode("\r", $manifest_info); foreach ($sinfo as $info) { echo $info; }?></textarea>
</div>
<input type="submit" class = "irobutton" name="btn_submit" value="保存&更新">
+1 -1
View File
@@ -437,7 +437,7 @@ require('../logout/logout.php');
<div>
<p>ActivityPubサーバーとして認識されるようにするか</p>
<div class="p2">ActivityPubの仮実装をオンにするかです。inboxに入ってきた内容には今現在これといったレスポンスを返しません。<br>また、publicKeyも返却しません。<br>現状ActivityPubサーバーと連合を組むことは出来ません。(リモートユーザーの確認程度なら出来ます。)</div>
<div class="p2">ActivityPubの仮実装をオンにするかです。inboxに入ってきた内容には今現在これといったレスポンスを返しません。<br>また、publicKeyも返却しません。<br>現状ActivityPubサーバーと連合を組むことは出来ません。(リモートユーザーの確認程度なら出来ます。)<br>オフの状態だと410 Goneを返します。</div>
<div class="switch_button">
<?php if(file_get_contents($activitypub_file) === "true"){?>
<input id="activitypub" class="switch_input" type='checkbox' name="activitypub" value="true" checked/>
+52 -15
View File
@@ -440,23 +440,60 @@ if( !empty($_POST['send_ban_submit']) ) {
$deleteQuery->bindValue(':touserid', $userId2, PDO::PARAM_STR);
$res = $deleteQuery->execute();
// フォローの更新
$updateFollowQuery = $pdo->prepare("UPDATE account SET follow = REPLACE(follow, :userid, '') WHERE follow LIKE :pattern");
$updateFollowQuery->bindValue(':userid', ",$userId2", PDO::PARAM_STR);
$updateFollowQuery->bindValue(':pattern', "%,$userId2%", PDO::PARAM_STR);
$updateFollowQuery->execute();
// ユーザーIDを削除したい全てのアカウントを取得
$query = $pdo->prepare("SELECT * FROM account WHERE follow LIKE :pattern1 OR follow LIKE :pattern2 OR follow LIKE :pattern3 OR follower LIKE :pattern1 OR follower LIKE :pattern2 OR follower LIKE :pattern3");
$query->bindValue(':pattern1', "%,$userid,%", PDO::PARAM_STR);
$query->bindValue(':pattern2', "%,$userid", PDO::PARAM_STR);
$query->bindValue(':pattern3', "$userid,%", PDO::PARAM_STR);
$query->execute();
$accounts = $query->fetchAll();
// フォロワーの更新
$updateFollowerQuery = $pdo->prepare("UPDATE account SET follower = REPLACE(follower, :userid, '') WHERE follower LIKE :pattern");
$updateFollowerQuery->bindValue(':userid', ",$userId2", PDO::PARAM_STR);
$updateFollowerQuery->bindValue(':pattern', "%,$userId2%", PDO::PARAM_STR);
$updateFollowerQuery->execute();
foreach ($accounts as $account) {
// フォローの更新
if (strpos($account['follow'], ",$userid,") !== false || strpos($account['follow'], ",$userid") !== false || strpos($account['follow'], "$userid,") !== false) {
$followList = explode(',', $account['follow']);
$followList = array_diff($followList, array($userid));
$newFollowList = implode(',', $followList);
// いいねの更新
$updateFavoriteQuery = $pdo->prepare("UPDATE ueuse SET favorite = REPLACE(favorite, :favorite, '') WHERE favorite LIKE :pattern");
$updateFavoriteQuery->bindValue(':favorite', ",$userId2", PDO::PARAM_STR);
$updateFavoriteQuery->bindValue(':pattern', "%,$userId2%", PDO::PARAM_STR);
$updateFavoriteQuery->execute();
$updateFollowQuery = $pdo->prepare("UPDATE account SET follow = :follow WHERE userid = :userid");
$updateFollowQuery->bindValue(':follow', $newFollowList, PDO::PARAM_STR);
$updateFollowQuery->bindValue(':userid', $account['userid'], PDO::PARAM_STR);
$updateFollowQuery->execute();
}
// フォロワーの更新
if (strpos($account['follower'], ",$userid,") !== false || strpos($account['follower'], ",$userid") !== false || strpos($account['follower'], "$userid,") !== false) {
$followerList = explode(',', $account['follower']);
$followerList = array_diff($followerList, array($userid));
$newFollowerList = implode(',', $followerList);
$updateFollowerQuery = $pdo->prepare("UPDATE account SET follower = :follower WHERE userid = :userid");
$updateFollowerQuery->bindValue(':follower', $newFollowerList, PDO::PARAM_STR);
$updateFollowerQuery->bindValue(':userid', $account['userid'], PDO::PARAM_STR);
$updateFollowerQuery->execute();
}
}
$query = $pdo->prepare("SELECT * FROM ueuse WHERE favorite LIKE :pattern1 OR favorite LIKE :pattern2 OR favorite LIKE :pattern3");
$query->bindValue(':pattern1', "%,$userid,%", PDO::PARAM_STR);
$query->bindValue(':pattern2', "%,$userid", PDO::PARAM_STR);
$query->bindValue(':pattern3', "$userid,%", PDO::PARAM_STR);
$query->execute();
$accounts = $query->fetchAll();
foreach ($accounts as $account) {
// いいねの更新
if (strpos($account['favorite'], ",$userid,") !== false || strpos($account['favorite'], ",$userid") !== false || strpos($account['favorite'], "$userid,") !== false) {
$favoriteList = explode(',', $account['favorite']);
$favoriteList = array_diff($favoriteList, array($userid));
$newFavoriteList = implode(',', $favoriteList);
$updateFavoriteQuery = $pdo->prepare("UPDATE ueuse SET favorite = :favorite WHERE uniqid = :uniqid");
$updateFavoriteQuery->bindValue(':favorite', $newFavoriteList, PDO::PARAM_STR);
$updateFavoriteQuery->bindValue(':uniqid', $account['uniqid'], PDO::PARAM_STR);
$updateFavoriteQuery->execute();
}
}
} catch (Exception $e) {