1
0
mirror of https://github.com/Daichimarukana/uwuzu.git synced 2026-06-04 19:14:41 +00:00

uwuzu v1.4.7 Funium

This commit is contained in:
Daichimarukana
2024-11-14 20:12:04 +09:00
parent 83d599aa25
commit 6cdad111f0
20 changed files with 318 additions and 90 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
require("../../function/function.php");
$serversettings_file = "../../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
header("Content-Type: application/activity+json");
header("charset=utf-8");
header("Access-Control-Allow-Origin: *");
$domain = $_SERVER['HTTP_HOST'];
$user = safetext($_GET['actor']);
$userid = str_replace('@','', str_replace('@'.$domain.'', '', $user));
$item = array(
"@context" => "https://www.w3.org/ns/activitystreams",
"id" => "https://".$domain."/user/followers/?actor=".$userid,
"type" => "OrderedCollection",
"totalItems" => 0,
"orderedItems" => [],
);
echo json_encode($item, JSON_UNESCAPED_UNICODE);
}else{
header("HTTP/1.1 410 Gone");
}
?>
+29
View File
@@ -0,0 +1,29 @@
<?php
require("../../function/function.php");
$serversettings_file = "../../server/serversettings.ini";
$serversettings = parse_ini_file($serversettings_file, true);
if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
header("Content-Type: application/activity+json");
header("charset=utf-8");
header("Access-Control-Allow-Origin: *");
$domain = $_SERVER['HTTP_HOST'];
$user = safetext($_GET['actor']);
$userid = str_replace('@','', str_replace('@'.$domain.'', '', $user));
$item = array(
"@context" => "https://www.w3.org/ns/activitystreams",
"id" => "https://".$domain."/user/following/?actor=".$userid,
"type" => "OrderedCollection",
"totalItems" => 0,
"orderedItems" => [],
);
echo json_encode($item, JSON_UNESCAPED_UNICODE);
}else{
header("HTTP/1.1 410 Gone");
}
?>
+9 -12
View File
@@ -184,19 +184,11 @@ function customStripTags($html, $allowedTags)
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font');
if (!empty($pdo)) {
// データベース接続の設定
$dbh = new PDO('mysql:charset=utf8mb4;dbname=' . DB_NAME . ';host=' . DB_HOST, DB_USER, DB_PASS, array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
));
$uwuzuid2 = safetext(str_replace('@', '', $_GET['uwuzuid']));
$uwuzuid = safetext(str_replace('@' . $domain, '', $uwuzuid2));
$userQuery = $dbh->prepare("SELECT username, userid, profile, role, follower, blocklist FROM account WHERE userid = :userid");
$userQuery = $pdo->prepare("SELECT username, userid, profile, role, follower, blocklist FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $uwuzuid);
$userQuery->execute();
$userData = $userQuery->fetch();
@@ -207,7 +199,7 @@ if (!empty($pdo)) {
$roles = explode(',', $userData["role"]); // カンマで区切られたロールを配列に分割
$rerole = $dbh->prepare("SELECT follow, follower,blocklist, username, userid, password, mailadds, profile, iconname, headname, role, datetime FROM account WHERE userid = :userid");
$rerole = $pdo->prepare("SELECT follow, follower,blocklist, username, userid, password, mailadds, profile, iconname, headname, role, datetime, other_settings FROM account WHERE userid = :userid");
$rerole->bindValue(':userid', $uwuzuid);
// SQL実行
@@ -218,12 +210,13 @@ if (!empty($pdo)) {
$roleDataArray = array();
foreach ($roles as $roleId) {
$rerole = $dbh->prepare("SELECT rolename, roleauth, rolecolor, roleeffect FROM role WHERE roleidname = :role");
$rerole = $pdo->prepare("SELECT rolename, roleauth, rolecolor, roleeffect FROM role WHERE roleidname = :role");
$rerole->bindValue(':role', $roleId);
$rerole->execute();
$roleDataArray[$roleId] = $rerole->fetch();
}
$isAIBlock = val_OtherSettings("isAIBlock", $userdata["other_settings"]);
//-------フォロー数---------
$follow = $userdata['follow']; // コンマで区切られたユーザーIDを含む変数
@@ -250,7 +243,7 @@ if (!empty($pdo)) {
$profileText = safetext($userData['profile']);
$allueuse = $dbh->prepare("SELECT account FROM ueuse WHERE account = :userid");
$allueuse = $pdo->prepare("SELECT account FROM ueuse WHERE account = :userid");
$allueuse->bindValue(':userid', $uwuzuid);
$allueuse->execute();
$ueuse_cnt = $allueuse->rowCount();
@@ -508,6 +501,10 @@ $pdo = null;
<script src="../js/nsfw_event.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<?php if($isAIBlock === true){?>
<meta name="robots" content="noimageai">
<meta name="robots" content="noai">
<?php }?>
<link rel="stylesheet" href="../css/home.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
-2
View File
@@ -57,7 +57,6 @@ if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
foreach ($messages as $value) {
$activity = array(
"type" => "Create",
"@context" => "https://www.w3.org/ns/activitystreams",
"id" => "https://" . $domain . "/ueuse/activity/?ueuse=" . $value["uniqid"],
"url" => "https://" . $domain . "/ueuse/activity/?ueuse=" . $value["uniqid"],
"published" => date(DATE_ATOM, strtotime($value["datetime"])),
@@ -86,7 +85,6 @@ if(safetext($serversettings["serverinfo"]["server_activitypub"]) === "true"){
"type" => "OrderedCollection",
"@context" => "https://www.w3.org/ns/activitystreams",
"id" => "https://" . $domain . "/user/outbox/?actor=@" . $userid . "&page=true",
"partOf" => "https://" . $domain . "/user/outbox/?actor=@" . $userid,
"summary" => "outbox of " . $userid,
"totalItems" => count($messages),
"orderedItems" => $orderedItems,