mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-05 03:24:41 +00:00
uwuzu version 1.2.28
This commit is contained in:
+243
-202
@@ -8,6 +8,9 @@ $banurldomainfile = "../server/banurldomain.txt";
|
||||
$banurl_info = file_get_contents($banurldomainfile);
|
||||
$banurl = preg_split("/\r\n|\n|\r/", $banurl_info);
|
||||
|
||||
//投稿及び返信レート制限↓(分):デフォで60件/分まで
|
||||
$max_ueuse_rate_limit = 60;
|
||||
|
||||
header("Content-Type: application/json; charset=utf-8; Access-Control-Allow-Origin: *;");
|
||||
|
||||
function createUniqId(){
|
||||
@@ -152,105 +155,124 @@ if(isset($_GET['token'])&&isset($_GET['type'])) {
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}else{
|
||||
// 書き込み日時を取得
|
||||
$username = $userData["username"];
|
||||
$userid = $userData["userid"];
|
||||
$datetime = date("Y-m-d H:i:s");
|
||||
$uniqid = createUniqId();
|
||||
$abi = "none";
|
||||
$nones = "none";
|
||||
|
||||
// トランザクション開始
|
||||
$pdo->beginTransaction();
|
||||
|
||||
try {
|
||||
|
||||
// SQL作成
|
||||
$stmt = $pdo->prepare("INSERT INTO ueuse (username, account, uniqid, ueuse, photo1, photo2, video1, datetime, abi) VALUES (:username, :account, :uniqid, :ueuse, :photo1, :photo2, :video1, :datetime, :abi)");
|
||||
|
||||
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':account', $userid, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':uniqid', $uniqid, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':ueuse', $ueuse, PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindParam(':photo1', $nones, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':photo2', $nones, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':video1', $nones, PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindParam(':abi', $abi, PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
|
||||
$mentionedUsers = get_mentions_userid($ueuse);
|
||||
|
||||
foreach ($mentionedUsers as $mentionedUser) {
|
||||
|
||||
$pdo->beginTransaction();
|
||||
|
||||
try {
|
||||
$touserid = $mentionedUser;
|
||||
$datetime = date("Y-m-d H:i:s");
|
||||
$msg = "" . $ueuse . "";
|
||||
$title = "" . $username . "さんにメンションされました!";
|
||||
$url = "/!" . $uniqid . "~" . $userid . "";
|
||||
$userchk = 'none';
|
||||
|
||||
// 通知用SQL作成
|
||||
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)");
|
||||
|
||||
|
||||
$stmt->bindParam(':touserid', $touserid, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':url', $url, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':userchk', $userchk, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':title', $title, PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
|
||||
} catch(Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
$old_datetime = date("Y-m-d H:i:00");
|
||||
$now_datetime = date("Y-m-d H:i:00",strtotime("+1 minute"));
|
||||
$rate_Query = $dbh->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)){
|
||||
|
||||
// 書き込み日時を取得
|
||||
$username = $userData["username"];
|
||||
$userid = $userData["userid"];
|
||||
$datetime = date("Y-m-d H:i:s");
|
||||
$uniqid = createUniqId();
|
||||
$abi = "none";
|
||||
$nones = "none";
|
||||
|
||||
// トランザクション開始
|
||||
$pdo->beginTransaction();
|
||||
|
||||
try {
|
||||
|
||||
// SQL作成
|
||||
$stmt = $pdo->prepare("INSERT INTO ueuse (username, account, uniqid, ueuse, photo1, photo2, video1, datetime, abi) VALUES (:username, :account, :uniqid, :ueuse, :photo1, :photo2, :video1, :datetime, :abi)");
|
||||
|
||||
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':account', $userid, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':uniqid', $uniqid, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':ueuse', $ueuse, PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindParam(':photo1', $nones, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':photo2', $nones, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':video1', $nones, PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindParam(':abi', $abi, PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
|
||||
$mentionedUsers = get_mentions_userid($ueuse);
|
||||
|
||||
foreach ($mentionedUsers as $mentionedUser) {
|
||||
|
||||
$pdo->beginTransaction();
|
||||
|
||||
try {
|
||||
$touserid = $mentionedUser;
|
||||
$datetime = date("Y-m-d H:i:s");
|
||||
$msg = "" . $ueuse . "";
|
||||
$title = "" . $username . "さんにメンションされました!";
|
||||
$url = "/!" . $uniqid . "~" . $userid . "";
|
||||
$userchk = 'none';
|
||||
|
||||
// 通知用SQL作成
|
||||
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)");
|
||||
|
||||
|
||||
$stmt->bindParam(':touserid', $touserid, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':url', $url, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':userchk', $userchk, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':title', $title, PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
|
||||
} catch(Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} catch(Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
|
||||
} catch(Exception $e) {
|
||||
if( $res ) {
|
||||
$response = array(
|
||||
'uniqid' => $uniqid,
|
||||
'userid' => $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);
|
||||
}
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
|
||||
if( $res ) {
|
||||
$response = array(
|
||||
'uniqid' => $uniqid,
|
||||
'userid' => $userid,
|
||||
);
|
||||
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
} else {
|
||||
$err = "db_error_".$e->getMessage();
|
||||
// プリペアドステートメントを削除
|
||||
$stmt = null;
|
||||
}else{
|
||||
$err = "over_rate_limit ";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
);
|
||||
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
// プリペアドステートメントを削除
|
||||
$stmt = null;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
@@ -365,151 +387,170 @@ if(isset($_GET['token'])&&isset($_GET['type'])) {
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}else{
|
||||
|
||||
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST, DB_USER, DB_PASS, array(
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
|
||||
));
|
||||
|
||||
$old_datetime = date("Y-m-d H:i:00");
|
||||
$now_datetime = date("Y-m-d H:i:00",strtotime("+1 minute"));
|
||||
$rate_Query = $dbh->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)){
|
||||
|
||||
$resultQuery = $dbh->prepare("SELECT * FROM ueuse WHERE uniqid = :uniqid");
|
||||
$resultQuery->bindValue(':uniqid', $rpuniqid);
|
||||
$resultQuery->execute();
|
||||
$resultData = $resultQuery->fetch();
|
||||
$resultQuery = $dbh->prepare("SELECT * FROM ueuse WHERE uniqid = :uniqid");
|
||||
$resultQuery->bindValue(':uniqid', $rpuniqid);
|
||||
$resultQuery->execute();
|
||||
$resultData = $resultQuery->fetch();
|
||||
|
||||
if($resultData > 0){
|
||||
if($resultData > 0){
|
||||
|
||||
// 書き込み日時を取得
|
||||
$username = $userData["username"];
|
||||
$userid = $userData["userid"];
|
||||
$datetime = date("Y-m-d H:i:s");
|
||||
$uniqid = createUniqId();
|
||||
$abi = "none";
|
||||
$nones = "none";
|
||||
// 書き込み日時を取得
|
||||
$username = $userData["username"];
|
||||
$userid = $userData["userid"];
|
||||
$datetime = date("Y-m-d H:i:s");
|
||||
$uniqid = createUniqId();
|
||||
$abi = "none";
|
||||
$nones = "none";
|
||||
|
||||
$touserid2 = $resultData["account"];
|
||||
|
||||
// トランザクション開始
|
||||
$pdo->beginTransaction();
|
||||
|
||||
try {
|
||||
|
||||
// SQL作成
|
||||
$stmt = $pdo->prepare("INSERT INTO ueuse (username, account, rpuniqid, uniqid, ueuse, photo1, photo2, video1, datetime, abi) VALUES (:username, :account, :rpuniqid, :uniqid, :ueuse, :photo1, :photo2, :video1, :datetime, :abi)");
|
||||
|
||||
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':account', $userid, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':rpuniqid', $rpuniqid, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':uniqid', $uniqid, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':ueuse', $ueuse, PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindParam(':photo1', $nones, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':photo2', $nones, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':video1', $nones, PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindParam(':abi', $abi, PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
$touserid2 = $resultData["account"];
|
||||
|
||||
// トランザクション開始
|
||||
$pdo->beginTransaction();
|
||||
|
||||
$msg = ''.$ueuse.'';
|
||||
$title = ''.$username.'さんが返信しました!';
|
||||
$url = "https://".$domain."/!".$uniqid."~".$userid."";
|
||||
$userchk = 'none';
|
||||
// 通知用SQL作成
|
||||
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)");
|
||||
|
||||
$stmt->bindParam(':touserid', $touserid2, 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);
|
||||
try {
|
||||
|
||||
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||
// SQL作成
|
||||
$stmt = $pdo->prepare("INSERT INTO ueuse (username, account, rpuniqid, uniqid, ueuse, photo1, photo2, video1, datetime, abi) VALUES (:username, :account, :rpuniqid, :uniqid, :ueuse, :photo1, :photo2, :video1, :datetime, :abi)");
|
||||
|
||||
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':account', $userid, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':rpuniqid', $rpuniqid, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':uniqid', $uniqid, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':ueuse', $ueuse, PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
$stmt->bindParam(':photo1', $nones, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':photo2', $nones, PDO::PARAM_STR);
|
||||
$stmt->bindParam(':video1', $nones, PDO::PARAM_STR);
|
||||
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
|
||||
|
||||
$mentionedUsers = get_mentions_userid($ueuse);
|
||||
$stmt->bindParam(':abi', $abi, PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
|
||||
foreach ($mentionedUsers as $mentionedUser) {
|
||||
|
||||
$pdo->beginTransaction();
|
||||
|
||||
try {
|
||||
$touserid = $mentionedUser;
|
||||
$datetime = date("Y-m-d H:i:s");
|
||||
$msg = "" . $ueuse . "";
|
||||
$title = "" . $username . "さんにメンションされました!";
|
||||
$url = "/!" . $uniqid . "~" . $userid . "";
|
||||
$userchk = 'none';
|
||||
|
||||
// 通知用SQL作成
|
||||
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)");
|
||||
|
||||
|
||||
$stmt->bindParam(':touserid', htmlentities($touserid), PDO::PARAM_STR);
|
||||
$stmt->bindParam(':msg', htmlentities($msg), PDO::PARAM_STR);
|
||||
$stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR);
|
||||
$stmt->bindParam(':userchk', htmlentities($userchk), PDO::PARAM_STR);
|
||||
$stmt->bindParam(':title', htmlentities($title), PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindParam(':datetime', htmlentities($datetime), PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
|
||||
} catch(Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
$msg = ''.$ueuse.'';
|
||||
$title = ''.$username.'さんが返信しました!';
|
||||
$url = "https://".$domain."/!".$uniqid."~".$userid."";
|
||||
$userchk = 'none';
|
||||
// 通知用SQL作成
|
||||
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)");
|
||||
|
||||
$stmt->bindParam(':touserid', $touserid2, 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();
|
||||
|
||||
$mentionedUsers = get_mentions_userid($ueuse);
|
||||
|
||||
foreach ($mentionedUsers as $mentionedUser) {
|
||||
|
||||
$pdo->beginTransaction();
|
||||
|
||||
try {
|
||||
$touserid = $mentionedUser;
|
||||
$datetime = date("Y-m-d H:i:s");
|
||||
$msg = "" . $ueuse . "";
|
||||
$title = "" . $username . "さんにメンションされました!";
|
||||
$url = "/!" . $uniqid . "~" . $userid . "";
|
||||
$userchk = 'none';
|
||||
|
||||
// 通知用SQL作成
|
||||
$stmt = $pdo->prepare("INSERT INTO notification (touserid, msg, url, datetime, userchk, title) VALUES (:touserid, :msg, :url, :datetime, :userchk, :title)");
|
||||
|
||||
|
||||
$stmt->bindParam(':touserid', htmlentities($touserid), PDO::PARAM_STR);
|
||||
$stmt->bindParam(':msg', htmlentities($msg), PDO::PARAM_STR);
|
||||
$stmt->bindParam(':url', htmlentities($url), PDO::PARAM_STR);
|
||||
$stmt->bindParam(':userchk', htmlentities($userchk), PDO::PARAM_STR);
|
||||
$stmt->bindParam(':title', htmlentities($title), PDO::PARAM_STR);
|
||||
|
||||
$stmt->bindParam(':datetime', htmlentities($datetime), PDO::PARAM_STR);
|
||||
|
||||
// SQLクエリの実行
|
||||
$res = $stmt->execute();
|
||||
|
||||
// コミット
|
||||
$res = $pdo->commit();
|
||||
|
||||
} catch(Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} catch(Exception $e) {
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
|
||||
} catch(Exception $e) {
|
||||
if( $res ) {
|
||||
$response = array(
|
||||
'uniqid' => $uniqid,
|
||||
'userid' => $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;
|
||||
|
||||
// エラーが発生した時はロールバック
|
||||
$pdo->rollBack();
|
||||
}
|
||||
|
||||
if( $res ) {
|
||||
$response = array(
|
||||
'uniqid' => $uniqid,
|
||||
'userid' => $userid,
|
||||
);
|
||||
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
} else {
|
||||
$err = "db_error_".$e->getMessage();
|
||||
}else{
|
||||
$err = "post_not_found";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
);
|
||||
|
||||
);
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
// プリペアドステートメントを削除
|
||||
$stmt = null;
|
||||
|
||||
}else{
|
||||
$err = "post_not_found";
|
||||
$err = "over_rate_limit ";
|
||||
$response = array(
|
||||
'error_code' => $err,
|
||||
);
|
||||
);
|
||||
|
||||
echo json_encode($response, JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -36,7 +36,7 @@ if(isset($_GET['limit'])) {
|
||||
|
||||
|
||||
if (!empty($pdo)) {
|
||||
$sql = "SELECT account, username, uniqid, rpuniqid, ueuse, datetime, photo1, photo2, video1, favorite, abi, abidate FROM ueuse WHERE rpuniqid = '' ORDER BY datetime DESC LIMIT " . intval($offset) . ", " . intval($itemsPerPage);
|
||||
$sql = "SELECT account, username, uniqid, rpuniqid, ueuse, datetime, photo1, photo2, video1, favorite, abi, abidate, nsfw FROM ueuse WHERE rpuniqid = '' ORDER BY datetime DESC LIMIT " . intval($offset) . ", " . intval($itemsPerPage);
|
||||
$message_array = $pdo->query($sql);
|
||||
|
||||
while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) {
|
||||
@@ -77,6 +77,7 @@ if(isset($_GET['limit'])) {
|
||||
'datetime' => htmlentities($ueusedata["datetime"]),
|
||||
'abi' => htmlentities($ueusedata["abi"]),
|
||||
'abidatetime' => htmlentities($ueusedata["abidate"]),
|
||||
'nsfw' => htmlentities($ueusedata["nsfw"]),
|
||||
];
|
||||
|
||||
$response[$ueusedata["uniqid"]] = $item; // ループ内で $response にデータを追加
|
||||
|
||||
+9
-17
@@ -3,25 +3,17 @@ header("Content-Type: application/json; charset=utf-8; Access-Control-Allow-Orig
|
||||
|
||||
$mojisizefile = "../server/textsize.txt";
|
||||
|
||||
$adminfile = "../server/admininfo.txt";
|
||||
|
||||
$servernamefile = "../server/servername.txt";
|
||||
|
||||
$servericonfile = "../server/servericon.txt";
|
||||
$serversettings_file = "../server/serversettings.ini";
|
||||
$serversettings = parse_ini_file($serversettings_file, true);
|
||||
|
||||
$serverinfofile = '../server/info.txt';
|
||||
$serverinfo = file_get_contents($serverinfofile);
|
||||
|
||||
$contactfile = "../server/contact.txt";
|
||||
|
||||
$domain = $_SERVER['HTTP_HOST'];
|
||||
|
||||
$softwarefile = "../server/uwuzuinfo.txt";
|
||||
$softwaredata = file_get_contents($softwarefile);
|
||||
|
||||
$onlyuserfile = "../server/onlyuser.txt";
|
||||
$onlyuser = file_get_contents($onlyuserfile);
|
||||
|
||||
$softwaredata = explode( "\n", $softwaredata );
|
||||
$cnt = count( $softwaredata );
|
||||
for( $i=0;$i<$cnt;$i++ ){
|
||||
@@ -69,15 +61,15 @@ for( $i=0;$i<$cnt;$i++ ){
|
||||
$notices[] = $row;
|
||||
}
|
||||
|
||||
if($onlyuser === "true"){
|
||||
if(htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8') === "true"){
|
||||
$openregit = false;
|
||||
}elseif($onlyuser === "false"){
|
||||
}elseif(htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8') === "false"){
|
||||
$openregit = true;
|
||||
}else{
|
||||
$openregit = false;
|
||||
}
|
||||
|
||||
if($onlyuser === "true"){
|
||||
if(htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8') === "true"){
|
||||
$invitation_code = true;
|
||||
}else{
|
||||
$invitation_code = false;
|
||||
@@ -96,13 +88,13 @@ for( $i=0;$i<$cnt;$i++ ){
|
||||
|
||||
$item = [
|
||||
"server_info" => array(
|
||||
"server_name" => file_get_contents($servernamefile),
|
||||
"server_icon" => file_get_contents($servericonfile),
|
||||
"server_name" => htmlspecialchars($serversettings["serverinfo"]["server_name"], ENT_QUOTES, 'UTF-8'),
|
||||
"server_icon" => htmlspecialchars($serversettings["serverinfo"]["server_icon"], ENT_QUOTES, 'UTF-8'),
|
||||
"server_description" => $serverinfo,
|
||||
|
||||
"adminstor" => array(
|
||||
"name" => file_get_contents($adminfile),
|
||||
"email" => file_get_contents($contactfile),
|
||||
"name" => htmlspecialchars($serversettings["serverinfo"]["server_admin"], ENT_QUOTES, 'UTF-8'),
|
||||
"email" => htmlspecialchars($serversettings["serverinfo"]["server_admin_mailadds"], ENT_QUOTES, 'UTF-8'),
|
||||
),
|
||||
|
||||
"terms_url" => "https://".$domain."/rule/terms",
|
||||
|
||||
Reference in New Issue
Block a user