mirror of
https://github.com/Daichimarukana/uwuzu.git
synced 2026-06-04 19:14:41 +00:00
uwuzu v1.5.0 Combeny
This commit is contained in:
+99
-66
@@ -10,9 +10,6 @@ $serversettings = parse_ini_file($serversettings_file, true);
|
||||
$mojisizefile = "../server/textsize.txt";
|
||||
$mojisize = (int)safetext(file_get_contents($mojisizefile));
|
||||
|
||||
//投稿及び返信レート制限↓(分):デフォで60件/分まで
|
||||
$max_ueuse_rate_limit = 60;
|
||||
|
||||
$banurldomainfile = "../server/banurldomain.txt";
|
||||
$banurl_info = file_get_contents($banurldomainfile);
|
||||
$banurl = preg_split("/\r\n|\n|\r/", $banurl_info);
|
||||
@@ -87,51 +84,6 @@ if(isset($_GET['text'])) {
|
||||
$ueuse = safetext($_COOKIE['ueuse']);
|
||||
}
|
||||
|
||||
//-------------------------------------------
|
||||
|
||||
if( !empty($_POST['btn_submit']) ) {
|
||||
$settingsJsonQuery = $pdo->prepare("SELECT userid, other_settings FROM account WHERE userid = :userid");
|
||||
$settingsJsonQuery->bindValue(':userid', $userid);
|
||||
$settingsJsonQuery->execute();
|
||||
$settingsJson = $settingsJsonQuery->fetch();
|
||||
if(!(empty($settingsJson["other_settings"]))){
|
||||
$isAIBWM = val_OtherSettings("isAIBlockWaterMark", $settingsJson["other_settings"]);
|
||||
}else{
|
||||
$isAIBWM = false;
|
||||
}
|
||||
|
||||
$ueuse = safetext($_POST['ueuse']);
|
||||
|
||||
if(isset($_POST['nsfw_chk'])){
|
||||
$nsfw_chk = safetext($_POST['nsfw_chk']);
|
||||
}else{
|
||||
$nsfw_chk = "false";
|
||||
}
|
||||
|
||||
$photo1 = $_FILES['upload_images'];
|
||||
$photo2 = $_FILES['upload_images2'];
|
||||
$photo3 = $_FILES['upload_images3'];
|
||||
$photo4 = $_FILES['upload_images4'];
|
||||
$video1 = $_FILES['upload_videos1'];
|
||||
|
||||
$rpUniqid = "";
|
||||
$ruUniqid = "";
|
||||
$ueuse_result = send_ueuse($userid,$rpUniqid,$ruUniqid,$ueuse,$photo1,$photo2,$photo3,$photo4,$video1,$nsfw_chk,$isAIBWM);
|
||||
|
||||
if($ueuse_result == null){
|
||||
//一時保存していたユーズ内容の削除
|
||||
setcookie("ueuse", "", time() - 3600);
|
||||
|
||||
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
|
||||
header("Location:".$url."");
|
||||
exit;
|
||||
}else{
|
||||
$error_message = $ueuse_result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
require('../logout/logout.php');
|
||||
|
||||
|
||||
@@ -148,6 +100,7 @@ $pdo = null;
|
||||
<script src="../js/unsupported.js"></script>
|
||||
<script src="../js/console_notice.js"></script>
|
||||
<script src="../js/nsfw_event.js"></script>
|
||||
<script src="../js/view_function.js"></script>
|
||||
<link rel="manifest" href="../manifest/manifest.json" />
|
||||
<script>
|
||||
if ("serviceWorker" in navigator) {
|
||||
@@ -231,6 +184,9 @@ if ("serviceWorker" in navigator) {
|
||||
<?php endif; ?>
|
||||
<?php if(!($role ==="ice")){?>
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
<div class="send_progress">
|
||||
<div class="per"></div>
|
||||
</div>
|
||||
<div class="sendbox">
|
||||
<textarea id="ueuse" placeholder="いまどうしてる?" name="ueuse"><?php if( !empty($ueuse) ){ echo safetext($ueuse); } ?></textarea>
|
||||
|
||||
@@ -269,7 +225,7 @@ if ("serviceWorker" in navigator) {
|
||||
|
||||
<div class="moji_cnt" id="moji_cnt"><?php echo safetext($mojisize); ?></div>
|
||||
|
||||
<input type="submit" class="ueusebtn" id='ueusebtn' name="btn_submit" value="ユーズする">
|
||||
<input type="button" class="ueusebtn" id='ueusebtn' value="ユーズする">
|
||||
</div>
|
||||
|
||||
<div class="harmful_notice" id="harmful_ueuse_warn" style="display:none;">
|
||||
@@ -368,6 +324,7 @@ if ("serviceWorker" in navigator) {
|
||||
$(document).ready(function() {
|
||||
var userid = '<?php echo $userid; ?>';
|
||||
var account_id = '<?php echo $loginid; ?>';
|
||||
view_ueuse_init(userid, account_id);
|
||||
|
||||
var pageNumber = 1;
|
||||
var isLoading = false;
|
||||
@@ -419,18 +376,18 @@ $(document).ready(function() {
|
||||
$("#loading").show();
|
||||
if (mode == "local") {
|
||||
$.ajax({
|
||||
url: '../nextpage/nextpage.php', // PHPファイルへのパス
|
||||
method: 'GET',
|
||||
url: '../nextpage/localtimeline.php',
|
||||
method: 'POST',
|
||||
data: { page: pageNumber, userid: userid, account_id: account_id },
|
||||
dataType: 'html',
|
||||
dataType: 'json',
|
||||
timeout: 300000,
|
||||
success: function(response) {
|
||||
$('#postContainer').append(response);
|
||||
renderUeuses(response);
|
||||
pageNumber++;
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
},
|
||||
error: function(xhr, textStatus, errorThrown) { // エラーと判定された場合
|
||||
error: function(xhr, textStatus, errorThrown) {
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
$("#error").show();
|
||||
@@ -438,18 +395,18 @@ $(document).ready(function() {
|
||||
});
|
||||
} else if (mode == "follow") {
|
||||
$.ajax({
|
||||
url: '../nextpage/ftlpage.php', // PHPファイルへのパス
|
||||
method: 'GET',
|
||||
url: '../nextpage/followtimeline.php',
|
||||
method: 'POST',
|
||||
data: { page: pageNumber, userid: userid, account_id: account_id },
|
||||
dataType: 'html',
|
||||
dataType: 'json',
|
||||
timeout: 300000,
|
||||
success: function(response) {
|
||||
$('#postContainer').append(response);
|
||||
renderUeuses(response);
|
||||
pageNumber++;
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
},
|
||||
error: function(xhr, textStatus, errorThrown) { // エラーと判定された場合
|
||||
error: function(xhr, textStatus, errorThrown) {
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
$("#error").show();
|
||||
@@ -457,18 +414,18 @@ $(document).ready(function() {
|
||||
});
|
||||
} else if (mode == "foryou") {
|
||||
$.ajax({
|
||||
url: '../nextpage/foryoupage.php', // PHPファイルへのパス
|
||||
method: 'GET',
|
||||
url: '../nextpage/foryoutimeline.php',
|
||||
method: 'POST',
|
||||
data: { page: pageNumber, userid: userid, account_id: account_id },
|
||||
dataType: 'html',
|
||||
dataType: 'json',
|
||||
timeout: 300000,
|
||||
success: function(response) {
|
||||
$('#postContainer').append(response);
|
||||
renderUeuses(response);
|
||||
pageNumber++;
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
},
|
||||
error: function(xhr, textStatus, errorThrown) { // エラーと判定された場合
|
||||
error: function(xhr, textStatus, errorThrown) {
|
||||
isLoading = false;
|
||||
$("#loading").hide();
|
||||
$("#error").show();
|
||||
@@ -478,6 +435,7 @@ $(document).ready(function() {
|
||||
}
|
||||
|
||||
$("#timeline_foryou").on('click', function(event) {
|
||||
if (isLoading) return;
|
||||
$('#timeline_foryou').addClass('on');
|
||||
$('#timeline_local').removeClass('on');
|
||||
$('#timeline_follow').removeClass('on');
|
||||
@@ -491,6 +449,7 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
$("#timeline_local").on('click', function(event) {
|
||||
if (isLoading) return;
|
||||
$('#timeline_foryou').removeClass('on');
|
||||
$('#timeline_local').addClass('on');
|
||||
$('#timeline_follow').removeClass('on');
|
||||
@@ -504,6 +463,7 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
$("#timeline_follow").on('click', function(event) {
|
||||
if (isLoading) return;
|
||||
$('#timeline_foryou').removeClass('on');
|
||||
$('#timeline_local').removeClass('on');
|
||||
$('#timeline_follow').addClass('on');
|
||||
@@ -533,6 +493,77 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
var isSending = false;
|
||||
$('#ueusebtn').on('click', function() {
|
||||
if (isSending) return;
|
||||
isSending = true;
|
||||
|
||||
var percentComplete = 0;
|
||||
var scaledPercent = 0;
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('userid', userid); // ユーザーID
|
||||
formData.append('account_id', account_id); // アカウントID
|
||||
|
||||
formData.append('ueuse', $("#ueuse").val());
|
||||
formData.append('nsfw_chk', $("#nsfw_chk").is(':checked') ? "true" : "false");
|
||||
|
||||
var photo1 = $('#upload_images').prop('files')[0];
|
||||
var photo2 = $('#upload_images2').prop('files')[0];
|
||||
var photo3 = $('#upload_images3').prop('files')[0];
|
||||
var photo4 = $('#upload_images4').prop('files')[0];
|
||||
var video1 = $('#upload_videos1').prop('files')[0];
|
||||
|
||||
if (photo1) formData.append('upload_images', photo1);
|
||||
if (photo2) formData.append('upload_images2', photo2);
|
||||
if (photo3) formData.append('upload_images3', photo3);
|
||||
if (photo4) formData.append('upload_images4', photo4);
|
||||
if (video1) formData.append('upload_videos1', video1);
|
||||
$(".send_progress").show();
|
||||
$.ajax({
|
||||
url: '../function/ueuse.php',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
dataType: 'json',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
xhr: function() {
|
||||
var myXhr = $.ajaxSettings.xhr();
|
||||
if (myXhr.upload) {
|
||||
myXhr.upload.addEventListener('progress', function(event) {
|
||||
if (event.lengthComputable) {
|
||||
percentComplete = (event.loaded / event.total) * 100;
|
||||
scaledPercent = Math.min((percentComplete * 0.99), 99);
|
||||
$(".send_progress").children(".per").css("width", scaledPercent + "%");
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
return myXhr;
|
||||
},
|
||||
success: function(response) {
|
||||
if(response.success == true){
|
||||
scaledPercent = 100;
|
||||
$(".send_progress").children(".per").css("width", scaledPercent + "%");
|
||||
|
||||
document.cookie = "ueuse=; Secure; SameSite=Lax; path=/home;";
|
||||
isSending = false;
|
||||
window.location.href = "<?php echo $url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];?>";
|
||||
}else{
|
||||
scaledPercent = 0;
|
||||
$(".send_progress").children(".per").css("width", scaledPercent + "%");
|
||||
view_notify(response.error);
|
||||
isSending = false;
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
scaledPercent = 0;
|
||||
$(".send_progress").children(".per").css("width", scaledPercent + "%");
|
||||
view_notify("ユーズの送信に失敗しました。");
|
||||
isSending = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '.favbtn, .favbtn_after', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
@@ -640,11 +671,11 @@ $(document).ready(function() {
|
||||
if (response.success) {
|
||||
postElement.remove();
|
||||
} else {
|
||||
// 削除失敗時の処理
|
||||
view_notify("ユーズの削除に失敗しました");
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
// エラー時の処理
|
||||
view_notify("ユーズの削除に失敗しました。");
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -703,9 +734,11 @@ $(document).ready(function() {
|
||||
if (response.success) {
|
||||
abimodal.style.display = 'none';
|
||||
postAbiElement.remove();
|
||||
view_notify("ユーズに追記しました");
|
||||
} else {
|
||||
abimodal.style.display = 'none';
|
||||
postAbiElement.remove();
|
||||
view_notify("追記に失敗しました");
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
|
||||
Reference in New Issue
Block a user