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

import release v1.1.3

This commit is contained in:
Ryo Kanbayashi
2023-08-17 19:38:56 +09:00
parent 3f835cc697
commit f6417823af
71 changed files with 13028 additions and 0 deletions
+474
View File
@@ -0,0 +1,474 @@
##### Windows
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
##### Linux
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
##### MacOS
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
##### Backup
*.bak
*.gho
*.ori
*.orig
*.tmp
##### GPG
secring.*
##### Dropbox
# Dropbox settings and caches
.dropbox
.dropbox.attr
.dropbox.cache
##### SynopsysVCS
# Waveform formats
*.vcd
*.vpd
*.evcd
*.fsdb
# Default name of the simulation executable. A different name can be
# specified with this switch (the associated daidir database name is
# also taken from here): -o <path>/<filename>
simv
# Generated for Verilog and VHDL top configs
simv.daidir/
simv.db.dir/
# Infrastructure necessary to co-simulate SystemC models with
# Verilog/VHDL models. An alternate directory may be specified with this
# switch: -Mdir=<directory_path>
csrc/
# Log file - the following switch allows to specify the file that will be
# used to write all messages from simulation: -l <filename>
*.log
# Coverage results (generated with urg) and database location. The
# following switch can also be used: urg -dir <coverage_directory>.vdb
simv.vdb/
urgReport/
# DVE and UCLI related files.
DVEfiles/
ucli.key
# When the design is elaborated for DirectC, the following file is created
# with declarations for C/C++ functions.
vc_hdrs.h
##### SVN
.svn/
##### Mercurial
.hg/
.hgignore
.hgsigs
.hgsub
.hgsubstate
.hgtags
##### Bazaar
.bzr/
.bzrignore
##### CVS
/CVS/*
**/CVS/*
.cvsignore
*/.cvsignore
##### TortoiseGit
# Project-level settings
/.tgitconfig
##### PuTTY
# Private key
*.ppk
##### Vim
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Session
Session.vim
Sessionx.vim
# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~
##### Emacs
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
# Org-mode
.org-id-locations
*_archive
# flymake-mode
*_flymake.*
# eshell files
/eshell/history
/eshell/lastdir
# elpa packages
/elpa/
# reftex files
*.rel
# AUCTeX auto folder
/auto/
# cask packages
.cask/
dist/
# Flycheck
flycheck_*.el
# server auth directory
/server/
# projectiles files
.projectile
# directory configuration
.dir-locals.el
# network security
/network-security.data
##### SublimeText
# Cache files for Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
# Workspace files are user-specific
*.sublime-workspace
# Project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using Sublime Text
# *.sublime-project
# SFTP configuration file
sftp-config.json
sftp-config-alt*.json
# Package control specific files
Package Control.last-run
Package Control.ca-list
Package Control.ca-bundle
Package Control.system-ca-bundle
Package Control.cache/
Package Control.ca-certs/
Package Control.merged-ca-bundle
Package Control.user-ca-bundle
oscrypto-ca-bundle.crt
bh_unicode_properties.cache
# Sublime-github package stores a github token in this file
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings
##### Notepad++
# Notepad++ backups #
*.bak
##### TextMate
*.tmproj
*.tmproject
tmtags
##### VisualStudioCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
##### NetBeans
**/nbproject/private/
**/nbproject/Makefile-*.mk
**/nbproject/Package-*.bash
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
##### JetBrains
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
##### Eclipse
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# CDT- autotools
.autotools
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# Annotation Processing
.apt_generated/
.apt_generated_test/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
# Uncomment this line if you wish to ignore the project description file.
# Typically, this file would be tracked if it contains build/dependency configurations:
#.project
##### Dreamweaver
# DW Dreamweaver added files
_notes
_compareTemp
configs/
dwsync.xml
dw_php_codehinting.config
*.mno
##### CodeKit
# General CodeKit files to ignore
config.codekit
config.codekit3
/min
##### Gradle
.gradle
**/build/
!src/**/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
##### Composer
composer.phar
/vendor/
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
composer.lock
##### PHP CodeSniffer
# gitignore for the PHP Codesniffer framework
# website: https://github.com/squizlabs/PHP_CodeSniffer
#
# Recommended template: PHP.gitignore
/wpcs/*
##### SASS
.sass-cache/
*.css.map
*.sass.map
*.scss.map
+17
View File
@@ -0,0 +1,17 @@
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]
RewriteBase /
RewriteRule ^(@\w+)$ /user/index.php?uwuzuid=$1 [QSA,L]
RewriteRule ^!(\w+)~(\w+)$ /ueuse/index.php?ueuseid=$1&touser=$2 [QSA,L]
ErrorDocument 400 /errorpage/400.php
ErrorDocument 401 /errorpage/401.php
ErrorDocument 403 /errorpage/403.php
ErrorDocument 404 /errorpage/404.php
ErrorDocument 500 /errorpage/500.php
ErrorDocument 503 /errorpage/503.php
+40
View File
@@ -0,0 +1,40 @@
<?php
require('../db.php');
if (isset($_POST['uniqid']) && isset($_POST['abitext'])) {
$postUniqid = $_POST['uniqid'];
$abitext = $_POST['abitext'];
$abidate = date("Y-m-d H:i:s");
try {
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS);
$pdo->beginTransaction();
$stmt = $pdo->prepare("UPDATE ueuse SET abi = :abi, abidate = :abidate WHERE uniqid = :uniqid");
$stmt->bindValue(':abi', $abitext, PDO::PARAM_STR);
$stmt->bindValue(':abidate', $abidate, PDO::PARAM_STR);
$stmt->bindValue(':uniqid', $postUniqid, PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->execute();
// コミット
$pdo->commit();
if ($res) {
header('Content-Type: application/json');
echo json_encode(['success' => true]);
exit;
} else {
header('Content-Type: application/json');
echo json_encode(['success' => false, 'error' => '追加に失敗しました。']);
exit;
}
} catch(PDOException $e) {
header('Content-Type: application/json');
echo json_encode(['success' => false, 'error' => 'データベースエラー:' . $e->getMessage()]);
exit;
}
}
?>
+75
View File
@@ -0,0 +1,75 @@
<?php
if(isset($_GET['userid'])) {
$search = $_GET['userid'];
require('../db.php');
$datetime = array();
$pdo = null;
session_start();
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();
}
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,
));
$userQuery = $pdo->prepare("SELECT username,profile,datetime,follow,follower FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $search);
$userQuery->execute();
$userdata = $userQuery->fetch();
}
if (empty($userdata)){
$response = array(
'error_code' => "userid_not_found",
);
}else{
$followcnts = explode(',', $userdata["follow"]);
$userdata["follow_cnt"] = count($followcnts)-1;
$followercnts = explode(',', $userdata["follower"]);
$userdata["follower_cnt"] = count($followercnts)-1;
$response = array(
'user_name' => $userdata["username"],
'profile' => $userdata["profile"],
'registered_date' => $userdata["datetime"],
'follow' => $userdata["follow"],
'follow_cnt' => $userdata["follow_cnt"],
'follower' => $userdata["follower"],
'follower_cnt' => $userdata["follower_cnt"],
);
}
echo json_encode($response);
}else{
$err = "input_not_found";
$response = array(
'error_code' => $err,
);
echo json_encode($response);
}
?>
+225
View File
@@ -0,0 +1,225 @@
<?php
$servernamefile = "server/servername.txt";
require('db.php');
// 変数の初期化
$current_date = null;
$message_array = array();
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
$error_message = array();
$row["userid"] = array();
$row["password"] = array();
$ruserid = array();
$rpassword = array();
$userid = null;
$_SESSION["userid"]="";
$password = null;
$_SESSION["password"]="";
session_start();
// 管理者としてログインしているか確認
if( empty($_SESSION['admin_login']) || $_SESSION['admin_login'] !== true ) {
// ログインページへリダイレクト
header("Location: ./login.php");
exit;
}
// データベースに接続
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);
//$row['userid'] = "daichimarukn";
$userid = $_SESSION['userid'];
$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);
$result = $dbh->prepare("SELECT userid, username, profile, role FROM account WHERE userid = :userid");
$result->bindValue(':userid', $userid);
// SQL実行
$result->execute();
$row = $result->fetch(); // ここでデータベースから取得した値を $row に代入する
$username = $row["username"];
$role = $row["role"];
//--------------------------------------
$userQuery = $dbh->prepare("SELECT username, userid, loginid, profile, role FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $userid);
$userQuery->execute();
$userData = $userQuery->fetch();
$roles = explode(',', $userData["role"]); // カンマで区切られたロールを配列に分割
$roleDataArray = array();
foreach ($roles as $roleId) {
$rerole = $dbh->prepare("SELECT rolename, roleauth, rolecolor FROM role WHERE roleidname = :role");
$rerole->bindValue(':role', $roleId);
$rerole->execute();
$roleDataArray[$roleId] = $rerole->fetch();
}
} catch(PDOException $e) {
// 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage();
}
if( !empty($_POST['btn_submit']) ) {
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['loginid'] = $userData["loginid"];
$_SESSION['username'] = $username;
$_SESSION['password'] = "";
// リダイレクト先のURLへ転送する
$url = '/home';
header('Location: ' . $url, true, 303);
// すべての出力を終了
exit;
}
if( !empty($_POST['btn_submit2']) ) {
$_SESSION['admin_login'] = false;
$_SESSION['userid'] = "";
$_SESSION['username'] = "";
// リダイレクト先のURLへ転送する
$url = 'index.php';
header('Location: ' . $url, true, 303);
// すべての出力を終了
exit;
}
// データベースの接続を閉じる
$pdo = null;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/style.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="favicon/icon-192x192.png">
<title>確認 - <?php echo file_get_contents($servernamefile);?></title>
</head>
<script src="js/back.js"></script>
<body>
<div class="leftbox">
<div class="logo">
<img src="img/uwuzulogo.svg">
</div>
<div class="textbox">
<h1>確認</h1>
<p>あなたは <?php if( !empty($row["username"]) ){ echo htmlspecialchars( $row["username"], ENT_QUOTES, 'UTF-8'); } ?> ですか?</p>
<?php if( !empty($error_message) ): ?>
<ul class="errmsg">
<?php foreach( $error_message as $value ): ?>
<p>・ <?php echo $value; ?></p>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<div class="myarea">
<img src="image.php">
<p>名前</p>
<h2><?php if( !empty($row["username"]) ){ echo htmlspecialchars( $row["username"], ENT_QUOTES, 'UTF-8'); } ?></h2>
<div class="roleboxes">
<?php foreach ($roles as $roleId): ?>
<?php $roleData = $roleDataArray[$roleId]; ?>
<div class="rolebox" style="border: 1px solid <?php echo '#' . $roleData["rolecolor"]; ?>;">
<p style="color: <?php echo '#' . $roleData["rolecolor"]; ?>;">
<?php if (!empty($roleData["rolename"])) { echo htmlspecialchars($roleData["rolename"], ENT_QUOTES, 'UTF-8'); } ?>
</p>
</div>
<?php endforeach; ?>
</div>
<hr>
<p>プロフィール</p>
<h3><?php if( !empty($row["profile"]) ){ echo htmlspecialchars( $row["profile"], ENT_QUOTES, 'UTF-8'); } ?></h3>
</div>
<form id ="form1" method="post" class="btnbox">
<input type="submit" name="btn_submit" class="irobutton" value="はい">
<input type="submit" name="btn_submit2" class="sirobutton" value="いいえ">
</div>
</div>
</div>
<script type="text/javascript">
<!--
function checkForm($this)
{
var str=$this.value;
while(str.match(/[^A-Z^a-z\d\-]/))
{
str=str.replace(/[^A-Z^a-z\d\-]/,"");
}
$this.value=str;
}
//-->
</script>
</body>
</html>
+3501
View File
File diff suppressed because it is too large Load Diff
+855
View File
@@ -0,0 +1,855 @@
@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');
body{
display: flex;
border: none;
margin-top: 0px;
margin-bottom: 0px;
margin-left: auto;
margin-right: 0px;
background-color: #FFFFFF;
/* 画像を常に天地左右の中央に配置 */
background-position: center center;
/* 画像をタイル状に繰り返し表示しない */
background-repeat: no-repeat;
/* コンテンツの高さが画像の高さより大きい時、動かないように固定 */
background-attachment: fixed;
/* 表示するコンテナの大きさに基づいて、背景画像を調整 */
background-size: cover;
}
.leftbox{
margin-top: 0px;
margin-bottom: 0px;
background-color: #FFC832;
width: 35%;
height: 100%;
margin-left: 0px;
padding: 32px;
}
.leftbox h1{
margin-left: 20px;
color:#fff;
font-size: 2em;
}
.leftbox .logo{
display: flex;
}
.leftbox .logo img{
margin-left: 16px;
margin-top: 16px;
width: 200px;
}
.leftbox .logo p{
color:#fff;
font-family: 'BIZ UDPGothic', sans-serif;
font-weight: bold;
font-size: 32px;
margin-left: 8px;
margin-top: auto;
margin-bottom: -4px;
}
.leftbox2{
margin-top: 0px;
margin-bottom: 0px;
background-color: #FFC832;
width: 35%;
height: 100vh;
margin-left: 0px;
padding: 32px;
}
.leftbox2 h1{
margin-left: 20px;
color:#fff;
font-size: 2em;
}
.leftbox2 .logo{
display: flex;
}
.leftbox2 .logo img{
margin-left: 16px;
margin-top: 16px;
width: 200px;
}
.leftbox2 .logo p{
color:#fff;
font-family: 'BIZ UDPGothic', sans-serif;
font-weight: bold;
font-size: 32px;
margin-left: 8px;
margin-top: auto;
margin-bottom: -4px;
}
.textbox{
padding: 32px;
width: auto;
margin-left: 24px;
margin-right: 24px;
margin-top: 64px;
margin-bottom: 100px;
border-radius: 25px;
background-color: #fff;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
}
.textbox h1{
word-wrap: break-word;
margin: 0px;
color: #FFC832;
font-size: 32px;
font-family: 'Zen Maru Gothic', sans-serif;
}
.textbox h2{
word-wrap: break-word;
margin: 0px;
color: #252525;
text-align: center;
font-size: 32px;
font-family: 'Zen Maru Gothic', sans-serif;
}
.textbox h3{
word-wrap: break-word;
margin: 0px;
color: #252525;
text-align: center;
font-size: 18px;
font-family: 'Zen Maru Gothic', sans-serif;
font-weight: normal;
}
.textbox p{
word-wrap: break-word;
line-height: 20px;
color: #252525;
font-size: 16px;
font-family: 'BIZ UDPGothic', sans-serif;
font-weight: normal;
}
.textbox .p2{
margin-top: 0px;
margin-bottom: 10px;
word-wrap: break-word;
line-height: 20px;
color: #868686;
font-size: 12px;
font-family: 'BIZ UDPGothic', sans-serif;
font-weight: normal;
}
.textbox .p2c{
margin-top: 0px;
margin-bottom: 10px;
text-align: center;
word-wrap: break-word;
line-height: 20px;
color: #868686;
font-size: 12px;
font-family: 'BIZ UDPGothic', sans-serif;
font-weight: normal;
}
.textbox .p3{
margin-top: 24px;
text-align: center;
word-wrap: break-word;
line-height: 24px;
color: #252525;
font-size: 22px;
font-family: 'BIZ UDPGothic', sans-serif;
font-weight: bold;
}
.textbox .maillink{
word-wrap: break-word;
line-height: 20px;
color: #4e4428;
text-decoration: none;
font-size: 16px;
font-family: 'BIZ UDPGothic', sans-serif;
font-weight: normal;
}
.textbox .cntzone{
display: flex;
width: 100%;
padding: 0px;
}
.textbox .cntzone .usercnt{
margin-top: 24px;
margin-left: 12px;
margin-right: 12px;
width: 43%;
height: 5dvh;
border-radius: 15px;
background-color: #FFFAE6;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05) inset;
padding: 18px;
}
.textbox .cntzone .usercnt .p1{
display: block;
margin-top: 0px;
margin-bottom: 6px;
text-align: left;
word-wrap: break-word;
color: #868686;
font-size: 12px;
font-family: 'BIZ UDPGothic', sans-serif;
font-weight: normal;
}
.textbox .cntzone .usercnt p{
margin-top: 0px;
margin-bottom: 8px;
text-align: left;
word-wrap: break-word;
line-height: 24px;
color: #252525;
font-size: 20px;
font-family: 'BIZ UDPGothic', sans-serif;
font-weight: bold;
}
.btnbox{
padding-top: 16px;
padding-bottom: 16px;
padding-left: 32px;
padding-right: 32px;
border-radius: 15px;
background-color: #f7f7f7;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05) inset;
margin-top: 32px;
text-align: center;
margin-left: auto;
margin-right: auto;
}
label > input {
display:none; /* アップロードボタンのスタイルを無効にする */
}
.irobutton{
cursor: pointer;
border: none;
display: block;
width:40%;
margin: 32px;
padding: 8px 10%;
margin-left: auto;
margin-right: auto;
padding-top: 8px;
padding-bottom: 8px;
background-color: #FFC832;
text-align: center;
border-radius: 50px;
color:#fff;
font-size: 22px;
font-family: 'Zen Maru Gothic', 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;
}
.irobutton:hover{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
width:45%;
}
.irobutton:active{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
width:35%;
}
.sirobutton{
cursor: pointer;
border: none;
display: block;
width:40%;
margin: 32px;
padding: 8px 10%;
margin-left: auto;
margin-right: auto;
padding-top: 8px;
padding-bottom: 8px;
text-align: center;
background-color: #FFFAE6;
border-radius: 50px;
color:#FFC832;
font-size: 22px;
font-family: 'Zen Maru Gothic', 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;
}
.sirobutton:hover{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
width:45%;
}
.sirobutton:active{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
width:45%;
}
.formarea{
padding-top: 16px;
padding-bottom: 16px;
padding-left: 32px;
padding-right: 32px;
border-radius: 15px;
background-color: #f7f7f7;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05) inset;
margin-top: 64px;
text-align: left;
margin-left: auto;
margin-right: auto;
}
.formarea .iconimg{
margin-left: auto;
margin-right: auto;
text-align: center;
}
.formarea .iconimg img{
margin-left: auto;
margin-right: auto;
text-align: center;
width: 100px;
height:100px;
border-radius: 50%;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
}
.myarea{
padding-top: 16px;
padding-bottom: 32px;
padding-left: 32px;
padding-right: 32px;
border-radius: 15px;
background-color: #f7f7f7;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05) inset;
margin-top: 64px;
text-align: center;
margin-left: auto;
margin-right: auto;
}
.myarea img{
margin-left: auto;
margin-right: auto;
text-align: center;
width: 100px;
height:100px;
border-radius: 50%;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
}
.myarea p{
margin-top: 32px;
margin-bottom: 10px;
word-wrap: break-word;
line-height: 20px;
color: #868686;
font-size: 12px;
font-family: 'BIZ UDPGothic', sans-serif;
font-weight: normal;
}
.inbox {
width: 96%;
padding: 8px 10px;
border: none;
border-radius: 10px;
background: #fff;
font-family: 'Zen Maru Gothic', sans-serif;
color: rgb(32,32,32);
font-size: 1em;
line-height: 1.5;
white-space: nowrap;
box-shadow:0px 0px 25px rgba(0,0,0,0.05) inset;
box-shadow:0px 0px 25px rgba(0,0,0,0.07);
overflow-x: scroll;
overflow-y : scroll ;
transition: border 350ms ease-in-out;
transition: border-bottom 150ms ease-out;
border: 1px solid #f1f1f1;
}
.inbox::placeholder {
color: #999;
}
.inbox:hover {
outline: none;
border: 1px solid #FFC832;
}
.inbox:focus {
outline: none;
border: 1px solid #FFC832;
border-bottom: 3px solid #FFC832;
}
.errmsg{
padding-top: 16px;
padding-bottom: 16px;
padding-left: 32px;
padding-right: 32px;
border-radius: 15px;
background-color: #ffebeb;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05) inset;
margin-top: 64px;
text-align: left;
margin-left: auto;
margin-right: auto;
color:#ff4848;
font-family: 'BIZ UDPGothic', sans-serif;
word-wrap: break-word;
line-height: 20px;
border: 1px solid #FF4848;
}
.flexbtn{
display: flex;
}
.flexbtn .irobutton{
border: none;
display: block;
width:20%;
margin: 32px;
padding: 8px 10%;
margin-left: auto;
margin-right: auto;
padding-top: 8px;
padding-bottom: 8px;
background-color: #FFC832;
border-radius: 50px;
color:#fff;
font-size: 26px;
font-family: 'Zen Maru Gothic', 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;
}
.flexbtn.irobutton:hover{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
width:55%;
}
.flexbtn.irobutton:active{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
width:45%;
}
.flexbtn.sirobutton{
border: none;
display: block;
width:50%;
margin: 32px;
padding: 8px 10%;
margin-left: auto;
margin-right: auto;
padding-top: 8px;
padding-bottom: 8px;
background-color: #FFFAE6;
border-radius: 50px;
color:#FFC832;
font-size: 26px;
font-family: 'Zen Maru Gothic', 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;
}
.flexbtn.sirobutton:hover{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
width:55%;
}
.flexbtn.sirobutton:active{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
width:45%;
}
.rolebox{
margin-top: 12px;
margin-bottom: 12px;
margin-left: auto;
margin-right: auto;
width: 120px;
padding-left: auto;
padding-right: auto;
background-color: #fff;
border: 1px solid #FFC832;
border-radius: 25px;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
}
.rolebox p{
color:#FFC832;
margin-top: 2px;
margin-bottom: 2px;
margin-left: 10px;
margin-right: 10px;
font-size: 16px;
font-family: 'Zen Maru Gothic', sans-serif;
font-weight: normal;
}
.userleftbox{
margin-top: 0px;
margin-bottom: 0px;
background-color: #FFC832;
width: 10%;
height: 100%;
margin-left: 0px;
padding: 32px;
}
.userleftbox h1{
font-family: 'Zen Maru Gothic', sans-serif;
margin-left: 20px;
color:#fff;
font-size: 32px;
}
.userleftbox .logo{
display: flex;
}
.userleftbox .logo img{
margin-left: 16px;
margin-top: 16px;
width: 72%;
}
.userleftbox .logo p{
color:#fff;
font-family: 'BIZ UDPGothic', sans-serif;
font-weight: bold;
font-size: 32px;
margin-left: 8px;
margin-top: auto;
margin-bottom: -4px;
}
.leftbutton{
cursor: pointer;
border: none;
display: block;
width:70%;
margin: 32px;
padding: 8px 10%;
margin-left: auto;
margin-right: auto;
padding-top: 8px;
padding-bottom: 8px;
background-color: #FFC832;
border-radius: 50px;
color:#FFFAE6;
font-size: 20px;
font-family: 'Zen Maru Gothic', sans-serif;
font-weight: normal;
text-decoration:none;
text-align: center;
transition: box-shadow 250ms ease-in-out;
transition: width 250ms ease-out;
transition: all 250ms ease-out;
}
.leftbutton:hover{
background-color: #FFFAE6;
color: #FFC832;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
width:75%;
}
.leftbutton:active{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
width:65%;
}
main{
border-radius: 25px;
margin-top: 24px;
margin-left: 24px;
margin-right: 24px;
width: 80%;
background-color: #fff;
padding: 24px;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
}
main h1{
color:#252525;
font-size: 32px;
font-family: 'Zen Maru Gothic', sans-serif;
}
.btn_area{
display: flex;
width: 100%;
margin-left: auto;
margin-right: auto;
}
.fbtn{
cursor: pointer;
border: none;
display: block;
width:50%;
padding: 8px auto;
margin-top: 12px;
margin-left: 12px;
margin-right: 12px;
margin-bottom: 0px;
padding-top: 6px;
padding-bottom: 6px;
background-color: #FFC832;
border-radius: 50px;
color:#FFFAE6;
font-size: 16px;
text-align: center;
font-family: 'Zen Maru Gothic', sans-serif;
font-weight: normal;
text-decoration:none;
text-align: center;
transition: box-shadow 250ms ease-in-out;
transition: width 250ms ease-out;
transition: all 250ms ease-out;
}
.fbtn:hover{
background-color: #FFC832;
color: #FFFAE6;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
width:55%;
}
.fbtn:active{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
width:45%;
}
/*------------------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------スマホ向け--------------------------------------------------*/
/*--------------------------------------------------ここから--------------------------------------------------*/
/*------------------------------------------------------------------------------------------------------------*/
@media screen and (max-width:1010px) {
body{
backdrop-filter: blur(10px);
}
.leftbox{
margin-top: 0px;
margin-bottom: 0px;
background-color: transparent;
width: 100%;
height: 100%;
margin-left: 0px;
padding: 16px;
}
.leftbox h1{
margin-left: 20px;
color:#fff;
font-size: 2em;
}
.leftbox .logo{
display: flex;
background-color: #FFC832;
border-radius: 15px;
}
.leftbox .logo img{
margin-left: 16px;
margin-top: 16px;
width: 200px;
}
.leftbox .logo p{
color:#fff;
font-family: 'BIZ UDPGothic', sans-serif;
font-weight: bold;
font-size: 32px;
margin-left: 8px;
margin-top: auto;
margin-bottom: -4px;
}
.textbox{
padding: 32px;
width: auto;
margin-left: 0px;
margin-right: 0px;
margin-top: 64px;
margin-bottom: 8px;
border-radius: 25px;
background-color: #fff;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .15);
}
.textbox h1{
word-wrap: break-word;
margin: 0px;
color: #FFC832;
font-size: 32px;
font-family: 'Zen Maru Gothic', sans-serif;
}
.btnbox{
padding-top: 12px;
padding-bottom: 12px;
padding-left: 12px;
padding-right: 12px;
border-radius: 15px;
background-color: #f7f7f7;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05) inset;
margin-top: 32px;
text-align: center;
margin-left: auto;
margin-right: auto;
}
.irobutton{
width:60%;
}
.irobutton:hover{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
width:65%;
}
.irobutton:active{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
width:55%;
}
.sirobutton{
width:60%;
}
.sirobutton:hover{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
width:65%;
}
.sirobutton:active{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
width:55%;
}
.btn_area{
display: block;
width: 100%;
margin-left: auto;
margin-right: auto;
}
.fbtn{
cursor: pointer;
border: none;
display: block;
width:50%;
padding: 8px auto;
margin-top: 12px;
margin-left: 12px;
margin-right: 12px;
margin-bottom: 0px;
padding-top: 12px;
padding-bottom: 12px;
background-color: #FFC832;
border-radius: 50px;
color:#FFFAE6;
font-size: 16px;
text-align: center;
font-family: 'Zen Maru Gothic', sans-serif;
font-weight: normal;
text-decoration:none;
text-align: center;
transition: box-shadow 250ms ease-in-out;
transition: width 250ms ease-out;
transition: all 250ms ease-out;
}
.fbtn:hover{
background-color: #FFC832;
color: #FFFAE6;
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .2);
width:55%;
}
.fbtn:active{
box-shadow:0 0px 48px 0 rgba(0, 0, 0, .05);
width:45%;
}
.leftbox2{
margin-top: 0px;
margin-bottom: 0px;
background-color: #FFC832;
width: 100%;
height: 100vh;
margin-left: 0px;
padding: 32px;
}
}
+9
View File
@@ -0,0 +1,9 @@
<?php // データベースの接続情報
define( 'DB_HOST', 'localhost');
define( 'DB_USER', 'root');
define( 'DB_PASS', 'root');
define( 'DB_NAME', 'uwuzu');
// タイムゾーン設定
date_default_timezone_set('Asia/Tokyo');
?>
+27
View File
@@ -0,0 +1,27 @@
<?php
require('../db.php');
if (isset($_POST['uniqid'])){
$postUniqid = $_POST['uniqid'];
try {
$pdo = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS);
// 削除クエリを実行
$deleteQuery = $pdo->prepare("DELETE FROM ueuse WHERE uniqid = :uniqid");
$deleteQuery->bindValue(':uniqid', $postUniqid, PDO::PARAM_STR);
$res = $deleteQuery->execute();
if ($res) {
echo json_encode(['success' => true]);
exit;
} else {
echo json_encode(['success' => false, 'error' => '削除に失敗しました。']);
exit;
}
} catch(PDOException $e) {
echo json_encode(['success' => false, 'error' => 'データベースエラー:' . $e->getMessage()]);
exit;
}
}
?>
+360
View File
@@ -0,0 +1,360 @@
<?php
$servernamefile = "../server/servername.txt";
function createUniqId(){
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime,10,36);
}
require('../db.php');
// 変数の初期化
$datetime = array();
$user_name = null;
$message = array();
$message_data = null;
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
session_start();
$userid = $_SESSION['userid'];
$username = $_SESSION['username'];
try {
$option = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
);
$pdo = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
} catch(PDOException $e) {
// 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage();
}
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_SESSION['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_SESSION['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_COOKIE['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
$username = $_COOKIE['username']; // クッキーから取得した値をセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} else {
// ログインが許可されていない場合、ログインページにリダイレクト
header("Location: ../login.php");
exit;
}
if(empty($userid)){
header("Location: ../login.php");
exit;
}
if(empty($username)){
header("Location: ../login.php");
exit;
}
if(!($res["admin"] === "yes")){
header("Location: ../login.php");
exit;
}
if( !empty($pdo) ) {
// データベース接続の設定
$dbh = new PDO('mysql:charset=UTF8;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,
));
$userQuery = $dbh->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $userid);
$userQuery->execute();
$userData = $userQuery->fetch();
$role = $userData["role"];
$dbh = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
$rerole = $dbh->prepare("SELECT username, userid, password, mailadds, profile, iconname, iconcontent, icontype, iconsize, headname, headcontent, headtype, headsize, role, datetime FROM account WHERE userid = :userid");
$rerole->bindValue(':userid', $userid);
// SQL実行
$rerole->execute();
$userdata = $rerole->fetch(); // ここでデータベースから取得した値を $role に代入する
}
if( !empty($_POST['btn_submit']) ) {
$emojiname = $_POST['emojiname'];
$emojiinfo = $_POST['emojiinfo'];
if (!empty($_FILES['image']['name'])) {
$img = $_FILES['image'];
}else{
$error_message[] = '画像を選択してください~';
}
$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=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
$query = $dbh->prepare('SELECT * FROM emoji WHERE emojiname = :emojiname limit 1');
$query->execute(array(':emojiname' => $emojiname));
$result = $query->fetch();
// IDの入力チェック
if( empty($emojiname) ) {
$error_message[] = '絵文字IDを入力してください!';
} else {
// 文字数を確認
if( 20 < mb_strlen($emojiname, 'UTF-8') ) {
$error_message[] = 'IDは20文字以内で入力してください。';
}
if($result > 0){
$error_message[] = 'このID('.$emojiname.')は既に使用されています。他のIDを作成してください。'; //このE-mailは既に使用されています。
}
}
if( empty($error_message) ) {
// 書き込み日時を取得
$datetime = date("Y-m-d H:i:s");
// トランザクション開始
$pdo->beginTransaction();
try {
// SQL作成
$stmt = $pdo->prepare("INSERT INTO emoji (emojifile, emojitype, emojicontent, emojisize, emojiname, emojiinfo, emojidate) VALUES ( :emojifile, :emojitype, :emojicontent, :emojisize, :emojiname, :emojiinfo, :emojidate)");
$name = $img['name'];
$type = $img['type'];
$content = file_get_contents($img['tmp_name']);
$size = $img['size'];
$stmt->bindValue(':emojifile', $name, PDO::PARAM_STR);
$stmt->bindValue(':emojitype', $type, PDO::PARAM_STR);
$stmt->bindValue(':emojicontent', $content, PDO::PARAM_STR);
$stmt->bindValue(':emojisize', $size, PDO::PARAM_INT);
// 値をセット
$stmt->bindParam( ':emojiname', $emojiname, PDO::PARAM_STR);
$stmt->bindParam( ':emojiinfo', $emojiinfo, PDO::PARAM_STR);
$stmt->bindParam( ':emojidate', $datetime, PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->execute();
// コミット
$res = $pdo->commit();
} catch(Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
if( $res ) {
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location:".$url."");
exit;
} else {
$error_message[] = '登録に失敗しました。';
}
// プリペアドステートメントを削除
$stmt = null;
}
}
if( !empty($_POST['logout']) ) {
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($name, '', time()-1000, '/');
}
}
// リダイレクト先のURLへ転送する
$url = '../index.php';
header('Location: ' . $url, true, 303);
// すべての出力を終了
exit;
}
// データベースの接続を閉じる
$pdo = null;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<title>絵文字登録 - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<?php require('../require/leftbox.php');?>
<main>
<?php if( !empty($error_message) ): ?>
<ul class="errmsg">
<?php foreach( $error_message as $value ): ?>
<p>・ <?php echo $value; ?></p>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<form class="formarea" enctype="multipart/form-data" method="post">
<h1>絵文字登録</h1>
<p>絵文字登録です。</p>
<div id="wrap">
<label class="irobutton" for="file_upload">ファイル選択
<input type="file" id="file_upload" name="image" >
</label>
</div>
<!--ユーザーネーム関係-->
<div>
<p>EmojiID</p>
<input id="username" placeholder="kusa" class="inbox" type="text" name="emojiname" value="<?php if( !empty($_SESSION['emojiname']) ){ echo htmlspecialchars( $_SESSION['emojiname'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<div>
<p>この絵文字について</p>
<input id="username" placeholder="くさデス" class="inbox" type="text" name="emojiinfo" value="<?php if( !empty($_SESSION['emojiinfo']) ){ echo htmlspecialchars( $_SESSION['emojiinfo'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<div>
<input type="submit" class = "irobutton" name="btn_submit" value="登録">
</div>
</form>
</div>
</main>
<?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?>
</body>
<script type="text/javascript">
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 = '<p>画像を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
});
file_reader.readAsText(e.target.files[0]);
});
});
</script>
</html>
+75
View File
@@ -0,0 +1,75 @@
<?php
require('../db.php');
// 変数の初期化
$current_date = null;
$message_array = array();
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
$row["userid"] = array();
$row["password"] = array();
$ruserid = array();
$rpassword = array();
$emojiname = null;
$_SESSION["emojiname"]="";
session_start();
$option = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
);
$pdo = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
//$row['userid'] = "daichimarukn";
$emojiname = $_GET['emoji'];
$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,
);
if( empty($emojiname) ) {
$filePath = 'img/deficon/icon.png';
$data = file_get_contents($filePath);
header('Content-type: image/png');
//データを出力
echo $data;
exit();
}else{
$dbh = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
$result = $dbh->prepare("SELECT emojiname, emojicontent, emojitype, emojisize profile FROM emoji WHERE emojiname = :emojiname");
$result->bindValue(':emojiname', $emojiname);
// SQL実行
$result->execute();
$row = $result->fetch(); // ここでデータベースから取得した値を $row に代入する
header('Content-type: ' . $row['emojitype']);
echo $row['emojicontent'];
exit();
}
?>
+197
View File
@@ -0,0 +1,197 @@
<?php
$servernamefile = "../server/servername.txt";
function createUniqId(){
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime,10,36);
}
require('../db.php');
// 変数の初期化
$datetime = array();
$user_name = null;
$message = array();
$message_data = null;
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
session_start();
//------------------------------------------
try {
$option = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
);
$pdo = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
} catch(PDOException $e) {
// 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage();
}
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_SESSION['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_SESSION['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_COOKIE['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
$username = $_COOKIE['username']; // クッキーから取得した値をセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} else {
// ログインが許可されていない場合、ログインページにリダイレクト
header("Location: ../login.php");
exit;
}
if(empty($userid)){
header("Location: ../login.php");
exit;
}
if(empty($username)){
header("Location: ../login.php");
exit;
}
if (!empty($pdo)) {
$sql = "SELECT emojiname,emojiinfo,emojidate FROM emoji ORDER BY emojidate DESC";
$message_array = $pdo->query($sql);
while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) {
$messages[] = $row;
}
}
if( !empty($_POST['logout']) ) {
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($name, '', time()-1000, '/');
}
}
// リダイレクト先のURLへ転送する
$url = '../index.php';
header('Location: ' . $url, true, 303);
// すべての出力を終了
exit;
}
// データベースの接続を閉じる
$pdo = null;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<link rel="stylesheet" href="../css/home.css">
<title>絵文字一覧 - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<?php require('../require/leftbox.php');?>
<main>
<?php if( !empty($error_message) ): ?>
<ul class="errmsg">
<?php foreach( $error_message as $value ): ?>
<p>・ <?php echo $value; ?></p>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<section>
<div class="emojibox">
<h1>絵文字一覧</h1>
<div class="emojizone">
<?php
if(!empty($messages)){
foreach ($messages as $value) {
echo '<div class="emjtex">';
echo '<div class="fx">';
echo '<img src="../emoji/emojiimage.php?emoji=' . urlencode($value["emojiname"]) . '">';
echo '<h3>:'.$value["emojiname"].':</h3>';
echo '</div>';
echo '<p>'.$value["emojiinfo"].'</p>';
echo '</div>';
}
}else{
echo '<div class="tokonone" id="noueuse"><p>カスタム絵文字がありません</p></div>';
}
?>
</div>
</div>
</section>
</main>
<?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?>
</body>
</html>
+54
View File
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<?php
$servernamefile = "../server/servername.txt";
//-------------------------------------
$domain = $_SERVER['HTTP_HOST'];
//------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/terms.txt";
$termsdata = file_get_contents($termsfile);
?>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>400 Bad Request - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<div class="topbox">
<div class="logo">
<img src="../img/uwuzulogo.svg">
</div>
</div>
<div class="terms">
<div class="p3"><?php echo file_get_contents($servernamefile);?></div>
<div class="p2c"><?php echo $domain;?></div>
<div class="err404">
<h1>400 Bad Request</h1>
<p><(_ _)><br>はいっ!エラーです!!!<br>原因はわかりません!!!!!!!!</p>
</div>
<a href="../home/" class="irobutton">ホームへ行く</a>
</div>
</body>
</html>
+54
View File
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<?php
$servernamefile = "../server/servername.txt";
//-------------------------------------
$domain = $_SERVER['HTTP_HOST'];
//------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/terms.txt";
$termsdata = file_get_contents($termsfile);
?>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>401 Unauthorized - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<div class="topbox">
<div class="logo">
<img src="../img/uwuzulogo.svg">
</div>
</div>
<div class="terms">
<div class="p3"><?php echo file_get_contents($servernamefile);?></div>
<div class="p2c"><?php echo $domain;?></div>
<div class="err404">
<h1>401 Unauthorized</h1>
<p>...(* ̄0 ̄)< アクセス権が無いようです()<br>サービス管理者によってアクセス権の変更をされた可能性がございます。</p>
</div>
<a href="../home/" class="irobutton">ホームへ行く</a>
</div>
</body>
</html>
+54
View File
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<?php
$servernamefile = "../server/servername.txt";
//-------------------------------------
$domain = $_SERVER['HTTP_HOST'];
//------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/terms.txt";
$termsdata = file_get_contents($termsfile);
?>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>403 Forbidden - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<div class="topbox">
<div class="logo">
<img src="../img/uwuzulogo.svg">
</div>
</div>
<div class="terms">
<div class="p3"><?php echo file_get_contents($servernamefile);?></div>
<div class="p2c"><?php echo $domain;?></div>
<div class="err404">
<h1>403 Forbidden</h1>
<p>...(* ̄0 ̄)< 閲覧権限が無いようです()<br>サービス管理者によって閲覧権限の変更をされた可能性がございます。</p>
</div>
<a href="../home/" class="irobutton">ホームへ行く</a>
</div>
</body>
</html>
+54
View File
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<?php
$servernamefile = "../server/servername.txt";
//-------------------------------------
$domain = $_SERVER['HTTP_HOST'];
//------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/terms.txt";
$termsdata = file_get_contents($termsfile);
?>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>404 Not found - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<div class="topbox">
<div class="logo">
<img src="../img/uwuzulogo.svg">
</div>
</div>
<div class="terms">
<div class="p3"><?php echo file_get_contents($servernamefile);?></div>
<div class="p2c"><?php echo $domain;?></div>
<div class="err404">
<h1>404 Not found</h1>
<p>申し訳ございませんがお探しのページは見つかりませんでした!<br>ページの移動や削除が行われた可能性がございます。</p>
</div>
<a href="../home/" class="irobutton">ホームへ行く</a>
</div>
</body>
</html>
+54
View File
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<?php
$servernamefile = "../server/servername.txt";
//-------------------------------------
$domain = $_SERVER['HTTP_HOST'];
//------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/terms.txt";
$termsdata = file_get_contents($termsfile);
?>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>500 Internal Server Error - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<div class="topbox">
<div class="logo">
<img src="../img/uwuzulogo.svg">
</div>
</div>
<div class="terms">
<div class="p3"><?php echo file_get_contents($servernamefile);?></div>
<div class="p2c"><?php echo $domain;?></div>
<div class="err404">
<h1>500 Internal Server Error</h1>
<p>(^o^)<br>サーバーオワタ☆</p>
</div>
<a href="../home/" class="irobutton">ホームへ行く</a>
</div>
</body>
</html>
+54
View File
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<?php
$servernamefile = "../server/servername.txt";
//-------------------------------------
$domain = $_SERVER['HTTP_HOST'];
//------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/terms.txt";
$termsdata = file_get_contents($termsfile);
?>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>503 Service Unavailable - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<div class="topbox">
<div class="logo">
<img src="../img/uwuzulogo.svg">
</div>
</div>
<div class="terms">
<div class="p3"><?php echo file_get_contents($servernamefile);?></div>
<div class="p2c"><?php echo $domain;?></div>
<div class="err404">
<h1>503 Service Unavailable</h1>
<p>(´。_。`;)< サーバーに過負荷がかかっているようです...<br>時間をおいてから再度アクセスしてください!</p>
</div>
<a href="../home/" class="irobutton">ホームへ行く</a>
</div>
</body>
</html>
+89
View File
@@ -0,0 +1,89 @@
<!DOCTYPE html>
<?php
$servernamefile = "../server/servername.txt";
//-------------------------------------
$domain = $_SERVER['HTTP_HOST'];
//------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/serverstop.txt";
$termsdata = file_get_contents($termsfile);
function processMarkdownAndWrapEmptyLines($markdownText) {
// コード(#code)をHTMLのdiv class="code"タグに変換
$markdownText = preg_replace('/^#code (.+)/m', '<div class="code"><p>$1</p></div>', $markdownText);
// 画像(#img)をHTMLのimgタグに変換
$markdownText = preg_replace('/^#img (.+)/m', '<img src="$1">', $markdownText);
// タイトル(#、##、###)をHTMLのhタグに変換
$markdownText = preg_replace('/^# (.+)/m', '<h2>$1</h2>', $markdownText);
$markdownText = preg_replace('/^## (.+)/m', '<h3>$1</h3>', $markdownText);
$markdownText = preg_replace('/^### (.+)/m', '<h4>$1</h4>', $markdownText);
// 箇条書き(-)をHTMLのul/liタグに変換
$markdownText = preg_replace('/^- (.+)/m', '<ul><li>$1</li></ul>', $markdownText);
// 空行の前に何もない行をHTMLのpタグに変換
$markdownText = preg_replace('/(^\s*)(?!\s)(.*)/m', '$1<p>$2</p>', $markdownText);
return $markdownText;
}
$sterms = explode("\n", $termsdata);
$htmltext = ''; // 初期化
foreach ($sterms as $terms) {
$markdowntext = $terms;
$convertedText = processMarkdownAndWrapEmptyLines($markdowntext);
$htmltext .= $convertedText . "\n"; // 変換されたテキストを追加
}
?>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>サーバー停止 - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<div class="topbox">
<div class="logo">
<img src="../img/uwuzulogo.svg">
</div>
</div>
<div class="terms">
<div class="p3"><?php echo file_get_contents($servernamefile);?></div>
<div class="p2c"><?php echo $domain;?></div>
<div class="err404">
<h1>サーバー停止中</h1>
<p>(/´・ヮ・`\)<br>現在サーバーが管理者によって停止されています...<br>停止の理由は以下の通りです。</p>
<hr>
<p><?php echo $htmltext;?></p>
</div>
</div>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

+57
View File
@@ -0,0 +1,57 @@
<?php
require('../db.php');
if (isset($_POST['uniqid']) && isset($_POST['userid'])) {
$postUniqid = $_POST['uniqid'];
$userId = $_POST['userid'];
try {
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS);
// 投稿のいいね情報を取得
$stmt = $pdo->prepare("SELECT favorite FROM ueuse WHERE uniqid = :uniqid");
$stmt->bindValue(':uniqid', $postUniqid, PDO::PARAM_STR);
$stmt->execute();
$post = $stmt->fetch(PDO::FETCH_ASSOC);
if ($post) {
$favoriteList = explode(',', $post['favorite']);
$index = array_search($userId, $favoriteList);
if ($index === false) {
// ユーザーIDを追加
$favoriteList[] = $userId;
} else {
// ユーザーIDを削除
array_splice($favoriteList, $index, 1);
}
// 新しいいいね情報を更新
$newFavorite = implode(',', $favoriteList);
$updateQuery = $pdo->prepare("UPDATE ueuse SET favorite = :favorite WHERE uniqid = :uniqid");
$updateQuery->bindValue(':favorite', $newFavorite, PDO::PARAM_STR);
$updateQuery->bindValue(':uniqid', $postUniqid, PDO::PARAM_STR);
$res = $updateQuery->execute();
if ($res) {
echo json_encode(['success' => true, 'newFavorite' => $newFavorite]);
exit;
} else {
echo json_encode(['success' => false, 'error' => 'いいねの更新に失敗しました。']);
exit;
}
} else {
echo json_encode(['success' => false, 'error' => '投稿が見つかりません。']);
exit;
}
} catch(PDOException $e) {
echo json_encode(['success' => false, 'error' => 'データベースエラー:' . $e->getMessage()]);
exit;
}
} else {
echo json_encode(['success' => false, 'error' => '必要なパラメータが提供されていません。']);
exit;
}
?>
+612
View File
@@ -0,0 +1,612 @@
<?php
$servernamefile = "../server/servername.txt";
function createUniqId(){
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime,10,36);
}
require('../db.php');
// 変数の初期化
$datetime = array();
$user_name = null;
$message = array();
$message_data = null;
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
session_start();
//------------------------------------------
// データベースに接続
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();
}
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_SESSION['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_SESSION['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_COOKIE['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
$username = $_COOKIE['username']; // クッキーから取得した値をセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} else {
// ログインが許可されていない場合、ログインページにリダイレクト
header("Location: ../login.php");
exit;
}
if(empty($userid)){
header("Location: ../login.php");
exit;
}
if(empty($username)){
header("Location: ../login.php");
exit;
}
//-------------------------------------------
if( !empty($_POST['btn_submit']) ) {
$ueuse = $_POST['ueuse'];
// メッセージの入力チェック
if( empty($ueuse) ) {
$error_message[] = '内容を入力してください。';
} else {
// 文字数を確認
if( 1024 < mb_strlen($ueuse, 'UTF-8') ) {
$error_message[] = '内容は1024文字以内で入力してください。';
}
}
if (empty($_FILES['upload_images']['name'])) {
$photo1 = "none";
} else {
// アップロードされたファイル情報
$uploadedFile = $_FILES['upload_images'];
// アップロードされたファイルの拡張子を取得
$extension = pathinfo($uploadedFile['name'], PATHINFO_EXTENSION);
// 新しいファイル名を生成(uniqid + 拡張子)
$newFilename = uniqid() . '-'.$userid.'.' . $extension;
// 保存先のパスを生成
$uploadedPath = '../ueuseimages/' . $newFilename;
// ファイルを移動
$result = move_uploaded_file($uploadedFile['tmp_name'], $uploadedPath);
if ($result) {
$photo1 = $uploadedPath; // 保存されたファイルのパスを使用
} else {
$error_message[] = 'アップロード失敗!(1)エラーコード:' . $uploadedFile['error'].'<br>'.var_dump($_FILES['upload_images']);
}
}
if (empty($_FILES['upload_images2']['name'])) {
$photo2 = "none";
} else {
if (empty($_FILES['upload_images']['name'])){
$error_message[] = '画像1から画像を選択してください!!!';
}
// アップロードされたファイル情報
$uploadedFile2 = $_FILES['upload_images2'];
if( 10000000 < $uploadedFile2["size"] ) {
$error_message[] = 'ファイルサイズが大きすぎます!';
}
// アップロードされたファイルの拡張子を取得
$extension2 = pathinfo($uploadedFile2['name'], PATHINFO_EXTENSION);
// 新しいファイル名を生成(uniqid + 拡張子)
$newFilename2 = uniqid() . '-'.$userid.'.' . $extension2;
// 保存先のパスを生成
$uploadedPath2 = '../ueuseimages/' . $newFilename2;
// ファイルを移動
$result2 = move_uploaded_file($uploadedFile2['tmp_name'], $uploadedPath2);
if ($result2) {
$photo2 = $uploadedPath2; // 保存されたファイルのパスを使用
} else {
$error_message[] = 'アップロード失敗!(2)エラーコード:' . $uploadedFile2['error'].'<br>'.var_dump($_FILES['upload_images']);
}
}
if (empty($_FILES['upload_videos1']['name'])) {
$video1 = "none";
} else {
// アップロードされたファイル情報
$uploadedFile3 = $_FILES['upload_videos1'];
// アップロードされたファイルの拡張子を取得
$extension3 = strtolower(pathinfo($uploadedFile3['name'], PATHINFO_EXTENSION)); // 小文字に変換
// サポートされている動画フォーマットの拡張子を配列で定義
$supportedExtensions = array("mp4", "avi", "mov", "webm");
if (in_array($extension3, $supportedExtensions)) {
// 正しい拡張子の場合、新しいファイル名を生成
$newFilename3 = uniqid() . '-'.$userid.'.' . $extension3;
// 保存先のパスを生成
$uploadedPath3 = '../ueusevideos/' . $newFilename3;
// ファイルを移動
$result3 = move_uploaded_file($uploadedFile3['tmp_name'], $uploadedPath3);
if ($result3) {
$video1 = $uploadedPath3; // 保存されたファイルのパスを使用
} else {
$error_message[] = 'アップロード失敗!エラーコード:' . $uploadedFile3['error'];
}
} else {
$error_message[] = '対応していないファイル形式です!';
}
}
if( empty($error_message) ) {
// 書き込み日時を取得
$datetime = date("Y-m-d H:i:s");
$uniqid = createUniqId();
$abi = "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', $photo1, PDO::PARAM_STR);
$stmt->bindParam(':photo2', $photo2, PDO::PARAM_STR);
$stmt->bindParam(':video1', $video1, PDO::PARAM_STR);
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
$stmt->bindParam(':abi', $abi, PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->execute();
// コミット
$res = $pdo->commit();
} catch(Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
if( $res ) {
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location:".$url."");
exit;
} else {
$error_message[] = $e->getMessage();
}
// プリペアドステートメントを削除
$stmt = null;
}
}
if( !empty($_POST['logout']) ) {
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($name, '', time()-1000, '/');
}
}
// リダイレクト先のURLへ転送する
$url = '../index.php';
header('Location: ' . $url, true, 303);
// すべての出力を終了
exit;
}
// データベースの接続を閉じる
$pdo = null;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<link rel="manifest" href="../manifest/manifest.json" />
<script>
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("../sw.js").then(reg => {
console.log("ServiceWorker OK", reg);
}).catch(err => {
console.log("ServiceWorker BAD", err);
});
}
</script>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<link rel="stylesheet" href="../css/home.css">
<title>ホーム - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<?php require('../require/leftbox.php');?>
<main class="outer">
<?php if( !empty($error_message) ): ?>
<ul class="errmsg">
<?php foreach( $error_message as $value ): ?>
<p> <?php echo $value; ?></p>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<form method="post" enctype="multipart/form-data">
<div class="sendbox">
<textarea id="ueuse" placeholder="いまどうしてる?" name="ueuse"><?php if( !empty($_SESSION['ueuse']) ){ echo htmlspecialchars( $_SESSION['ueuse'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
<p>画像のEXIF情報(位置情報など)は削除されません。<br>情報漏洩に気をつけてくださいね…</p>
<div class="fxbox">
<label for="upload_images" id="images">
<img src="../img/sysimage/image_1.svg">
<input type="file" name="upload_images" id ="upload_images" accept="image/*">
</label>
<label for="upload_images2" id="images2">
<img src="../img/sysimage/image_1.svg">
<input type="file" name="upload_images2" id ="upload_images2" accept="image/*">
</label>
<label for="upload_videos1" id="videos1">
<img src="../img/sysimage/video_1.svg">
<input type="file" name="upload_videos1" id ="upload_videos1" accept="video/*">
</label>
<input type="submit" class="ueusebtn" name="btn_submit" value="ユーズする">
</div>
</div>
</form>
<script>
document.getElementById("upload_videos1").addEventListener('change', function(e){
var file_reader = new FileReader();
// ファイルの読み込みを行ったら実行
file_reader.addEventListener('load', function(e) {
console.log(e.target.result);
const element = document.querySelector('#videos1');
const createElement = '<p>動画を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
});
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) {
console.log(e.target.result);
const element = document.querySelector('#images2');
const createElement = '<p>画像を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
});
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) {
console.log(e.target.result);
const element = document.querySelector('#images');
const createElement = '<p>画像を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
});
file_reader.readAsText(e.target.files[0]);
});
</script>
<section class="inner">
<div id="postContainer">
</div>
</section>
<div id="loading" class="loading" style="display: none;">
🤔
</div>
</main>
<div id="myDelModal" class="modal">
<div class="modal-content">
<p>ユーズを削除しますか?</p>
<form class="btn_area" method="post" id="deleteForm">
<input type="button" id="deleteButton" class="fbtn_no" name="delete" value="削除">
<input type="button" id="cancelButton" class="fbtn" value="キャンセル">
</form>
</div>
</div>
<div id="myAbiModal" class="modal">
<div class="modal-content">
<h1>ユーズに追記しますか?</h1>
<p>※追記は削除出来ません。</p>
<form method="post" id="AbiForm">
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlspecialchars( $_SESSION['abi'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
<div class="btn_area">
<input type="submit" id="AbiAddButton" class="fbtn_no" name="abi" value="追記">
<input type="button" id="AbiCancelButton" class="fbtn" value="キャンセル">
</div>
</form>
</div>
</div>
<?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?>
</body>
<script>
$(document).ready(function() {
loadPosts();
var pageNumber = 1;
var isLoading = false;
function loadPosts() {
if (isLoading) return;
isLoading = true;
$("#loading").show();
var userid = '<?php echo $userid; ?>';
$.ajax({
url: '../nextpage/nextpage.php', // PHPファイルへのパス
method: 'GET',
data: { page: pageNumber, userid: userid },
dataType: 'html',
success: function(response) {
$('#postContainer').append(response);
pageNumber++;
isLoading = false;
$("#loading").hide();
}
});
}
$('.outer').on('scroll', function() {
var innerHeight = $('.inner').innerHeight(), //内側の要素の高さ
outerHeight = $('.outer').innerHeight(), //外側の要素の高さ
outerBottom = innerHeight - outerHeight; //内側の要素の高さ - 外側の要素の高さ
if (outerBottom <= $('.outer').scrollTop()) {
var elem = document.getElementById("noueuse");
if (elem === null){
// 存在しない場合の処理
loadPosts();
} else {
// 存在する場合の処理
return;
}
}
});
$(document).on('click', '.favbtn, .favbtn_after', function(event) {
event.preventDefault();
var postUniqid = $(this).data('uniqid');
var userid = '<?php echo $userid; ?>';
var likeCountElement = $(this).find('.like-count'); // いいね数を表示する要素
var isLiked = $(this).hasClass('favbtn_after'); // 現在のいいねの状態を判定
var $this = $(this); // ボタン要素を変数に格納
$.ajax({
url: '../favorite/favorite.php',
method: 'POST',
data: { uniqid: postUniqid, userid: userid }, // ここに自分のユーザーIDを指定
dataType: 'json',
success: function(response) {
if (response.success) {
// いいね成功時の処理
if (isLiked) {
$this.removeClass('favbtn_after'); // クラスを削除していいねを取り消す
$this.find('img').attr('src', '../img/sysimage/favorite_1.svg'); // 画像を元の画像に戻す
} else {
$this.addClass('favbtn_after'); // クラスを追加していいねを追加する
$this.find('img').attr('src', '../img/sysimage/favorite_2.svg'); // 画像を新しい画像に置き換える
}
var newFavoriteList = response.newFavorite.split(',');
var likeCount = newFavoriteList.length - 1;
likeCountElement.text(likeCount); // いいね数を更新
} else {
// いいね失敗時の処理
}
}.bind(this), // コールバック内でthisが適切な要素を指すようにbindする
error: function() {
// エラー時の処理
}
});
});
var modal = document.getElementById('myDelModal');
var deleteButton = document.getElementById('deleteButton');
var cancelButton = document.getElementById('cancelButton'); // 追加
$(document).on('click', '.delbtn', function (event) {
modal.style.display = 'block';
var uniqid2 = $(this).attr('data-uniqid2');
var postElement = $(this).closest('.ueuse');
deleteButton.addEventListener('click', () => {
modal.style.display = 'none';
$.ajax({
url: '../delete/delete.php',
method: 'POST',
data: { uniqid: uniqid2 },
dataType: 'json',
success: function (response) {
if (response.success) {
postElement.remove();
} else {
// 削除失敗時の処理
}
},
error: function () {
// エラー時の処理
}
});
});
cancelButton.addEventListener('click', () => { // 追加
modal.style.display = 'none';
});
});
var abimodal = document.getElementById('myAbiModal');
var AbiAddButton = document.getElementById('AbiAddButton');
var AbiCancelButton = document.getElementById('AbiCancelButton');
$(document).on('click', '.addabi', function (event) {
abimodal.style.display = 'block';
var uniqid2 = $(this).attr('data-uniqid2');
var postAbiElement = $(this).closest('.addabi');
AbiCancelButton.addEventListener('click', () => {
abimodal.style.display = 'none';
});
$('#AbiForm').off('submit').on('submit', function (event) {
event.preventDefault();
var abitext = document.getElementById("abitexts").value;
if(abitext == ""){
abimodal.style.display = 'none';
}else{
$.ajax({
url: '../abi/addabi.php',
method: 'POST',
data: { uniqid: uniqid2, abitext: abitext},
dataType: 'json',
success: function (response) {
console.log(response); // レスポンス内容をコンソールに表示
if (response.success) {
abimodal.style.display = 'none';
postAbiElement.remove();
} else {
}
},
error: function (xhr, status, error) {
}
});
}
});
});
});
</script>
</html>
+78
View File
@@ -0,0 +1,78 @@
<?php
require('../db.php');
// 変数の初期化
$current_date = null;
$message_array = array();
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
$row["userid"] = array();
$row["password"] = array();
$ruserid = array();
$rpassword = array();
$userid = null;
$_SESSION["userid"]="";
$password = null;
$_SESSION["password"]="";
session_start();
$option = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
);
$pdo = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
//$row['userid'] = "daichimarukn";
$userid = $_GET['account'];
$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,
);
if( empty($userid) ) {
$filePath = 'img/deficon/icon.png';
$data = file_get_contents($filePath);
header('Content-type: image/png');
//データを出力
echo $data;
exit();
}else{
$dbh = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
$result = $dbh->prepare("SELECT iconname, iconcontent, icontype, iconsize profile FROM account WHERE userid = :userid");
$result->bindValue(':userid', $userid);
// SQL実行
$result->execute();
$row = $result->fetch(); // ここでデータベースから取得した値を $row に代入する
header('Content-type: ' . $row['icontype']);
echo $row['iconcontent'];
exit();
}
+77
View File
@@ -0,0 +1,77 @@
<?php
require('db.php');
// 変数の初期化
$current_date = null;
$message_array = array();
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
$row["userid"] = array();
$row["password"] = array();
$ruserid = array();
$rpassword = array();
$userid = null;
$_SESSION["userid"]="";
$password = null;
$_SESSION["password"]="";
session_start();
$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);
//$row['userid'] = "daichimarukn";
$userid = $_SESSION['userid'];
$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,
);
if( empty($userid) ) {
$filePath = 'img/deficon/icon.png';
$data = file_get_contents($filePath);
header('Content-type: image/png');
//データを出力
echo $data;
exit();
}else{
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
$result = $dbh->prepare("SELECT iconname, iconcontent, icontype, iconsize profile FROM account WHERE userid = :userid");
$result->bindValue(':userid', $userid);
// SQL実行
$result->execute();
$row = $result->fetch(); // ここでデータベースから取得した値を $row に代入する
header('Content-type: ' . $row['icontype']);
echo $row['iconcontent'];
exit();
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

+32
View File
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="512"
height="512"
viewBox="0 0 135.46666 135.46667"
version="1.1"
id="svg5"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs2" />
<g
id="layer1">
<circle
id="path113"
cx="27.380554"
cy="64.918472"
r="12.001809" />
<circle
id="path113-4"
cx="67.068047"
cy="64.918472"
r="12.001809" />
<circle
id="path113-9"
cx="108.19543"
cy="64.918472"
r="12.001809" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 666 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFC832"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"/></svg>

After

Width:  |  Height:  |  Size: 502 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFFFFF"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>

After

Width:  |  Height:  |  Size: 333 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48" fill="#FFFAE6"><path d="M185.087-105.869q-32.507 0-55.862-23.356-23.356-23.355-23.356-55.862v-589.826q0-32.74 23.356-56.262 23.355-23.521 55.862-23.521h589.826q32.74 0 56.262 23.521 23.521 23.522 23.521 56.262v589.826q0 32.507-23.521 55.862-23.522 23.356-56.262 23.356H185.087Zm0-79.218h589.826v-589.826H185.087v589.826Zm43.565-86.826h503.696L578-481.479l-132 171-93-127-124.348 165.566Zm-43.565 86.826v-589.826 589.826Z"/></svg>

After

Width:  |  Height:  |  Size: 517 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48" fill="#FFFAE6"><path d="m145.087-814.696 74 152h130l-74-152h89l74 152h130l-74-152h89l74 152h130l-74-152h101.826q32.74 0 56.262 23.521 23.521 23.522 23.521 56.262v509.826q0 32.507-23.521 55.862-23.522 23.356-56.262 23.356H145.087q-32.507 0-55.862-22.804-23.356-22.805-23.356-55.284v-510.956q0-32.74 23.356-56.262 23.355-23.521 55.862-23.521Zm0 231.783v357.826h669.826v-357.826H145.087Zm0 0v357.826-357.826Z"/></svg>

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

+151
View File
@@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
id="Layer_1"
x="0px"
y="0px"
width="100%"
viewBox="0 0 1320 780"
enable-background="new 0 0 1320 780"
xml:space="preserve"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs118" />
<path
fill="#FFC934"
opacity="1.000000"
stroke="none"
d=" M355.211090,430.264038 C359.845093,400.400208 364.069824,370.922729 369.114166,341.586212 C375.766724,302.896851 383.092163,264.323395 390.020386,225.680756 C390.524323,222.869904 391.816986,222.218002 394.377441,222.238815 C405.374725,222.328186 416.376404,222.427902 427.369293,222.190933 C430.955414,222.113632 431.411469,224.118210 431.880920,226.710556 C436.534821,252.409225 441.261078,278.094879 445.874298,303.800812 C451.104645,332.945465 456.524872,362.060547 461.307251,391.279327 C464.046600,408.015839 465.676605,424.933685 467.828918,441.766998 C467.964233,442.825317 468.298126,443.858246 469.291443,444.858582 C476.945770,363.075775 484.600098,281.292938 492.287292,199.158905 C505.239227,199.158905 517.783813,199.158905 531.057251,199.158905 C518.249573,299.933105 505.464752,400.527374 492.628967,501.522644 C479.323090,501.522644 466.093384,501.522644 451.882233,501.522644 C438.814148,426.131073 419.380005,351.620331 410.714539,274.895844 C402.727325,351.592041 382.856842,425.951569 370.166016,501.689514 C356.130463,501.689514 342.869659,501.689514 329.145813,501.689514 C316.329742,400.876007 303.537689,300.251373 290.687286,199.168060 C303.546356,199.168060 315.918915,199.168060 328.994446,199.168060 C336.864258,281.113586 344.727905,362.995270 352.591583,444.876953 C352.915009,444.934418 353.238434,444.991913 353.561859,445.049377 C354.096741,440.270630 354.631653,435.491882 355.211090,430.264038 z"
id="path63" />
<path
fill="#FFC934"
opacity="1.000000"
stroke="none"
d=" M248.801941,453.000000 C248.801819,467.471008 248.801819,481.441986 248.801819,495.822693 C236.006989,495.822693 223.618896,495.822693 210.638107,495.822693 C210.638107,479.800842 210.638107,463.732452 210.638107,447.664062 C210.223114,447.547546 209.808105,447.431000 209.393112,447.314453 C208.628357,448.817383 207.820068,450.299896 207.105667,451.826355 C200.688568,465.537079 192.850143,478.274872 181.017975,488.023010 C151.452515,512.380981 110.051361,504.613403 89.742691,471.302307 C81.359436,457.551758 77.395569,442.532166 76.180023,426.821442 C74.922516,410.568237 74.238640,394.234131 74.173035,377.931885 C73.941643,320.435669 74.083015,262.937927 74.083023,205.440781 C74.083023,203.470886 74.083031,201.500977 74.083031,199.149475 C87.371323,199.149475 100.249405,199.149475 113.776085,199.149475 C113.776085,201.225800 113.776070,203.173828 113.776077,205.121841 C113.776405,263.618958 113.791916,322.116058 113.767891,380.613159 C113.760635,398.300659 114.125374,415.988037 119.038788,433.117737 C120.898514,439.601349 123.461533,446.128387 126.995277,451.836151 C134.584702,464.094696 147.906647,467.643036 161.037918,461.621765 C173.504013,455.905518 181.817749,445.701965 189.154617,434.639893 C198.073746,421.192169 204.010315,406.373810 208.306976,390.885010 C208.916779,388.686707 209.015289,386.291748 209.016724,383.987579 C209.053421,324.490540 209.045792,264.993500 209.045853,205.496429 C209.045853,203.523544 209.045853,201.550659 209.045853,199.172424 C222.317047,199.172424 235.203766,199.172424 248.802063,199.172424 C248.802063,283.630798 248.802063,368.065399 248.801941,453.000000 z"
id="path65" />
<path
fill="#FFC934"
opacity="1.000000"
stroke="none"
d=" M587.959473,468.048157 C580.249329,455.108490 577.298218,441.066254 576.182434,426.751068 C574.915894,410.501617 574.238159,394.169464 574.172791,377.869812 C573.942017,320.382843 574.083008,262.894318 574.083008,205.406387 C574.083008,203.439056 574.083008,201.471710 574.083008,199.136414 C587.391418,199.136414 600.267639,199.136414 613.776062,199.136414 C613.776062,201.249176 613.776062,203.198578 613.776062,205.147995 C613.776428,263.635712 613.791992,322.123444 613.768005,380.611176 C613.760742,398.295776 614.124756,415.980316 619.036438,433.107544 C620.895630,439.590302 623.456482,446.116577 626.987976,451.824554 C634.574707,464.087097 647.890259,467.643768 661.020081,461.630859 C673.487305,455.921356 681.803223,445.721008 689.140808,434.662231 C698.060730,421.218597 704.000366,406.404022 708.297485,390.917694 C708.907410,388.719482 709.014709,386.326050 709.016174,384.022766 C709.053406,324.535278 709.045715,265.047760 709.045776,205.560226 C709.045776,203.583038 709.045776,201.605835 709.045776,199.197403 C722.269958,199.197403 735.153442,199.197403 748.421631,199.197403 C748.421631,298.008850 748.421631,396.862335 748.421631,495.976196 C735.887146,495.976196 723.614380,495.976196 710.721436,495.976196 C710.721436,479.874390 710.721436,463.826050 710.721436,447.777740 C710.284912,447.637939 709.848328,447.498169 709.411804,447.358368 C708.658020,448.805939 707.848328,450.227417 707.159119,451.705139 C700.761475,465.423187 692.927429,478.158142 681.127075,487.935822 C651.986145,512.082031 610.878479,504.927338 590.396240,472.257751 C589.600220,470.988129 588.880127,469.670898 587.959473,468.048157 z"
id="path67" />
<path
fill="#FFC934"
opacity="1.000000"
stroke="none"
d=" M1100.988770,198.763443 C1105.303833,198.763306 1109.120850,198.763306 1113.776123,198.763306 C1113.776123,201.034927 1113.776001,202.947708 1113.776123,204.860504 C1113.776245,263.357788 1113.794434,321.855103 1113.765747,380.352386 C1113.756958,398.207764 1114.136963,416.057068 1119.083862,433.353210 C1120.893677,439.680695 1123.415649,446.038025 1126.851196,451.619476 C1134.555420,464.135925 1147.896729,467.705505 1161.252441,461.515869 C1173.531372,455.825256 1181.757324,445.761322 1189.017456,434.860626 C1198.055908,421.289917 1204.051147,406.312195 1208.373901,390.654816 C1208.980347,388.458069 1209.018433,386.055298 1209.019775,383.747742 C1209.052734,324.250488 1209.045776,264.753235 1209.045898,205.255997 C1209.045898,203.300186 1209.045898,201.344376 1209.045898,199.079651 C1222.473267,199.079651 1235.355347,199.079651 1248.519653,199.079651 C1248.519653,298.128876 1248.519653,396.866302 1248.519653,495.920013 C1235.836548,495.920013 1223.430542,495.920013 1210.414795,495.920013 C1210.414795,479.712799 1210.414795,463.680695 1210.414795,447.648560 C1210.070923,447.567902 1209.727173,447.487244 1209.383301,447.406616 C1208.522217,449.105225 1207.624634,450.786530 1206.805664,452.505188 C1200.367310,466.014862 1192.580078,478.595337 1180.829224,488.174988 C1151.245605,512.292542 1110.220337,504.603424 1089.875977,471.522369 C1081.439697,457.804565 1077.457275,442.787262 1076.197510,427.077362 C1074.934326,411.325989 1074.236084,395.490570 1074.173950,379.688538 C1073.945190,321.525482 1074.083130,263.360931 1074.083130,205.196960 C1074.083130,203.243942 1074.083130,201.290924 1074.083130,198.763580 C1083.255615,198.763580 1091.873169,198.763580 1100.988770,198.763443 z"
id="path69" />
<path
fill="#FFC833"
opacity="1.000000"
stroke="none"
d=" M820.828247,488.882812 C818.622681,470.860077 823.941406,455.584900 832.282227,440.107513 C868.621216,372.676239 904.039978,304.749054 939.778381,236.994339 C940.216614,236.163620 940.462952,235.231735 941.079285,233.608093 C902.342957,233.608093 864.134827,233.608093 825.480103,233.608093 C825.480103,221.792877 825.480103,210.608597 825.480103,199.092941 C878.437561,199.092941 931.318909,199.092941 984.901855,199.092941 C983.750488,212.594910 986.570801,225.625610 979.535767,238.938889 C953.785889,287.668518 929.725159,337.288849 904.143372,386.109985 C892.263367,408.782104 878.350342,430.389008 865.354675,452.476257 C864.556946,453.832092 863.721191,455.165588 862.301636,457.497467 C907.658936,457.497467 951.861816,457.497467 996.440552,457.497467 C996.440552,469.544708 996.440552,480.946808 996.440552,492.943298 C994.745422,493.037933 992.998779,493.220215 991.252197,493.220703 C936.269653,493.235718 881.287109,493.236694 826.304565,493.221771 C823.632996,493.221039 820.173889,494.173309 820.828247,488.882812 z"
id="path71" />
<path
fill="#FFC937"
opacity="1.000000"
stroke="none"
d=" M640.996826,636.876587 C631.534973,636.876526 622.572693,636.876526 613.267090,636.876526 C613.267090,633.877075 613.267090,631.322754 613.267090,628.211914 C627.454346,628.211914 641.531738,628.211914 655.976807,628.211914 C655.976807,622.444092 655.976807,617.214600 655.976807,611.288757 C641.106995,611.288757 626.236694,611.288757 611.093750,611.288757 C611.093750,608.186279 611.093750,605.764099 611.093750,602.775574 C612.874695,602.681152 614.626648,602.511353 616.378906,602.507751 C628.206238,602.483398 640.035156,602.385742 651.859924,602.560852 C655.347473,602.612488 656.633301,601.492798 656.408936,597.998474 C656.166321,594.218750 656.354004,590.411499 656.354004,586.340332 C659.789124,586.340332 662.685791,586.340332 666.193542,586.340332 C666.193542,588.998840 666.165161,591.443237 666.198486,593.886841 C666.335083,603.903870 664.873474,602.383301 675.042297,602.480103 C683.037598,602.556152 691.034058,602.495361 699.030029,602.495361 C700.824463,602.495361 702.618896,602.495361 704.695984,602.495361 C704.695984,605.543274 704.695984,607.968445 704.695984,611.152405 C699.047668,611.152405 693.450500,611.152161 687.853333,611.152466 C681.856384,611.152832 675.858521,611.213257 669.862854,611.125183 C667.472046,611.090027 666.080139,611.664001 666.165710,614.431091 C666.298828,618.731873 666.200928,623.039795 666.200928,627.959595 C678.450928,627.959595 690.334473,627.959595 702.545898,627.959595 C702.545898,631.130859 702.545898,633.686340 702.545898,636.856567 C690.517456,636.856567 678.623840,636.856567 666.203125,636.856567 C666.203125,643.243652 665.920837,649.053162 666.403015,654.798584 C666.522461,656.221008 668.905396,658.014099 670.615356,658.653381 C683.954773,663.640076 696.336060,670.326233 708.414612,678.997498 C706.707336,681.772522 705.101074,684.383240 703.573608,686.865845 C691.442444,679.804993 679.600891,672.912781 666.532654,665.306458 C666.299438,668.780823 666.180725,670.648682 666.047729,672.515503 C665.208252,684.302307 657.869751,691.830688 646.131470,693.069763 C637.540527,693.976562 629.166382,693.536926 621.300293,689.503723 C614.340210,685.935059 610.332520,680.686768 610.767517,672.402039 C611.182312,664.502075 615.488281,659.125183 622.427429,657.238525 C630.477905,655.049683 639.014648,654.566833 647.373291,653.641052 C650.088501,653.340271 652.907410,653.975708 656.026733,654.208923 C656.026733,648.306519 656.026733,642.913269 656.026733,636.876709 C651.053894,636.876709 646.275208,636.876709 640.996826,636.876587 M656.471802,669.072571 C655.951355,667.034058 655.746826,663.377502 654.862244,663.204834 C644.883972,661.257141 634.677551,659.748352 625.360046,665.414368 C618.862183,669.365723 619.053589,678.293762 625.903259,681.669983 C630.043884,683.710938 635.061584,684.651489 639.728149,684.808289 C650.220032,685.160889 655.173340,680.351990 656.471802,669.072571 z"
id="path73" />
<path
fill="#FFCA39"
opacity="1.000000"
stroke="none"
d=" M175.731308,597.839844 C177.053848,598.773682 178.647003,599.701904 178.648392,600.632507 C178.691483,629.433533 178.579300,658.234863 178.477020,687.036072 C178.476562,687.163635 178.275269,687.290588 177.942032,687.685059 C148.085587,687.685059 118.001976,687.685059 87.513718,687.685059 C87.513718,657.960754 87.513718,628.265198 87.513718,597.835327 C116.782074,597.835327 146.020981,597.835327 175.731308,597.839844 M97.644875,617.521484 C97.644875,637.770813 97.644875,658.020142 97.644875,678.409668 C121.544495,678.409668 144.622986,678.409668 167.807922,678.409668 C167.807922,654.527954 167.807922,630.976501 167.807922,607.335693 C144.346008,607.335693 121.266884,607.335693 97.644310,607.335693 C97.644310,610.613403 97.644310,613.572510 97.644875,617.521484 z"
id="path75" />
<path
fill="#FFCA39"
opacity="1.000000"
stroke="none"
d=" M512.171509,670.736267 C511.171844,680.482788 509.062622,689.392639 498.453247,692.079895 C486.485687,695.111267 474.646088,694.566589 465.440948,685.079468 C457.671356,677.071899 460.267761,664.031189 470.144775,658.055115 C478.336884,653.098328 487.275879,653.332703 496.315918,654.455750 C497.949585,654.658569 499.567627,654.987183 501.671631,655.337463 C501.671631,643.292358 501.671631,631.587097 501.671631,619.209717 C488.498230,619.209717 475.126251,619.209717 461.437988,619.209717 C461.437988,615.981018 461.437988,613.411621 461.437988,610.349609 C474.770111,610.349609 488.021210,610.349609 501.896088,610.349609 C501.896088,602.663696 501.896088,595.442261 501.896088,587.838928 C505.431580,587.838928 508.342621,587.838928 511.877991,587.838928 C511.877991,595.057373 511.877991,602.272644 511.877991,609.930786 C520.570984,609.930786 528.661743,609.930786 537.217407,609.930786 C537.217407,613.060547 537.217407,615.737488 537.217407,618.879150 C529.030151,618.879150 520.936523,618.879150 512.018250,618.879150 C512.018250,622.393311 512.018250,625.476318 512.018250,628.559326 C512.018250,637.052673 512.191589,645.551208 511.936554,654.036926 C511.828064,657.647400 512.896484,659.575867 516.207275,661.378601 C522.467468,664.787292 528.461121,668.762390 534.251709,672.937378 C541.611145,678.243591 541.476624,678.430115 535.315369,686.099365 C529.394348,681.655151 523.505920,677.134888 517.490417,672.790588 C515.972107,671.694031 514.047607,671.159912 512.171509,670.736267 M481.052307,683.812500 C482.375305,683.950256 483.698090,684.090393 485.021362,684.225342 C497.048126,685.451721 503.285156,679.272400 502.024231,667.176392 C501.905334,666.035828 500.802795,664.386353 499.795990,664.048218 C492.887543,661.728699 485.812744,661.042236 478.734558,663.296082 C472.902405,665.153198 470.073944,669.491638 470.976196,674.988953 C471.834778,680.220154 475.785950,682.216431 481.052307,683.812500 z"
id="path77" />
<path
fill="#FFC936"
opacity="1.000000"
stroke="none"
d=" M329.997589,685.239624 C306.543274,685.239746 283.588226,685.239746 260.228455,685.239746 C260.228455,682.343323 260.228455,679.784180 260.228455,676.548584 C285.184174,676.548584 310.208069,676.548584 335.571899,676.548584 C335.571899,654.188416 335.571899,632.493713 335.571899,610.231628 C311.081604,610.231628 286.864258,610.231628 262.331482,610.231628 C262.331482,607.090332 262.331482,604.504272 262.331482,601.147583 C263.934937,601.147583 265.527954,601.147583 267.120972,601.147583 C288.765198,601.147583 310.409454,601.138062 332.053680,601.152649 C339.662903,601.157715 346.026886,607.495361 346.027069,615.006409 C346.027618,636.317627 346.027313,657.628906 346.027283,678.940125 C346.027283,680.751038 346.027252,682.561951 346.027252,685.239441 C340.648895,685.239441 335.572876,685.239441 329.997589,685.239624 z"
id="path79" />
<path
fill="#FFCA39"
opacity="1.000000"
stroke="none"
d=" M982.031799,674.993652 C982.890625,663.460815 991.272522,655.887756 1004.097595,655.084656 C1010.006165,654.714661 1015.957214,655.021545 1022.545654,655.021545 C1022.545654,645.609985 1022.545654,635.709656 1022.545654,625.531128 C1026.112427,625.531128 1029.038208,625.531128 1032.768799,625.531128 C1032.768799,632.652100 1033.435669,639.822937 1032.604492,646.815735 C1031.499512,656.111267 1034.004517,661.968140 1043.419678,665.244080 C1049.105469,667.222351 1054.021851,671.419556 1059.267212,674.646912 C1060.098877,675.158691 1060.842041,675.814453 1061.909668,676.616882 C1060.253784,679.256592 1058.693237,681.744141 1056.911377,684.584595 C1049.054077,679.748535 1041.497559,675.097473 1033.212036,669.997742 C1032.711548,672.682922 1032.392212,674.407104 1032.068604,676.130554 C1030.208740,686.035278 1025.097168,692.130310 1015.183899,693.196960 C1008.280212,693.939758 1000.853333,693.207092 994.135681,691.382568 C986.759460,689.379272 982.272095,683.628479 982.031799,674.993652 M997.239075,683.544006 C999.301514,684.154541 1001.330261,684.938354 1003.431946,685.346863 C1015.083801,687.611572 1023.240723,680.763184 1022.725891,668.994446 C1022.664673,667.595764 1021.416138,665.442932 1020.234314,665.032654 C1013.522095,662.702148 1006.597351,662.062134 999.690979,664.284668 C995.306763,665.695496 991.976013,668.424988 991.286926,673.230530 C990.649780,677.673889 992.868958,680.877563 997.239075,683.544006 z"
id="path81" />
<path
fill="#FFCA39"
opacity="1.000000"
stroke="none"
d=" M818.085632,586.058655 C821.350098,586.014465 822.324768,587.151428 821.582581,590.087158 C820.409424,594.728027 819.559265,599.450500 818.411987,604.900574 C830.197632,604.900574 841.388733,604.900574 852.835815,604.900574 C852.835815,608.145569 852.835815,610.715210 852.835815,613.705505 C840.675293,613.705505 828.748718,613.705505 816.281677,613.705505 C808.949158,641.172974 801.280029,668.293213 789.192993,694.402710 C786.013977,693.256836 783.120056,692.213623 779.656738,690.965271 C790.473083,665.847778 799.321289,640.540588 805.840576,613.837402 C797.074890,613.837402 788.811646,613.837402 780.247498,613.837402 C780.247498,610.807800 780.247498,608.240356 780.247498,604.997742 C788.130310,604.997742 795.903259,604.807861 803.659729,605.081909 C807.256226,605.209045 808.646118,603.970093 809.150269,600.491394 C809.862122,595.579407 811.102234,590.743958 812.189819,585.523621 C814.146729,585.702637 815.911255,585.864014 818.085632,586.058655 z"
id="path83" />
<path
fill="#FFCA39"
opacity="1.000000"
stroke="none"
d=" M1143.879639,602.124023 C1143.539062,622.917603 1142.784180,643.282532 1148.049927,663.168945 C1149.265015,667.757141 1151.290527,672.284851 1153.753540,676.349304 C1156.807007,681.387878 1159.585449,681.373779 1162.725464,676.432739 C1165.834717,671.539978 1168.282349,666.223145 1170.953735,661.057922 C1171.782837,659.454773 1172.394653,657.739075 1173.103271,656.081116 C1181.329224,659.449463 1182.114624,660.929626 1178.489990,668.541809 C1175.782593,674.227966 1172.889038,679.921265 1169.305420,685.073730 C1162.677124,694.603394 1153.261108,694.401306 1146.476929,684.868347 C1140.360229,676.273376 1136.659058,666.472412 1135.911621,656.119080 C1134.572021,637.566650 1134.241821,618.940552 1133.564819,600.342529 C1133.506470,598.742737 1134.007812,597.122620 1134.313477,595.083069 C1137.443359,595.225037 1140.369995,595.357727 1143.891968,595.517456 C1143.891968,597.804565 1143.891968,599.722290 1143.879639,602.124023 z"
id="path85" />
<path
fill="#FFCA3A"
opacity="1.000000"
stroke="none"
d=" M994.927979,587.196167 C993.627991,592.866150 992.236877,598.131958 990.696411,603.963013 C998.384033,603.963013 1005.631287,603.963013 1013.277893,603.963013 C1013.277893,607.137817 1013.277893,609.829468 1013.277893,613.019714 C1006.084106,613.019714 999.120056,613.235352 992.178772,612.931641 C988.529907,612.772034 987.159363,614.221619 985.757080,617.445007 C979.860168,631.000122 973.589905,644.394531 967.327148,657.787354 C966.147034,660.310974 964.377625,662.559021 962.561035,665.440247 C959.798096,663.878357 957.291321,662.461304 955.125122,661.236755 C962.845276,645.304016 970.390625,629.732056 978.506287,612.983032 C970.535706,612.983032 964.469299,612.983032 958.144897,612.983032 C958.144897,609.878174 958.144897,607.308594 958.144897,604.134766 C964.155273,604.134766 969.950623,603.874756 975.708557,604.226807 C979.505127,604.458984 981.149170,602.990906 981.802551,599.482178 C982.257263,597.040405 983.143372,594.680969 983.795959,592.273682 C986.057800,583.930298 986.051025,583.928467 994.927979,587.196167 z"
id="path87" />
<path
fill="#FFCA3A"
opacity="1.000000"
stroke="none"
d=" M444.529388,671.404724 C445.040527,678.305725 445.494781,684.745300 445.979919,691.622437 C442.683197,692.167969 439.686951,692.663757 436.199005,693.240906 C432.551605,657.843323 433.575745,623.251221 438.397034,588.102295 C441.543304,588.519653 444.403259,588.899109 448.073914,589.386047 C443.864288,616.576477 442.948639,643.718445 444.529388,671.404724 z"
id="path89" />
<path
fill="#FFCA39"
opacity="1.000000"
stroke="none"
d=" M1222.278564,667.707031 C1219.279907,644.268799 1213.898926,621.922668 1203.729980,600.996399 C1211.073120,596.509949 1212.351562,596.917847 1215.797852,604.141602 C1225.050049,623.535645 1230.091431,644.099060 1232.837646,665.296021 C1233.656494,671.616150 1232.617798,672.404785 1223.411865,672.814514 C1223.062622,671.293335 1222.699829,669.712952 1222.278564,667.707031 z"
id="path91" />
<path
fill="#FFCA39"
opacity="1.000000"
stroke="none"
d=" M835.823303,689.325317 C825.275574,685.429321 821.333435,677.281860 824.954468,667.513489 C826.953552,662.120483 827.966736,661.755432 832.722168,664.761475 C833.691284,665.374207 834.612610,666.062500 835.691101,666.809570 C835.387756,667.699829 835.110962,668.456909 834.870789,669.225464 C832.816040,675.803528 834.788635,679.777405 841.636292,680.767578 C848.996826,681.831909 856.493225,682.253601 863.937988,682.347412 C870.350586,682.428345 876.773987,681.654053 883.544556,681.236145 C883.902649,684.361938 884.236023,687.272583 884.664368,691.011536 C868.294983,692.548035 852.210449,693.371521 835.823303,689.325317 z"
id="path93" />
<path
fill="#FFCA3A"
opacity="1.000000"
stroke="none"
d=" M846.532715,640.397888 C841.292236,640.877625 836.508667,641.278015 831.302490,641.713806 C830.805298,638.980408 830.342773,636.437561 829.640198,632.574646 C846.505493,631.578796 862.823792,630.615234 879.612549,629.623901 C880.002441,633.266479 880.292786,635.978455 880.639404,639.216919 C869.151062,639.593018 858.070374,639.955750 846.532715,640.397888 z"
id="path95" />
<path
fill="#FFCA3A"
opacity="1.000000"
stroke="none"
d=" M1040.868164,602.133057 C1048.962769,608.754761 1056.757690,615.181335 1064.937500,621.925171 C1062.173340,624.941833 1060.097534,627.207336 1058.144653,629.338623 C1048.166870,620.671448 1038.546753,612.314819 1028.544678,603.626404 C1030.097046,601.902405 1031.839111,599.967773 1033.966187,597.605530 C1036.237061,599.095703 1038.402710,600.516846 1040.868164,602.133057 z"
id="path97" />
<path
fill="#FFCB3D"
opacity="1.000000"
stroke="none"
d=" M864.111206,587.274597 C866.258179,589.169189 868.411926,590.953491 869.775696,593.214417 C872.248535,597.313904 874.250793,601.697327 876.713013,606.473267 C874.046265,607.734985 871.869995,608.764648 869.461670,609.904114 C865.797058,603.117737 862.269714,596.585510 858.494934,589.595215 C860.245789,588.858521 862.003906,588.118835 864.111206,587.274597 z"
id="path99" />
<path
fill="#FFCB3D"
opacity="1.000000"
stroke="none"
d=" M878.911072,593.223877 C877.249451,590.341492 875.753357,587.790527 873.915588,584.657043 C876.387512,583.713989 878.594360,582.872070 881.457397,581.779785 C885.134705,588.289124 888.681091,594.566711 892.507141,601.339355 C889.541382,602.722412 887.230225,603.800171 884.729858,604.966187 C882.732056,600.933655 880.904297,597.244507 878.911072,593.223877 z"
id="path101" />
<path
fill="#FFCB3D"
opacity="1.000000"
stroke="none"
d=" M338.077332,584.783813 C342.753113,582.152466 345.691833,583.361877 347.682373,587.914368 C349.719147,592.572571 352.052826,597.100952 354.519989,602.234314 C351.597748,603.288879 349.328888,604.107666 346.491943,605.131470 C343.530518,598.287476 340.649200,591.628723 338.077332,584.783813 z"
id="path103" />
<path
fill="#FFCB3D"
opacity="1.000000"
stroke="none"
d=" M362.911499,600.416077 C359.184875,594.367310 355.790802,588.204041 352.402985,582.052185 C358.359436,578.012756 359.210205,578.082336 362.600555,583.990906 C365.061493,588.279663 367.134155,592.791199 369.677094,597.787231 C367.134613,598.780945 365.189331,599.541321 362.911499,600.416077 z"
id="path105" />
</svg>

After

Width:  |  Height:  |  Size: 24 KiB

+195
View File
@@ -0,0 +1,195 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
id="Layer_1"
x="0px"
y="0px"
width="100%"
viewBox="0 0 1320 780"
enable-background="new 0 0 1320 780"
xml:space="preserve"
sodipodi:docname="uwuzulogo.svg"
inkscape:version="1.2.2 (732a01da63, 2022-12-09)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs118" /><sodipodi:namedview
id="namedview116"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="true"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="0.96590909"
inkscape:cx="659.48235"
inkscape:cy="390.30588"
inkscape:window-width="1920"
inkscape:window-height="1009"
inkscape:window-x="-4"
inkscape:window-y="-4"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<path
fill="#FFC934"
opacity="1.000000"
stroke="none"
d=" M355.211090,430.264038 C359.845093,400.400208 364.069824,370.922729 369.114166,341.586212 C375.766724,302.896851 383.092163,264.323395 390.020386,225.680756 C390.524323,222.869904 391.816986,222.218002 394.377441,222.238815 C405.374725,222.328186 416.376404,222.427902 427.369293,222.190933 C430.955414,222.113632 431.411469,224.118210 431.880920,226.710556 C436.534821,252.409225 441.261078,278.094879 445.874298,303.800812 C451.104645,332.945465 456.524872,362.060547 461.307251,391.279327 C464.046600,408.015839 465.676605,424.933685 467.828918,441.766998 C467.964233,442.825317 468.298126,443.858246 469.291443,444.858582 C476.945770,363.075775 484.600098,281.292938 492.287292,199.158905 C505.239227,199.158905 517.783813,199.158905 531.057251,199.158905 C518.249573,299.933105 505.464752,400.527374 492.628967,501.522644 C479.323090,501.522644 466.093384,501.522644 451.882233,501.522644 C438.814148,426.131073 419.380005,351.620331 410.714539,274.895844 C402.727325,351.592041 382.856842,425.951569 370.166016,501.689514 C356.130463,501.689514 342.869659,501.689514 329.145813,501.689514 C316.329742,400.876007 303.537689,300.251373 290.687286,199.168060 C303.546356,199.168060 315.918915,199.168060 328.994446,199.168060 C336.864258,281.113586 344.727905,362.995270 352.591583,444.876953 C352.915009,444.934418 353.238434,444.991913 353.561859,445.049377 C354.096741,440.270630 354.631653,435.491882 355.211090,430.264038 z"
id="path63"
style="fill:#ffffff" />
<path
fill="#FFC934"
opacity="1.000000"
stroke="none"
d=" M248.801941,453.000000 C248.801819,467.471008 248.801819,481.441986 248.801819,495.822693 C236.006989,495.822693 223.618896,495.822693 210.638107,495.822693 C210.638107,479.800842 210.638107,463.732452 210.638107,447.664062 C210.223114,447.547546 209.808105,447.431000 209.393112,447.314453 C208.628357,448.817383 207.820068,450.299896 207.105667,451.826355 C200.688568,465.537079 192.850143,478.274872 181.017975,488.023010 C151.452515,512.380981 110.051361,504.613403 89.742691,471.302307 C81.359436,457.551758 77.395569,442.532166 76.180023,426.821442 C74.922516,410.568237 74.238640,394.234131 74.173035,377.931885 C73.941643,320.435669 74.083015,262.937927 74.083023,205.440781 C74.083023,203.470886 74.083031,201.500977 74.083031,199.149475 C87.371323,199.149475 100.249405,199.149475 113.776085,199.149475 C113.776085,201.225800 113.776070,203.173828 113.776077,205.121841 C113.776405,263.618958 113.791916,322.116058 113.767891,380.613159 C113.760635,398.300659 114.125374,415.988037 119.038788,433.117737 C120.898514,439.601349 123.461533,446.128387 126.995277,451.836151 C134.584702,464.094696 147.906647,467.643036 161.037918,461.621765 C173.504013,455.905518 181.817749,445.701965 189.154617,434.639893 C198.073746,421.192169 204.010315,406.373810 208.306976,390.885010 C208.916779,388.686707 209.015289,386.291748 209.016724,383.987579 C209.053421,324.490540 209.045792,264.993500 209.045853,205.496429 C209.045853,203.523544 209.045853,201.550659 209.045853,199.172424 C222.317047,199.172424 235.203766,199.172424 248.802063,199.172424 C248.802063,283.630798 248.802063,368.065399 248.801941,453.000000 z"
id="path65"
style="fill:#ffffff" />
<path
fill="#FFC934"
opacity="1.000000"
stroke="none"
d=" M587.959473,468.048157 C580.249329,455.108490 577.298218,441.066254 576.182434,426.751068 C574.915894,410.501617 574.238159,394.169464 574.172791,377.869812 C573.942017,320.382843 574.083008,262.894318 574.083008,205.406387 C574.083008,203.439056 574.083008,201.471710 574.083008,199.136414 C587.391418,199.136414 600.267639,199.136414 613.776062,199.136414 C613.776062,201.249176 613.776062,203.198578 613.776062,205.147995 C613.776428,263.635712 613.791992,322.123444 613.768005,380.611176 C613.760742,398.295776 614.124756,415.980316 619.036438,433.107544 C620.895630,439.590302 623.456482,446.116577 626.987976,451.824554 C634.574707,464.087097 647.890259,467.643768 661.020081,461.630859 C673.487305,455.921356 681.803223,445.721008 689.140808,434.662231 C698.060730,421.218597 704.000366,406.404022 708.297485,390.917694 C708.907410,388.719482 709.014709,386.326050 709.016174,384.022766 C709.053406,324.535278 709.045715,265.047760 709.045776,205.560226 C709.045776,203.583038 709.045776,201.605835 709.045776,199.197403 C722.269958,199.197403 735.153442,199.197403 748.421631,199.197403 C748.421631,298.008850 748.421631,396.862335 748.421631,495.976196 C735.887146,495.976196 723.614380,495.976196 710.721436,495.976196 C710.721436,479.874390 710.721436,463.826050 710.721436,447.777740 C710.284912,447.637939 709.848328,447.498169 709.411804,447.358368 C708.658020,448.805939 707.848328,450.227417 707.159119,451.705139 C700.761475,465.423187 692.927429,478.158142 681.127075,487.935822 C651.986145,512.082031 610.878479,504.927338 590.396240,472.257751 C589.600220,470.988129 588.880127,469.670898 587.959473,468.048157 z"
id="path67"
style="fill:#ffffff" />
<path
fill="#FFC934"
opacity="1.000000"
stroke="none"
d=" M1100.988770,198.763443 C1105.303833,198.763306 1109.120850,198.763306 1113.776123,198.763306 C1113.776123,201.034927 1113.776001,202.947708 1113.776123,204.860504 C1113.776245,263.357788 1113.794434,321.855103 1113.765747,380.352386 C1113.756958,398.207764 1114.136963,416.057068 1119.083862,433.353210 C1120.893677,439.680695 1123.415649,446.038025 1126.851196,451.619476 C1134.555420,464.135925 1147.896729,467.705505 1161.252441,461.515869 C1173.531372,455.825256 1181.757324,445.761322 1189.017456,434.860626 C1198.055908,421.289917 1204.051147,406.312195 1208.373901,390.654816 C1208.980347,388.458069 1209.018433,386.055298 1209.019775,383.747742 C1209.052734,324.250488 1209.045776,264.753235 1209.045898,205.255997 C1209.045898,203.300186 1209.045898,201.344376 1209.045898,199.079651 C1222.473267,199.079651 1235.355347,199.079651 1248.519653,199.079651 C1248.519653,298.128876 1248.519653,396.866302 1248.519653,495.920013 C1235.836548,495.920013 1223.430542,495.920013 1210.414795,495.920013 C1210.414795,479.712799 1210.414795,463.680695 1210.414795,447.648560 C1210.070923,447.567902 1209.727173,447.487244 1209.383301,447.406616 C1208.522217,449.105225 1207.624634,450.786530 1206.805664,452.505188 C1200.367310,466.014862 1192.580078,478.595337 1180.829224,488.174988 C1151.245605,512.292542 1110.220337,504.603424 1089.875977,471.522369 C1081.439697,457.804565 1077.457275,442.787262 1076.197510,427.077362 C1074.934326,411.325989 1074.236084,395.490570 1074.173950,379.688538 C1073.945190,321.525482 1074.083130,263.360931 1074.083130,205.196960 C1074.083130,203.243942 1074.083130,201.290924 1074.083130,198.763580 C1083.255615,198.763580 1091.873169,198.763580 1100.988770,198.763443 z"
id="path69"
style="fill:#ffffff" />
<path
fill="#FFC833"
opacity="1.000000"
stroke="none"
d=" M820.828247,488.882812 C818.622681,470.860077 823.941406,455.584900 832.282227,440.107513 C868.621216,372.676239 904.039978,304.749054 939.778381,236.994339 C940.216614,236.163620 940.462952,235.231735 941.079285,233.608093 C902.342957,233.608093 864.134827,233.608093 825.480103,233.608093 C825.480103,221.792877 825.480103,210.608597 825.480103,199.092941 C878.437561,199.092941 931.318909,199.092941 984.901855,199.092941 C983.750488,212.594910 986.570801,225.625610 979.535767,238.938889 C953.785889,287.668518 929.725159,337.288849 904.143372,386.109985 C892.263367,408.782104 878.350342,430.389008 865.354675,452.476257 C864.556946,453.832092 863.721191,455.165588 862.301636,457.497467 C907.658936,457.497467 951.861816,457.497467 996.440552,457.497467 C996.440552,469.544708 996.440552,480.946808 996.440552,492.943298 C994.745422,493.037933 992.998779,493.220215 991.252197,493.220703 C936.269653,493.235718 881.287109,493.236694 826.304565,493.221771 C823.632996,493.221039 820.173889,494.173309 820.828247,488.882812 z"
id="path71"
style="fill:#ffffff" />
<path
fill="#FFC937"
opacity="1.000000"
stroke="none"
d=" M640.996826,636.876587 C631.534973,636.876526 622.572693,636.876526 613.267090,636.876526 C613.267090,633.877075 613.267090,631.322754 613.267090,628.211914 C627.454346,628.211914 641.531738,628.211914 655.976807,628.211914 C655.976807,622.444092 655.976807,617.214600 655.976807,611.288757 C641.106995,611.288757 626.236694,611.288757 611.093750,611.288757 C611.093750,608.186279 611.093750,605.764099 611.093750,602.775574 C612.874695,602.681152 614.626648,602.511353 616.378906,602.507751 C628.206238,602.483398 640.035156,602.385742 651.859924,602.560852 C655.347473,602.612488 656.633301,601.492798 656.408936,597.998474 C656.166321,594.218750 656.354004,590.411499 656.354004,586.340332 C659.789124,586.340332 662.685791,586.340332 666.193542,586.340332 C666.193542,588.998840 666.165161,591.443237 666.198486,593.886841 C666.335083,603.903870 664.873474,602.383301 675.042297,602.480103 C683.037598,602.556152 691.034058,602.495361 699.030029,602.495361 C700.824463,602.495361 702.618896,602.495361 704.695984,602.495361 C704.695984,605.543274 704.695984,607.968445 704.695984,611.152405 C699.047668,611.152405 693.450500,611.152161 687.853333,611.152466 C681.856384,611.152832 675.858521,611.213257 669.862854,611.125183 C667.472046,611.090027 666.080139,611.664001 666.165710,614.431091 C666.298828,618.731873 666.200928,623.039795 666.200928,627.959595 C678.450928,627.959595 690.334473,627.959595 702.545898,627.959595 C702.545898,631.130859 702.545898,633.686340 702.545898,636.856567 C690.517456,636.856567 678.623840,636.856567 666.203125,636.856567 C666.203125,643.243652 665.920837,649.053162 666.403015,654.798584 C666.522461,656.221008 668.905396,658.014099 670.615356,658.653381 C683.954773,663.640076 696.336060,670.326233 708.414612,678.997498 C706.707336,681.772522 705.101074,684.383240 703.573608,686.865845 C691.442444,679.804993 679.600891,672.912781 666.532654,665.306458 C666.299438,668.780823 666.180725,670.648682 666.047729,672.515503 C665.208252,684.302307 657.869751,691.830688 646.131470,693.069763 C637.540527,693.976562 629.166382,693.536926 621.300293,689.503723 C614.340210,685.935059 610.332520,680.686768 610.767517,672.402039 C611.182312,664.502075 615.488281,659.125183 622.427429,657.238525 C630.477905,655.049683 639.014648,654.566833 647.373291,653.641052 C650.088501,653.340271 652.907410,653.975708 656.026733,654.208923 C656.026733,648.306519 656.026733,642.913269 656.026733,636.876709 C651.053894,636.876709 646.275208,636.876709 640.996826,636.876587 M656.471802,669.072571 C655.951355,667.034058 655.746826,663.377502 654.862244,663.204834 C644.883972,661.257141 634.677551,659.748352 625.360046,665.414368 C618.862183,669.365723 619.053589,678.293762 625.903259,681.669983 C630.043884,683.710938 635.061584,684.651489 639.728149,684.808289 C650.220032,685.160889 655.173340,680.351990 656.471802,669.072571 z"
id="path73"
style="fill:#ffffff" />
<path
fill="#FFCA39"
opacity="1.000000"
stroke="none"
d=" M175.731308,597.839844 C177.053848,598.773682 178.647003,599.701904 178.648392,600.632507 C178.691483,629.433533 178.579300,658.234863 178.477020,687.036072 C178.476562,687.163635 178.275269,687.290588 177.942032,687.685059 C148.085587,687.685059 118.001976,687.685059 87.513718,687.685059 C87.513718,657.960754 87.513718,628.265198 87.513718,597.835327 C116.782074,597.835327 146.020981,597.835327 175.731308,597.839844 M97.644875,617.521484 C97.644875,637.770813 97.644875,658.020142 97.644875,678.409668 C121.544495,678.409668 144.622986,678.409668 167.807922,678.409668 C167.807922,654.527954 167.807922,630.976501 167.807922,607.335693 C144.346008,607.335693 121.266884,607.335693 97.644310,607.335693 C97.644310,610.613403 97.644310,613.572510 97.644875,617.521484 z"
id="path75"
style="fill:#ffffff" />
<path
fill="#FFCA39"
opacity="1.000000"
stroke="none"
d=" M512.171509,670.736267 C511.171844,680.482788 509.062622,689.392639 498.453247,692.079895 C486.485687,695.111267 474.646088,694.566589 465.440948,685.079468 C457.671356,677.071899 460.267761,664.031189 470.144775,658.055115 C478.336884,653.098328 487.275879,653.332703 496.315918,654.455750 C497.949585,654.658569 499.567627,654.987183 501.671631,655.337463 C501.671631,643.292358 501.671631,631.587097 501.671631,619.209717 C488.498230,619.209717 475.126251,619.209717 461.437988,619.209717 C461.437988,615.981018 461.437988,613.411621 461.437988,610.349609 C474.770111,610.349609 488.021210,610.349609 501.896088,610.349609 C501.896088,602.663696 501.896088,595.442261 501.896088,587.838928 C505.431580,587.838928 508.342621,587.838928 511.877991,587.838928 C511.877991,595.057373 511.877991,602.272644 511.877991,609.930786 C520.570984,609.930786 528.661743,609.930786 537.217407,609.930786 C537.217407,613.060547 537.217407,615.737488 537.217407,618.879150 C529.030151,618.879150 520.936523,618.879150 512.018250,618.879150 C512.018250,622.393311 512.018250,625.476318 512.018250,628.559326 C512.018250,637.052673 512.191589,645.551208 511.936554,654.036926 C511.828064,657.647400 512.896484,659.575867 516.207275,661.378601 C522.467468,664.787292 528.461121,668.762390 534.251709,672.937378 C541.611145,678.243591 541.476624,678.430115 535.315369,686.099365 C529.394348,681.655151 523.505920,677.134888 517.490417,672.790588 C515.972107,671.694031 514.047607,671.159912 512.171509,670.736267 M481.052307,683.812500 C482.375305,683.950256 483.698090,684.090393 485.021362,684.225342 C497.048126,685.451721 503.285156,679.272400 502.024231,667.176392 C501.905334,666.035828 500.802795,664.386353 499.795990,664.048218 C492.887543,661.728699 485.812744,661.042236 478.734558,663.296082 C472.902405,665.153198 470.073944,669.491638 470.976196,674.988953 C471.834778,680.220154 475.785950,682.216431 481.052307,683.812500 z"
id="path77"
style="fill:#ffffff" />
<path
fill="#FFC936"
opacity="1.000000"
stroke="none"
d=" M329.997589,685.239624 C306.543274,685.239746 283.588226,685.239746 260.228455,685.239746 C260.228455,682.343323 260.228455,679.784180 260.228455,676.548584 C285.184174,676.548584 310.208069,676.548584 335.571899,676.548584 C335.571899,654.188416 335.571899,632.493713 335.571899,610.231628 C311.081604,610.231628 286.864258,610.231628 262.331482,610.231628 C262.331482,607.090332 262.331482,604.504272 262.331482,601.147583 C263.934937,601.147583 265.527954,601.147583 267.120972,601.147583 C288.765198,601.147583 310.409454,601.138062 332.053680,601.152649 C339.662903,601.157715 346.026886,607.495361 346.027069,615.006409 C346.027618,636.317627 346.027313,657.628906 346.027283,678.940125 C346.027283,680.751038 346.027252,682.561951 346.027252,685.239441 C340.648895,685.239441 335.572876,685.239441 329.997589,685.239624 z"
id="path79"
style="fill:#ffffff" />
<path
fill="#FFCA39"
opacity="1.000000"
stroke="none"
d=" M982.031799,674.993652 C982.890625,663.460815 991.272522,655.887756 1004.097595,655.084656 C1010.006165,654.714661 1015.957214,655.021545 1022.545654,655.021545 C1022.545654,645.609985 1022.545654,635.709656 1022.545654,625.531128 C1026.112427,625.531128 1029.038208,625.531128 1032.768799,625.531128 C1032.768799,632.652100 1033.435669,639.822937 1032.604492,646.815735 C1031.499512,656.111267 1034.004517,661.968140 1043.419678,665.244080 C1049.105469,667.222351 1054.021851,671.419556 1059.267212,674.646912 C1060.098877,675.158691 1060.842041,675.814453 1061.909668,676.616882 C1060.253784,679.256592 1058.693237,681.744141 1056.911377,684.584595 C1049.054077,679.748535 1041.497559,675.097473 1033.212036,669.997742 C1032.711548,672.682922 1032.392212,674.407104 1032.068604,676.130554 C1030.208740,686.035278 1025.097168,692.130310 1015.183899,693.196960 C1008.280212,693.939758 1000.853333,693.207092 994.135681,691.382568 C986.759460,689.379272 982.272095,683.628479 982.031799,674.993652 M997.239075,683.544006 C999.301514,684.154541 1001.330261,684.938354 1003.431946,685.346863 C1015.083801,687.611572 1023.240723,680.763184 1022.725891,668.994446 C1022.664673,667.595764 1021.416138,665.442932 1020.234314,665.032654 C1013.522095,662.702148 1006.597351,662.062134 999.690979,664.284668 C995.306763,665.695496 991.976013,668.424988 991.286926,673.230530 C990.649780,677.673889 992.868958,680.877563 997.239075,683.544006 z"
id="path81"
style="fill:#ffffff" />
<path
fill="#FFCA39"
opacity="1.000000"
stroke="none"
d=" M818.085632,586.058655 C821.350098,586.014465 822.324768,587.151428 821.582581,590.087158 C820.409424,594.728027 819.559265,599.450500 818.411987,604.900574 C830.197632,604.900574 841.388733,604.900574 852.835815,604.900574 C852.835815,608.145569 852.835815,610.715210 852.835815,613.705505 C840.675293,613.705505 828.748718,613.705505 816.281677,613.705505 C808.949158,641.172974 801.280029,668.293213 789.192993,694.402710 C786.013977,693.256836 783.120056,692.213623 779.656738,690.965271 C790.473083,665.847778 799.321289,640.540588 805.840576,613.837402 C797.074890,613.837402 788.811646,613.837402 780.247498,613.837402 C780.247498,610.807800 780.247498,608.240356 780.247498,604.997742 C788.130310,604.997742 795.903259,604.807861 803.659729,605.081909 C807.256226,605.209045 808.646118,603.970093 809.150269,600.491394 C809.862122,595.579407 811.102234,590.743958 812.189819,585.523621 C814.146729,585.702637 815.911255,585.864014 818.085632,586.058655 z"
id="path83"
style="fill:#ffffff" />
<path
fill="#FFCA39"
opacity="1.000000"
stroke="none"
d=" M1143.879639,602.124023 C1143.539062,622.917603 1142.784180,643.282532 1148.049927,663.168945 C1149.265015,667.757141 1151.290527,672.284851 1153.753540,676.349304 C1156.807007,681.387878 1159.585449,681.373779 1162.725464,676.432739 C1165.834717,671.539978 1168.282349,666.223145 1170.953735,661.057922 C1171.782837,659.454773 1172.394653,657.739075 1173.103271,656.081116 C1181.329224,659.449463 1182.114624,660.929626 1178.489990,668.541809 C1175.782593,674.227966 1172.889038,679.921265 1169.305420,685.073730 C1162.677124,694.603394 1153.261108,694.401306 1146.476929,684.868347 C1140.360229,676.273376 1136.659058,666.472412 1135.911621,656.119080 C1134.572021,637.566650 1134.241821,618.940552 1133.564819,600.342529 C1133.506470,598.742737 1134.007812,597.122620 1134.313477,595.083069 C1137.443359,595.225037 1140.369995,595.357727 1143.891968,595.517456 C1143.891968,597.804565 1143.891968,599.722290 1143.879639,602.124023 z"
id="path85"
style="fill:#ffffff" />
<path
fill="#FFCA3A"
opacity="1.000000"
stroke="none"
d=" M994.927979,587.196167 C993.627991,592.866150 992.236877,598.131958 990.696411,603.963013 C998.384033,603.963013 1005.631287,603.963013 1013.277893,603.963013 C1013.277893,607.137817 1013.277893,609.829468 1013.277893,613.019714 C1006.084106,613.019714 999.120056,613.235352 992.178772,612.931641 C988.529907,612.772034 987.159363,614.221619 985.757080,617.445007 C979.860168,631.000122 973.589905,644.394531 967.327148,657.787354 C966.147034,660.310974 964.377625,662.559021 962.561035,665.440247 C959.798096,663.878357 957.291321,662.461304 955.125122,661.236755 C962.845276,645.304016 970.390625,629.732056 978.506287,612.983032 C970.535706,612.983032 964.469299,612.983032 958.144897,612.983032 C958.144897,609.878174 958.144897,607.308594 958.144897,604.134766 C964.155273,604.134766 969.950623,603.874756 975.708557,604.226807 C979.505127,604.458984 981.149170,602.990906 981.802551,599.482178 C982.257263,597.040405 983.143372,594.680969 983.795959,592.273682 C986.057800,583.930298 986.051025,583.928467 994.927979,587.196167 z"
id="path87"
style="fill:#ffffff" />
<path
fill="#FFCA3A"
opacity="1.000000"
stroke="none"
d=" M444.529388,671.404724 C445.040527,678.305725 445.494781,684.745300 445.979919,691.622437 C442.683197,692.167969 439.686951,692.663757 436.199005,693.240906 C432.551605,657.843323 433.575745,623.251221 438.397034,588.102295 C441.543304,588.519653 444.403259,588.899109 448.073914,589.386047 C443.864288,616.576477 442.948639,643.718445 444.529388,671.404724 z"
id="path89"
style="fill:#ffffff" />
<path
fill="#FFCA39"
opacity="1.000000"
stroke="none"
d=" M1222.278564,667.707031 C1219.279907,644.268799 1213.898926,621.922668 1203.729980,600.996399 C1211.073120,596.509949 1212.351562,596.917847 1215.797852,604.141602 C1225.050049,623.535645 1230.091431,644.099060 1232.837646,665.296021 C1233.656494,671.616150 1232.617798,672.404785 1223.411865,672.814514 C1223.062622,671.293335 1222.699829,669.712952 1222.278564,667.707031 z"
id="path91"
style="fill:#ffffff" />
<path
fill="#FFCA39"
opacity="1.000000"
stroke="none"
d=" M835.823303,689.325317 C825.275574,685.429321 821.333435,677.281860 824.954468,667.513489 C826.953552,662.120483 827.966736,661.755432 832.722168,664.761475 C833.691284,665.374207 834.612610,666.062500 835.691101,666.809570 C835.387756,667.699829 835.110962,668.456909 834.870789,669.225464 C832.816040,675.803528 834.788635,679.777405 841.636292,680.767578 C848.996826,681.831909 856.493225,682.253601 863.937988,682.347412 C870.350586,682.428345 876.773987,681.654053 883.544556,681.236145 C883.902649,684.361938 884.236023,687.272583 884.664368,691.011536 C868.294983,692.548035 852.210449,693.371521 835.823303,689.325317 z"
id="path93"
style="fill:#ffffff" />
<path
fill="#FFCA3A"
opacity="1.000000"
stroke="none"
d=" M846.532715,640.397888 C841.292236,640.877625 836.508667,641.278015 831.302490,641.713806 C830.805298,638.980408 830.342773,636.437561 829.640198,632.574646 C846.505493,631.578796 862.823792,630.615234 879.612549,629.623901 C880.002441,633.266479 880.292786,635.978455 880.639404,639.216919 C869.151062,639.593018 858.070374,639.955750 846.532715,640.397888 z"
id="path95"
style="fill:#ffffff" />
<path
fill="#FFCA3A"
opacity="1.000000"
stroke="none"
d=" M1040.868164,602.133057 C1048.962769,608.754761 1056.757690,615.181335 1064.937500,621.925171 C1062.173340,624.941833 1060.097534,627.207336 1058.144653,629.338623 C1048.166870,620.671448 1038.546753,612.314819 1028.544678,603.626404 C1030.097046,601.902405 1031.839111,599.967773 1033.966187,597.605530 C1036.237061,599.095703 1038.402710,600.516846 1040.868164,602.133057 z"
id="path97"
style="fill:#ffffff" />
<path
fill="#FFCB3D"
opacity="1.000000"
stroke="none"
d=" M864.111206,587.274597 C866.258179,589.169189 868.411926,590.953491 869.775696,593.214417 C872.248535,597.313904 874.250793,601.697327 876.713013,606.473267 C874.046265,607.734985 871.869995,608.764648 869.461670,609.904114 C865.797058,603.117737 862.269714,596.585510 858.494934,589.595215 C860.245789,588.858521 862.003906,588.118835 864.111206,587.274597 z"
id="path99"
style="fill:#ffffff" />
<path
fill="#FFCB3D"
opacity="1.000000"
stroke="none"
d=" M878.911072,593.223877 C877.249451,590.341492 875.753357,587.790527 873.915588,584.657043 C876.387512,583.713989 878.594360,582.872070 881.457397,581.779785 C885.134705,588.289124 888.681091,594.566711 892.507141,601.339355 C889.541382,602.722412 887.230225,603.800171 884.729858,604.966187 C882.732056,600.933655 880.904297,597.244507 878.911072,593.223877 z"
id="path101"
style="fill:#ffffff" />
<path
fill="#FFCB3D"
opacity="1.000000"
stroke="none"
d=" M338.077332,584.783813 C342.753113,582.152466 345.691833,583.361877 347.682373,587.914368 C349.719147,592.572571 352.052826,597.100952 354.519989,602.234314 C351.597748,603.288879 349.328888,604.107666 346.491943,605.131470 C343.530518,598.287476 340.649200,591.628723 338.077332,584.783813 z"
id="path103"
style="fill:#ffffff" />
<path
fill="#FFCB3D"
opacity="1.000000"
stroke="none"
d=" M362.911499,600.416077 C359.184875,594.367310 355.790802,588.204041 352.402985,582.052185 C358.359436,578.012756 359.210205,578.082336 362.600555,583.990906 C365.061493,588.279663 367.134155,592.791199 369.677094,597.787231 C367.134613,598.780945 365.189331,599.541321 362.911499,600.416077 z"
id="path105"
style="fill:#ffffff" />
</svg>

After

Width:  |  Height:  |  Size: 25 KiB

+145
View File
@@ -0,0 +1,145 @@
<!DOCTYPE html>
<?php
require('db.php');
session_start();
if (empty($_SESSION['admin_login'])){
}else{
if($_SESSION['admin_login'] == true) {
// ログインページへリダイレクト
header("Location: /home/index.php");
exit;
}
}
$servernamefile = "server/servername.txt";
//------------------------
$serverinfofile = 'server/info.txt';
$serverinfo = file_get_contents($serverinfofile);
//-------------------------------------
$domain = $_SERVER['HTTP_HOST'];
//------------------------
$contactfile = "server/contact.txt";
//------------------------
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);
$stmt = $pdo->prepare("SELECT COUNT(userid) FROM account");
$stmt->execute();
$count2 = $stmt->fetchColumn();
} catch(PDOException $e) {
// 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage();
}
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
$result = $mysqli->query("SELECT userid FROM account ORDER BY datetime");
/* 結果セットの行数を取得します */
$count1 = $result->num_rows;
$result2 = $mysqli->query("SELECT uniqid FROM ueuse ORDER BY datetime");
/* 結果セットの行数を取得します */
$count2 = $result2->num_rows;
?>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/style.css">
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="favicon/icon-192x192.png">
<link rel="manifest" href="manifest/manifest.json" />
<script>
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("sw.js").then(reg => {
console.log("ServiceWorker OK", reg);
}).catch(err => {
console.log("ServiceWorker BAD", err);
});
}
</script>
<meta name="viewport" content="width=device-width,initial-scale=1">
<title><?php echo file_get_contents($servernamefile);?></title>
</head>
<script src="js/back.js"></script>
<body>
<div class="leftbox">
<div class="logo">
<img src="img/uwuzulogo.svg">
</div>
<div class="textbox">
<?php if( !empty($error_message) ): ?>
<ul class="errmsg">
<?php foreach( $error_message as $value ): ?>
<p> <?php echo $value; ?></p>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<h1><?php echo file_get_contents($servernamefile);;?>へようこそ!</h1>
<div class="p3"><?php echo file_get_contents($servernamefile);?></div>
<div class="p2c"><?php echo $domain;?></div>
<p><?php
$sinfo = explode("\n", $serverinfo);
foreach ($sinfo as $info) {
echo $info.'<br>';
}?></p>
<a class="maillink" href="mailto:<?php echo file_get_contents($contactfile);?>">お問い合わせ : <?php echo file_get_contents($contactfile);?></a>
<div class="cntzone">
<div class="usercnt">
<div class="p1">ユーザー数</div>
<p><?php echo $count1."<br>"?></p>
</div>
<div class="usercnt">
<div class="p1">投稿数</div>
<p><?php echo $count2."<br>"?></p>
</div>
</div>
<div class="btnbox">
<a href="new.php" class="irobutton">アカウント登録</a>
<a href="login.php" class="sirobutton">ログイン</a>
</div>
</div>
</div>
</body>
</html>
+6
View File
@@ -0,0 +1,6 @@
window.onload = function(){
var ele = document.getElementsByTagName("body")[0];
var n = Math.floor(Math.random() * 3); // 3枚の画像がある場合
ele.style.backgroundImage = "url(img/titleimg/"+n+".png)";
}
+205
View File
@@ -0,0 +1,205 @@
<?php
$servernamefile = "server/servername.txt";
require('db.php');
// 変数の初期化
$current_date = null;
$message_array = array();
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
$row["userid"] = "";
$row["password"] = "";
$ruserid = "";
$rpassword = "";
$userid = "";
$_SESSION["userid"]="";
$password = null;
$_SESSION["password"]="";
session_start();
// データベースに接続
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();
}
if( !empty($_POST['btn_submit']) ) {
//$row['userid'] = "daichimarukn";
$userid = $_POST['userid'];
$password = $_POST['password'];
$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);
$result = $dbh->prepare("SELECT userid, password, loginid FROM account WHERE userid = :userid");
$result->bindValue(':userid', $userid);
// SQL実行
$result->execute();
// ... (前略)
// IDの入力チェック
if( empty($userid) ) {
$error_message[] = 'ユーザーIDを入力してください。';
} else {
if( empty($password) ) {
$error_message[] = 'パスワードを入力してください。';
} else {
if($result->rowCount() > 0) {
$row = $result->fetch(); // ここでデータベースから取得した値を $row に代入する
if($row["userid"] == $userid){
if(password_verify($password,$row["password"])){
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['loginid'] = $row["loginid"];
// リダイレクト先のURLへ転送する
$url = 'check.php';
header('Location: ' . $url, true, 303);
// すべての出力を終了
exit;
}
else{
$error_message[] = 'IDまたはパスワードが違います';
}
}else{
$error_message[] = 'IDまたはパスワードが違います';
}
}
else {
$error_message[] = 'IDまたはパスワードが違います';
}
}
}
// ... (後略)
}
// データベースの接続を閉じる
$pdo = null;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/style.css">
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>ログイン - <?php echo file_get_contents($servernamefile);?></title>
</head>
<script src="js/back.js"></script>
<body>
<div class="leftbox">
<div class="logo">
<img src="img/uwuzulogo.svg">
</div>
<div class="textbox">
<h1>ログイン</h1>
<p>IDとパスワードを入力してください!</p>
<?php if( !empty($error_message) ): ?>
<ul class="errmsg">
<?php foreach( $error_message as $value ): ?>
<p> <?php echo $value; ?></p>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<form class="formarea" method="post">
<!--ユーザーネーム関係-->
<div>
<label for="userid">ユーザーID</label>
<input onInput="checkForm(this)" id="userid" class="inbox" type="text" name="userid" value="<?php if( !empty($_SESSION['userid']) ){ echo htmlspecialchars( $_SESSION['userid'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<!--個人情報関係-->
<!--アカウント関連-->
<div>
<label for="password">パスワード</label>
<input onInput="checkForm(this)" id="password" class="inbox" type="password" name="password" value="<?php if( !empty($_SESSION['password']) ){ echo htmlspecialchars( $_SESSION['password'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<input type="submit" name="btn_submit" class="irobutton" value="ログイン">
</form>
<div class="btnbox">
<a href="index.php" class="sirobutton">戻る</a>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function checkForm($this)
{
var str=$this.value;
while(str.match(/[^A-Z^a-z\d\-]/))
{
str=str.replace(/[^A-Z^a-z\d\-]/,"");
}
$this.value=str;
}
window.onload = function(){
var ele = document.getElementsByTagName("body")[0];
var n = Math.floor(Math.random() * 3); // 3枚の画像がある場合
ele.style.backgroundImage = "url(img/titleimg/"+n+".png)";
}
</script>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

+15
View File
@@ -0,0 +1,15 @@
{
"short_name": "uwuzu",
"name": "uwuzu",
"theme_color": "#FFC832",
"background_color": "#FFC832",
"display": "standalone",
"start_url": "../index.php",
"icons": [
{
"src": "icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
+498
View File
@@ -0,0 +1,498 @@
<?php
function createUniqId(){
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime,10,36);
}
require('db.php');
$servernamefile = "server/servername.txt";
session_start();
// 変数の初期化
$current_date = null;
$message_array = array();
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
if(isset($_COOKIE["username"])){
$_SESSION["username"]=$_COOKIE["username"];
}else{
$_SESSION["username"]="";
}
if(isset($_COOKIE["userid"])){
$_SESSION["userid"]=$_COOKIE["userid"];
}else{
$_SESSION["userid"]="";
}
if(isset($_COOKIE["password"])){
$_SESSION["password"]=$_COOKIE["password"];
}else{
$_SESSION["password"]="";
}
if(isset($_COOKIE["mailadds"])){
$_SESSION["mailadds"]=$_COOKIE["mailadds"];
}else{
$_SESSION["mailadds"]="";
}
if(isset($_COOKIE["profile"])){
$_SESSION["profile"]=$_COOKIE["profile"];
}else{
$_SESSION["profile"]="";
}
//$username = array();
//$userid = array();
//$realname = array();
//$yominame = array();
//$password = array();
//$mailadds = array();
//$profile = array();
// データベースに接続
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();
}
if( !empty($_POST['btn_submit']) ) {
//$row['userid'] = "daichimarukn";
// 空白除去
$username = $_POST['username'];
$userid = $_POST['userid'];
$password = $_POST['password'];
$chkpass = $_POST['chkpass'];
$mailadds = $_POST['mailadds'];
$profile = $_POST['profile'];
//cookieに保存
setcookie("username",$username,time()+60*60*24*14);
setcookie("userid",$userid,time()+60*60*24*14);
setcookie("password",$password,time()+60*60*24*14);
setcookie("mailadds",$mailadds,time()+60*60*24*14);
setcookie("profile",$profile,time()+60*60*24*14);
if (!empty($_FILES['image']['name'])) {
$img = $_FILES['image'];
}else{
$localFilePath = 'img/deficon/icon.png';
$img = [
'name' => 'deficon.png',
'type' => 'image/png', // 仮の Content-Type を指定(必要に応じて適切なものに変更してください)
'tmp_name' => $localFilePath,
'error' => 0,
'size' => filesize($localFilePath)
];
}
$localFilePathhead = 'img/defhead/head.png';
$headimg = [
'name' => 'defhead.png',
'type' => 'image/png', // 仮の Content-Type を指定(必要に応じて適切なものに変更してください)
'tmp_name' => $localFilePathhead,
'error' => 0,
'size' => filesize($localFilePathhead)
];
$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 userid = :userid limit 1');
$query->execute(array(':userid' => $userid));
$result = $query->fetch();
// ユーザーネームの入力チェック
if( empty($username) ) {
$error_message[] = '表示名を入力してください。';
} else {
// 文字数を確認
if( 25 < mb_strlen($username, 'UTF-8') ) {
$error_message[] = 'ユーザーネームは25文字以内で入力してください。';
}
}
// IDの入力チェック
if( empty($userid) ) {
$error_message[] = 'ユーザーIDを入力してください。';
} else {
// 文字数を確認
if( 20 < mb_strlen($userid, 'UTF-8') ) {
$error_message[] = 'IDは20文字以内で入力してください。';
}
if($userid === 'uwuzu_official'){
$error_message[] = 'そのIDは登録禁止になっています。';
}
if($result > 0){
$error_message[] = 'このID('.$userid.')は既に使用されています。他のIDを作成してください。'; //このE-mailは既に使用されています。
}
}
// パスワードの入力チェック
if( empty($password) ) {
$error_message[] = 'パスワードを入力してください。';
} 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)) {
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。";
} else {
}
if ($chkpass == $password ){
}else{
$error_message[] = '確認用パスワードが違います。';
}
if( 4 > mb_strlen($password, 'UTF-8') ) {
$error_message[] = 'パスワードは4文字以上である必要があります。';
}
// 文字数を確認
if( 100 < mb_strlen($password, 'UTF-8') ) {
$error_message[] = 'パスワードは100文字以内で入力してください。';
}
}
if( empty($error_message) ) {
// トランザクション開始
$pdo->beginTransaction();
$datetime = date("Y-m-d H:i:s");
try {
$role = "user";
$admin = "none";
$hashpassword = password_hash($password, PASSWORD_DEFAULT);
$loginid = sha1(uniqid(mt_rand(), true));
// SQL作成
$stmt = $pdo->prepare("INSERT INTO account (username, userid, password, loginid, mailadds, profile, iconname, iconcontent, icontype, iconsize, headname, headcontent, headtype, headsize, role, datetime, admin) VALUES (:username, :userid, :password, :loginid, :mailadds, :profile, :iconname, :iconcontent, :icontype, :iconsize, :headname, :headcontent, :headtype, :headsize, :role, :datetime, :admin )");
$iconName = $img['name'];
$iconType = $img['type'];
$iconContent = file_get_contents($img['tmp_name']);
$iconSize = $img['size'];
// アイコン画像のバインド
$stmt->bindValue(':iconname', $iconName, PDO::PARAM_STR);
$stmt->bindValue(':icontype', $iconType, PDO::PARAM_STR);
$stmt->bindValue(':iconcontent', $iconContent, PDO::PARAM_STR);
$stmt->bindValue(':iconsize', $iconSize, PDO::PARAM_INT);
// ヘッダー画像関連の処理
$headName = $headimg['name'];
$headType = $headimg['type'];
$headContent = file_get_contents($headimg['tmp_name']);
$headSize = $headimg['size'];
// ヘッダー画像のバインド
$stmt->bindValue(':headname', $headName, PDO::PARAM_STR);
$stmt->bindValue(':headtype', $headType, PDO::PARAM_STR);
$stmt->bindValue(':headcontent', $headContent, PDO::PARAM_STR);
$stmt->bindValue(':headsize', $headSize, PDO::PARAM_INT);
// 他の値をセット
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
$stmt->bindParam(':userid', $userid, PDO::PARAM_STR);
$stmt->bindParam(':password', $hashpassword, PDO::PARAM_STR);
$stmt->bindParam(':loginid', $loginid, PDO::PARAM_STR);
$stmt->bindParam(':mailadds', $mailadds, PDO::PARAM_STR);
$stmt->bindParam(':profile', $profile, PDO::PARAM_STR);
$stmt->bindParam(':role', $role, PDO::PARAM_STR);
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
$stmt->bindParam(':admin', $admin, PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->execute();
// コミット
$res = $pdo->commit();
} catch (Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
if ($res) {
// リダイレクト先のURLへ転送する
$url = 'success.php';
header('Location: ' . $url, true, 303);
// すべての出力を終了
exit;
} else {
$error_message[] = '登録に失敗しました。';
}
// プリペアドステートメントを削除
$stmt = null;
}
}
// データベースの接続を閉じる
$pdo = null;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/style.css">
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>アカウント登録 - <?php echo file_get_contents($servernamefile);?></title>
</head>
<script src="js/back.js"></script>
<body>
<div class="leftbox">
<div class="logo">
<img src="img/uwuzulogo.svg">
</div>
<div class="textbox">
<h1>アカウント登録</h1>
<p>アカウント登録です。</p>
<p>必須項目には「*」があります。
<?php if( !empty($error_message) ): ?>
<ul class="errmsg">
<?php foreach( $error_message as $value ): ?>
<p> <?php echo $value; ?></p>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<form class="formarea" enctype="multipart/form-data" method="post">
<div id="wrap">
<div class="iconimg">
<img src="image.php">
</div>
<label class="irobutton" for="file_upload">ファイル選択
<input type="file" id="file_upload" name="image" accept="image/*">
</label>
</div>
<script src="js/back.js"></script>
<!--ユーザーネーム関係-->
<div>
<p>ユーザーネーム *</p>
<div class="p2">プロフィールページに掲載され公開されます。<br>※サービス管理者が確認できます。</div>
<input id="username" placeholder="" class="inbox" type="text" name="username" value="<?php if( !empty($_SESSION['username']) ){ echo htmlspecialchars( $_SESSION['username'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<div>
<p>ユーザーID *</p>
<div class="p2">後から変更はできません。<br>プロフィールページに掲載され公開されます。<br>※サービス管理者が確認できます。</div>
<input onInput="checkForm(this)" placeholder="" class="inbox" id="userid" type="text" name="userid" value="<?php if( !empty($_SESSION['userid']) ){ echo htmlspecialchars( $_SESSION['userid'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<!--アカウント関連-->
<div>
<p>パスワード *</p>
<div class="p2">ログイン時に必要となります。<br>※サービス管理者が確認できません。</div>
<input onInput="checkForm(this)" placeholder="" class="inbox" id="password" type="text" name="password" value="<?php if( !empty($_SESSION['password']) ){ echo htmlspecialchars( $_SESSION['password'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<div>
<p>パスワード再確認 *</p>
<input onInput="checkForm(this)" placeholder="" class="inbox" oncopy="return false" onpaste="return false" oncontextmenu="return false" id="chkpass" type="text" style="-webkit-text-security:disc;" name="chkpass" value="<?php if( !empty($_SESSION['chkpass']) ){ echo htmlspecialchars( $_SESSION['chkpass'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<div>
<p>メールアドレス</p>
<div class="p2">設定しておくとアカウント復旧に利用できます。<br>※サービス管理者が確認できます。</div>
<input id="mailadds" type="text" placeholder="" class="inbox" name="mailadds" value="<?php if( !empty($_SESSION['mailadds']) ){ echo htmlspecialchars( $_SESSION['mailadds'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<!--プロフィール関連-->
<div>
<p>プロフィール</p>
<div class="p2">プロフィールページに掲載され公開されます。<br>※サービス管理者が確認できます。</div>
<input id="profile" type="text" placeholder="" class="inbox" name="profile" value="<?php if( !empty($_SESSION['profile']) ){ echo htmlspecialchars( $_SESSION['profile'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<div class="btn_area">
<a href="rule/terms.php" class="fbtn">利用規約</a>
<a href="rule/terms.php" class="fbtn">プライバシーポリシー</a>
</div>
<p>登録を押すと利用規約とプライバシーポリシーに同意したこととなります。<br>未確認の場合は上のボタンよりお読みください。</p>
<input type="submit" class = "irobutton" name="btn_submit" value="登録">
</form>
<div class="btnbox">
<a href="index.php" class="sirobutton">戻る</a>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function checkForm($this) {
var str = $this.value;
while (str.match(/[^A-Za-z\d]/)) {
str = str.replace(/[^A-Za-z\d]/, "");
}
$this.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 = '<p>画像を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
});
file_reader.readAsText(e.target.files[0]);
});
});
</script>
</body>
</html>
+124
View File
@@ -0,0 +1,124 @@
<?php
function createUniqId() {
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec . floor($msec * 1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime, 10, 36);
}
require('../db.php');
require('view.php');
// データベースに接続
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();
}
$userid = $_GET['userid'];
$itemsPerPage = 30; // 1ページあたりのユーズ数
$pageNumber = isset($_GET['page']) ? intval($_GET['page']) : 1;
$offset = ($pageNumber - 1) * $itemsPerPage;
$messages = array();
if (!empty($pdo)) {
function customStripTags($html, $allowedTags) {
$allowedTagString = implode('|', $allowedTags);
$pattern = "/<(?!$allowedTagString)[^>]+>/";
return preg_replace($pattern, '', $html);
}
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font');
// ユーズ内の絵文字を画像に置き換える
function replaceEmojisWithImages($postText) {
// ユーズ内で絵文字名(:emoji:)を検出して画像に置き換える
$pattern = '/:(\w+):/';
$postTextWithImages = preg_replace_callback($pattern, function($matches) {
$emojiName = $matches[1];
return "<img src='../emoji/emojiimage.php?emoji=" . urlencode($emojiName) . "' alt='$emojiName'>";
}, $postText);
return $postTextWithImages;
}
function replaceURLsWithLinks($postText) {
// URLを正規表現を使って検出
$pattern = '/(https?:\/\/[^\s]+)/';
preg_match_all($pattern, $postText, $matches);
// 検出したURLごとに処理を行う
foreach ($matches[0] as $url) {
// ドメイン部分を抽出
$parsedUrl = parse_url($url);
$domain = isset($parsedUrl['host']) ? $parsedUrl['host'] : '';
// ドメインのみを表示するaタグを生成
$link = "<a href='$url' target='_blank'>$domain</a>";
// URLをドメインのみを表示するaタグで置き換え
$postText = str_replace($url, $link, $postText);
}
return $postText;
}
$sql = "SELECT account, username, uniqid, rpuniqid, ueuse, datetime, photo1, photo2, video1, favorite, abi, abidate FROM ueuse WHERE rpuniqid = '' ORDER BY datetime DESC LIMIT $offset, $itemsPerPage";
$message_array = $pdo->query($sql);
while ($row = $message_array->fetch(PDO::FETCH_ASSOC)) {
$messages[] = $row;
}
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) {
$message['username'] = $userData['username'];
}
}
// ユーズ内のHTMLコードに指定のタグを有効化する関数
function replaceUnescapedHTMLTags($html) {
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font'); // 有効化するタグ
return customStripTags($html, $allowedTags);
}
if(!empty($messages)){
foreach ($messages as $value) {
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える
$favIds = explode(',', $fav);
$value["favcnt"] = count($favIds)-1;
$messageDisplay = new MessageDisplay($value, $userid); // $userid をコンストラクタに渡す
$messageDisplay->display();
}
}else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>';
}
$pdo = null;
}
?>
+63
View File
@@ -0,0 +1,63 @@
<?php
function createUniqId() {
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec . floor($msec * 1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime, 10, 36);
}
require('../db.php');
require('notificationview.php');
// データベースに接続
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();
}
$userid = $_GET['userid'];
$itemsPerPage = 30; // 1ページあたりの投稿数
$pageNumber = isset($_GET['page']) ? intval($_GET['page']) : 1;
$offset = ($pageNumber - 1) * $itemsPerPage;
$messages = array();
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,
));
$messageQuery = $dbh->prepare("SELECT title,msg,url,datetime,userchk FROM notification WHERE touserid = :userid ORDER BY datetime DESC LIMIT $offset, $itemsPerPage");
$messageQuery->bindValue(':userid', $userid);
$messageQuery->execute();
$message_array = $messageQuery->fetchAll();
if (!empty($message_array)) {
foreach ($message_array as $value) {
$messageDisplay = new MessageDisplay($value); // userid を渡さない
$messageDisplay->display();
}
} else {
echo '<div class="tokonone" id="noueuse"><p>通知はありません</p></div>';
}
$pdo = null;
}
?>
+32
View File
@@ -0,0 +1,32 @@
<?php
class MessageDisplay {
private $value;
public function __construct($value) {
$this->value = $value;
}
public function display() {
echo '<div class="notification">';
echo ' <div class="flebox">';
echo ' <div class="time">';
$day = date("Ymd", strtotime(htmlspecialchars($this->value['datetime'])));
if ($day == date("Ymd")) {
echo date("今日 H:i", strtotime(htmlspecialchars($this->value['datetime'])));
} else {
echo date("Y年m月d日 H:i", strtotime(htmlspecialchars($this->value['datetime'])));
}
echo ' </div>';
echo ' </div>';
// 投稿内のHTMLコードを表示する部分
echo ' <h3>' . htmlspecialchars($this->value['title']) . '</h3>';
echo ' <p>' . htmlspecialchars($this->value['msg']) . '</p>';
echo ' <a href="' . htmlspecialchars($this->value['url']) . '">続きをみる</a>';
echo '</div>';
}
}
?>
+131
View File
@@ -0,0 +1,131 @@
<?php
function createUniqId() {
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec . floor($msec * 1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime, 10, 36);
}
require('../db.php');
require('view.php');
// データベースに接続
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();
}
$keyword = isset($_GET['keyword']) ? $_GET['keyword'] : '';
$userid = $_GET['userid'];
$messages = array();
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,
));
$messageQuery = $dbh->prepare("SELECT account,username,ueuse,uniqid,rpuniqid,datetime,photo1,photo2,video1,favorite, abi, abidate FROM ueuse WHERE ueuse LIKE :keyword OR abi LIKE :keyword ORDER BY datetime DESC");
$messageQuery->bindValue(':keyword', '%' . $keyword . '%', PDO::PARAM_STR);
$messageQuery->execute();
$message_array = $messageQuery->fetchAll();
function customStripTags($html, $allowedTags) {
$allowedTagString = implode('|', $allowedTags);
$pattern = "/<(?!$allowedTagString)[^>]+>/";
return preg_replace($pattern, '', $html);
}
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font');
// ユーズ内の絵文字を画像に置き換える
function replaceEmojisWithImages($postText) {
// ユーズ内で絵文字名(:emoji:)を検出して画像に置き換える
$pattern = '/:(\w+):/';
$postTextWithImages = preg_replace_callback($pattern, function($matches) {
$emojiName = $matches[1];
return "<img src='../emoji/emojiimage.php?emoji=" . urlencode($emojiName) . "' alt='$emojiName'>";
}, $postText);
return $postTextWithImages;
}
function replaceURLsWithLinks($postText) {
// URLを正規表現を使って検出
$pattern = '/(https?:\/\/[^\s]+)/';
preg_match_all($pattern, $postText, $matches);
// 検出したURLごとに処理を行う
foreach ($matches[0] as $url) {
// ドメイン部分を抽出
$parsedUrl = parse_url($url);
$domain = isset($parsedUrl['host']) ? $parsedUrl['host'] : '';
// ドメインのみを表示するaタグを生成
$link = "<a href='$url' target='_blank'>$domain</a>";
// URLをドメインのみを表示するaタグで置き換え
$postText = str_replace($url, $link, $postText);
}
return $postText;
}
$messages = array();
foreach ($message_array as $row) {
$messages[] = $row;
}
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) {
$message['username'] = $userData['username'];
}
}
// ユーズ内のHTMLコードに指定のタグを有効化する関数
function replaceUnescapedHTMLTags($html) {
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font'); // 有効化するタグ
return customStripTags($html, $allowedTags);
}
if(!empty($messages)){
foreach ($messages as $value) {
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える
$favIds = explode(',', $fav);
$value["favcnt"] = count($favIds)-1;
$messageDisplay = new MessageDisplay($value, $userid);
$messageDisplay->display();
}
}else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>';
}
$pdo = null;
}
?>
+139
View File
@@ -0,0 +1,139 @@
<?php
function createUniqId() {
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec . floor($msec * 1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime, 10, 36);
}
require('../db.php');
require('view.php');
// データベースに接続
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();
}
$userid = $_GET['userid'];
$ueuseid = isset($_GET['id']) ? $_GET['id'] : '';
$itemsPerPage = 30; // 1ページあたりの投稿数
$pageNumber = isset($_GET['page']) ? intval($_GET['page']) : 1;
$offset = ($pageNumber - 1) * $itemsPerPage;
$messages = array();
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,
));
function customStripTags($html, $allowedTags) {
$allowedTagString = implode('|', $allowedTags);
$pattern = "/<(?!$allowedTagString)[^>]+>/";
return preg_replace($pattern, '', $html);
}
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font');
// 投稿内の絵文字を画像に置き換える
function replaceEmojisWithImages($postText) {
// 投稿内で絵文字名(:emoji:)を検出して画像に置き換える
$pattern = '/:(\w+):/';
$postTextWithImages = preg_replace_callback($pattern, function($matches) {
$emojiName = $matches[1];
return "<img src='../emoji/emojiimage.php?emoji=" . urlencode($emojiName) . "' alt='$emojiName'>";
}, $postText);
return $postTextWithImages;
}
function replaceURLsWithLinks($postText) {
// URLを正規表現を使って検出
$pattern = '/(https?:\/\/[^\s]+)/';
preg_match_all($pattern, $postText, $matches);
// 検出したURLごとに処理を行う
foreach ($matches[0] as $url) {
// ドメイン部分を抽出
$parsedUrl = parse_url($url);
$domain = isset($parsedUrl['host']) ? $parsedUrl['host'] : '';
// ドメインのみを表示するaタグを生成
$link = "<a href='$url' target='_blank'>$domain</a>";
// URLをドメインのみを表示するaタグで置き換え
$postText = str_replace($url, $link, $postText);
}
return $postText;
}
// 投稿内容の取得(新しい順に取得)
$messageQuery = $dbh->prepare("SELECT account, username, ueuse, uniqid, rpuniqid, datetime, photo1, photo2, video1, favorite, abi, abidate FROM ueuse WHERE uniqid = :ueuseid OR rpuniqid = :rpueuseid ORDER BY datetime ASC LIMIT $offset, $itemsPerPage");
$messageQuery->bindValue(':ueuseid', $ueuseid);
$messageQuery->bindValue(':rpueuseid', $ueuseid);
$messageQuery->execute();
$message_array = $messageQuery->fetchAll();
$messages = array();
foreach ($message_array as $row) {
$messages[] = $row;
}
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) {
$message['username'] = $userData['username'];
}
}
// 投稿内のHTMLコードに指定のタグを有効化する関数
function replaceUnescapedHTMLTags($html) {
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font'); // 有効化するタグ
return customStripTags($html, $allowedTags);
}
if(!empty($messages)){
foreach ($messages as $value) {
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える
$favIds = explode(',', $fav);
$value["favcnt"] = count($favIds)-1;
$messageDisplay = new MessageDisplay($value, $userid);
$messageDisplay->display();
}
}else{
echo '<div class="tokonone" id="noueuse"><p>投稿がありません</p></div>';
}
$pdo = null;
}
?>
+140
View File
@@ -0,0 +1,140 @@
<?php
function createUniqId() {
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec . floor($msec * 1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime, 10, 36);
}
require('../db.php');
require('view.php');
// データベースに接続
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();
}
$uwuzuid = isset($_GET['id']) ? $_GET['id'] : '';
$userid = $_GET['userid'];
$itemsPerPage = 30; // 1ページあたりのユーズ数
$pageNumber = isset($_GET['page']) ? intval($_GET['page']) : 1;
$offset = ($pageNumber - 1) * $itemsPerPage;
$messages = array();
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,
));
$userQuery = $dbh->prepare("SELECT username, userid, profile, role, follower FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $uwuzuid);
$userQuery->execute();
$userData = $userQuery->fetch();
$messageQuery = $dbh->prepare("SELECT account,username,ueuse,uniqid,rpuniqid,datetime,photo1,photo2,video1,favorite, abi, abidate FROM ueuse WHERE account = :userid AND rpuniqid = ''ORDER BY datetime DESC LIMIT $offset, $itemsPerPage");
$messageQuery->bindValue(':userid', $uwuzuid);
$messageQuery->execute();
$message_array = $messageQuery->fetchAll();
function customStripTags($html, $allowedTags) {
$allowedTagString = implode('|', $allowedTags);
$pattern = "/<(?!$allowedTagString)[^>]+>/";
return preg_replace($pattern, '', $html);
}
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font');
// ユーズ内の絵文字を画像に置き換える
function replaceEmojisWithImages($postText) {
// ユーズ内で絵文字名(:emoji:)を検出して画像に置き換える
$pattern = '/:(\w+):/';
$postTextWithImages = preg_replace_callback($pattern, function($matches) {
$emojiName = $matches[1];
return "<img src='../emoji/emojiimage.php?emoji=" . urlencode($emojiName) . "' alt='$emojiName'>";
}, $postText);
return $postTextWithImages;
}
function replaceURLsWithLinks($postText) {
// URLを正規表現を使って検出
$pattern = '/(https?:\/\/[^\s]+)/';
preg_match_all($pattern, $postText, $matches);
// 検出したURLごとに処理を行う
foreach ($matches[0] as $url) {
// ドメイン部分を抽出
$parsedUrl = parse_url($url);
$domain = isset($parsedUrl['host']) ? $parsedUrl['host'] : '';
// ドメインのみを表示するaタグを生成
$link = "<a href='$url' target='_blank'>$domain</a>";
// URLをドメインのみを表示するaタグで置き換え
$postText = str_replace($url, $link, $postText);
}
return $postText;
}
$messages = array();
foreach ($message_array as $row) {
$messages[] = $row;
}
// ユーザー情報を取得して、$messages内のusernameをuserDataのusernameに置き換える
foreach ($messages as &$message) {
$userQuery = $pdo->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $message["account"]);
$userQuery->execute();
$userData = $userQuery->fetch();
if ($userData) {
$message['username'] = $userData['username'];
}
}
// ユーズ内のHTMLコードに指定のタグを有効化する関数
function replaceUnescapedHTMLTags($html) {
$allowedTags = array('h1', 'h2', 'h3', 'center', 'font'); // 有効化するタグ
return customStripTags($html, $allowedTags);
}
if(!empty($messages)){
foreach ($messages as $value) {
$fav = $value['favorite']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える
$favIds = explode(',', $fav);
$value["favcnt"] = count($favIds)-1;
$messageDisplay = new MessageDisplay($value, $userid);
$messageDisplay->display();
}
}else{
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>';
}
$pdo = null;
}
?>
+85
View File
@@ -0,0 +1,85 @@
<?php
class MessageDisplay {
private $value;
private $userid;
public function __construct($value, $userid) {
$this->value = $value;
$this->userid = $userid;
}
public function display() {
if (empty($this->value)) {
echo '<div class="tokonone" id="noueuse"><p>ユーズがありません</p></div>';
} else {
echo '<div class="ueuse">';
if(!empty($this->value['rpuniqid'])){
echo '<div class="rp"><p>┗━ 一番上のユーズに返信</p></div>';
}
echo ' <div class="flebox">';
echo ' <a href="/@' . htmlspecialchars($this->value['account']) . '"><img src="../home/tlimage.php?account=' . urlencode($this->value['account']) . '"></a>';
echo ' <a href="/@' . htmlspecialchars($this->value['account']) . '">' . htmlspecialchars($this->value['username']) . '</a>';
echo ' <div class="idbox">';
echo ' <a href="/@' . htmlspecialchars($this->value['account']) . '">@' . htmlspecialchars($this->value['account']) . '</a>';
echo ' </div>';
echo ' <div class="time">';
$day = date("Ymd", strtotime(htmlspecialchars($this->value['datetime'])));
if ($day == date("Ymd")) {
echo date("今日 H:i", strtotime(htmlspecialchars($this->value['datetime'])));
} else {
echo date("Y年m月d日 H:i", strtotime(htmlspecialchars($this->value['datetime'])));
}
echo ' </div>';
echo ' </div>';
echo ' <p>' . replaceEmojisWithImages(replaceURLsWithLinks(nl2br(replaceUnescapedHTMLTags($this->value['ueuse'])))) . '</h1></h2></h3></font></center></p>';
if (!empty($this->value['photo2']) && $this->value['photo2'] !== 'none') {
echo ' <div class="photo2">';
echo ' <img src="' . htmlspecialchars($this->value['photo1']) . '" alt="画像">';
echo ' <img src="' . htmlspecialchars($this->value['photo2']) . '" alt="画像">';
echo ' </div>';
} elseif (!empty($this->value['photo1']) && $this->value['photo1'] !== 'none') {
echo ' <div class="photo1">';
echo ' <img src="' . htmlspecialchars($this->value['photo1']) . '" alt="画像">';
echo ' </div>';
}
if (!empty($this->value['video1']) && $this->value['video1'] !== 'none') {
echo ' <div class="video1">';
echo ' <video controls src="' . htmlspecialchars($this->value['video1']) . '"></video>';
echo ' </div>';
}
if(!($this->value['abi'] == "none")){
echo '<div class="abi">';
echo ' <div class="back">';
echo '<h1>' . htmlspecialchars($this->value['username']) . 'さんが追記しました</h1>';
echo ' </div>';
echo '<p>'. htmlspecialchars($this->value['abi']) . '</p>';
echo '<h3>追記日時 : '. date("Y年m月d日 H:i", strtotime(htmlspecialchars($this->value['abidate']))) . '</h3>';
echo '</div>';
}
echo '<hr>';
echo '<div class="favbox">';
if (false !== strstr($this->value['favorite'], $this->userid)) {
echo '<button class="favbtn favbtn_after" id="favbtn" data-uniqid="' . htmlspecialchars($this->value['uniqid']) . '" data-userid2="' . htmlspecialchars($this->value['account']) . '"><img src="../img/sysimage/favorite_2.svg" alt="いいね" /> <span class="like-count">' . htmlspecialchars($this->value['favcnt']) . '</span></button>';
}else{
echo '<button class="favbtn" id="favbtn" data-uniqid="' . htmlspecialchars($this->value['uniqid']) . '" data-userid2="' . htmlspecialchars($this->value['account']) . '"><img src="../img/sysimage/favorite_1.svg" alt="いいね" /> <span class="like-count">' . htmlspecialchars($this->value['favcnt']) . '</span></button>';
}
echo '<a href="/!'.htmlspecialchars($this->value['uniqid']). '~' . htmlspecialchars($this->value['account']) . '" class="tuduki">返信をみる&する</a>';
if($this->value['account'] === $this->userid){
if($this->value['abi'] === "none"){
echo '<input type="submit" name="addabi" id="addabi" data-uniqid2="' . htmlspecialchars($this->value['uniqid']) . '" class="addabi" value="追記する">';
}
echo '<input type="submit" name="delueuse" id="uniqid2" data-uniqid2="' . htmlspecialchars($this->value['uniqid']) . '" class="delbtn" value="削除">';
}
echo '</div>';
echo '</div>';
}
}
}
?>
+292
View File
@@ -0,0 +1,292 @@
<?php
$servernamefile = "../server/servername.txt";
function createUniqId(){
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime,10,36);
}
require('../db.php');
// 変数の初期化
$datetime = array();
$user_name = null;
$message = array();
$message_data = null;
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
session_start();
$userid = $_SESSION['userid'];
$username = $_SESSION['username'];
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();
}
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_SESSION['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_SESSION['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_COOKIE['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
$username = $_COOKIE['username']; // クッキーから取得した値をセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} else {
// ログインが許可されていない場合、ログインページにリダイレクト
header("Location: ../login.php");
exit;
}
if(empty($userid)){
header("Location: ../login.php");
exit;
}
if(empty($username)){
header("Location: ../login.php");
exit;
}
if(!($res["admin"] === "yes")){
header("Location: ../login.php");
exit;
}
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,
));
$userQuery = $dbh->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $userid);
$userQuery->execute();
$userData = $userQuery->fetch();
$role = $userData["role"];
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
$rerole = $dbh->prepare("SELECT username, userid, password, mailadds, profile, iconname, iconcontent, icontype, iconsize, headname, headcontent, headtype, headsize, role, datetime FROM account WHERE userid = :userid");
$rerole->bindValue(':userid', $userid);
// SQL実行
$rerole->execute();
$userdata = $rerole->fetch(); // ここでデータベースから取得した値を $role に代入する
}
if( !empty($_POST['btn_submit']) ) {
$title = $_POST['title'];
$note = $_POST['note'];
// IDの入力チェック
if( empty($title) ) {
$error_message[] = 'タイトルを入力してください!';
} else {
// 文字数を確認
if( 1024 < mb_strlen($title, 'UTF-8') ) {
$error_message[] = 'タイトルは1024文字以内で入力してください。';
}
}
if( empty($error_message) ) {
// 書き込み日時を取得
$datetime = date("Y-m-d H:i:s");
// トランザクション開始
$pdo->beginTransaction();
try {
// SQL作成
$stmt = $pdo->prepare("INSERT INTO notice (title,note,account,datetime) VALUES (:title,:note,:account,:datetime)");
// 値をセット
$stmt->bindParam( ':title', $title, PDO::PARAM_STR);
$stmt->bindParam( ':note', $note, PDO::PARAM_STR);
$stmt->bindParam( ':account', $userid, PDO::PARAM_STR);
$stmt->bindParam( ':datetime', $datetime, PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->execute();
// コミット
$res = $pdo->commit();
} catch(Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
if( $res ) {
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location:".$url."");
exit;
} else {
$error_message[] = '配信に失敗しました。';
}
// プリペアドステートメントを削除
$stmt = null;
}
}
if( !empty($_POST['logout']) ) {
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($name, '', time()-1000, '/');
}
}
// リダイレクト先のURLへ転送する
$url = '../index.php';
header('Location: ' . $url, true, 303);
// すべての出力を終了
exit;
}
// データベースの接続を閉じる
$pdo = null;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<title>お知らせ配信 - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<?php require('../require/leftbox.php');?>
<main>
<?php if( !empty($error_message) ): ?>
<ul class="errmsg">
<?php foreach( $error_message as $value ): ?>
<p> <?php echo $value; ?></p>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<form class="formarea" enctype="multipart/form-data" method="post">
<h1>お知らせ配信</h1>
<p>タイトルと内容を入力して配信してください。<br>削除と編集はここからは出来ません。<br>DB管理画面から行ってください。</p>
<!--ユーザーネーム関係-->
<div>
<p>タイトル</p>
<input placeholder="ここにタイトル" class="inbox" type="text" name="title" value="<?php if( !empty($_SESSION['title']) ){ echo htmlspecialchars( $_SESSION['title'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<div>
<p>この絵文字について</p>
<textarea placeholder="ここに内容" class="inbox" name="note"><?php if( !empty($_SESSION['note']) ){ echo htmlspecialchars( $_SESSION['note'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
</div>
<div>
<input type="submit" class = "irobutton" name="btn_submit" value="配信">
</div>
</form>
</div>
</main>
<?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?>
</body>
</html>
+40
View File
@@ -0,0 +1,40 @@
<?php
//------------------------------------------
// データベースに接続
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();
}
$sql = "SELECT title, note, account, datetime FROM notice ORDER BY datetime DESC";
$notice_array = $pdo->query($sql);
while ($row = $notice_array->fetch(PDO::FETCH_ASSOC)) {
$notices[] = $row;
}
if(!empty($notices)){
foreach ($notices as $value) {
$uneinoticenote = $value['note'];
$uneinoticetitle = $value['title'];
$uneinoticeaccount = $value['account'];
$uneinoticedatetime = $value['datetime'];
}
}else{
$uneinoticenote = "";
$uneinoticetitle = "おしらせはありません";
$uneinoticeaccount = "uwuzu";
$uneinoticedatetime = "";
}
+229
View File
@@ -0,0 +1,229 @@
<?php
$servernamefile = "../server/servername.txt";
function createUniqId(){
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime,10,36);
}
require('../db.php');
// 変数の初期化
$datetime = array();
$user_name = null;
$message = array();
$message_data = null;
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
session_start();
$userid = $_SESSION['userid'];
$username = $_SESSION['username'];
try {
$option = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
);
$pdo = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
} catch(PDOException $e) {
// 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage();
}
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_SESSION['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_SESSION['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_COOKIE['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
$username = $_COOKIE['username']; // クッキーから取得した値をセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} else {
// ログインが許可されていない場合、ログインページにリダイレクト
header("Location: ../login.php");
exit;
}
if(empty($userid)){
header("Location: ../login.php");
exit;
}
if(empty($username)){
header("Location: ../login.php");
exit;
}
if( !empty($_POST['logout']) ) {
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($name, '', time()-1000, '/');
}
}
// リダイレクト先のURLへ転送する
$url = '../index.php';
header('Location: ' . $url, true, 303);
// すべての出力を終了
exit;
}
// データベースの接続を閉じる
$pdo = null;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<title>通知 - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<?php require('../require/leftbox.php');?>
<main class="outer">
<?php if( !empty($error_message) ): ?>
<ul class="errmsg">
<?php foreach( $error_message as $value ): ?>
<p> <?php echo $value; ?></p>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<section class="inner">
<div id="postContainer">
</div>
</section>
<div id="loading" class="loading" style="display: none;">
🤔
</div>
</main>
<?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?>
</body>
<script>
$(document).ready(function() {
loadPosts();
var pageNumber = 1;
var isLoading = false;
function loadPosts() {
if (isLoading) return;
isLoading = true;
$("#loading").show();
var userid = '<?php echo $userid; ?>';
$.ajax({
url: '../nextpage/notification.php', // PHPファイルへのパス
method: 'GET',
data: { page: pageNumber, userid: userid },
dataType: 'html',
success: function(response) {
$('#postContainer').append(response);
pageNumber++;
isLoading = false;
$("#loading").hide();
}
});
}
$('.outer').on('scroll', function() {
var innerHeight = $('.inner').innerHeight(), //内側の要素の高さ
outerHeight = $('.outer').innerHeight(), //外側の要素の高さ
outerBottom = innerHeight - outerHeight; //内側の要素の高さ - 外側の要素の高さ
if (outerBottom <= $('.outer').scrollTop()) {
var elem = document.getElementById("noueuse");
if (elem === null){
// 存在しない場合の処理
loadPosts();
} else {
// 存在する場合の処理
return;
}
}
});
});
</script>
</html>
+300
View File
@@ -0,0 +1,300 @@
<?php
$servernamefile = "../server/servername.txt";
function createUniqId(){
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime,10,36);
}
require('../db.php');
// 変数の初期化
$datetime = array();
$user_name = null;
$message = array();
$message_data = null;
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
session_start();
$userid = $_SESSION['userid'];
$username = $_SESSION['username'];
// 管理者としてログインしているか確認
if( empty($_SESSION['admin_login']) || $_SESSION['admin_login'] !== true ) {
// ログインページへリダイレクト
header("Location: ../login.php");
exit;
}
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();
}
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_SESSION['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_SESSION['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_COOKIE['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
$username = $_COOKIE['username']; // クッキーから取得した値をセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} else {
// ログインが許可されていない場合、ログインページにリダイレクト
header("Location: ../login.php");
exit;
}
if(empty($userid)){
header("Location: ../login.php");
exit;
}
if(empty($username)){
header("Location: ../login.php");
exit;
}
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,
));
$userQuery = $dbh->prepare("SELECT userid FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $userid);
$userQuery->execute();
$userData = $userQuery->fetch();
}
if( !empty($_POST['btn_submit']) ) {
$chkuserid = $_POST['chkuserid'];
if( empty($chkuserid) ) {
$error_message[] = '確認用ユーザーIDを入力してください。';
} else {
if($chkuserid === $userData["userid"]){
$userId = $userData["userid"]; // 削除対象のユーザーID
$folderPath = "../ueuseimages/"; // フォルダのパス
// 指定したフォルダ内でユーザーIDを含むファイルを検索
$filesToDelete = glob($folderPath . "*-$userId.*"); // 「-ユーザーID.拡張子」というパターンを検索
// ファイルを順に削除
foreach ($filesToDelete as $file) {
if (is_file($file)) {
unlink($file); // ファイルを削除
}
}
$folderPath2 = "../ueusevideos/"; // フォルダのパス
// 指定したフォルダ内でユーザーIDを含むファイルを検索
$filesToDelete2 = glob($folderPath2 . "*-$userId.*"); // 「-ユーザーID.拡張子」というパターンを検索
// ファイルを順に削除
foreach ($filesToDelete2 as $file2) {
if (is_file($file2)) {
unlink($file2); // ファイルを削除
}
}
try {
$pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS);
// 投稿削除クエリを実行
$deleteQuery = $pdo->prepare("DELETE FROM ueuse WHERE account = :userid");
$deleteQuery->bindValue(':userid', $userid, PDO::PARAM_STR);
$res = $deleteQuery->execute();
// アカウント削除クエリを実行
$deleteQuery = $pdo->prepare("DELETE FROM account WHERE userid = :userid");
$deleteQuery->bindValue(':userid', $userid, PDO::PARAM_STR);
$res = $deleteQuery->execute();
// フォローの更新
$updateFollowQuery = $pdo->prepare("UPDATE account SET follow = REPLACE(follow, :userid, '') WHERE follow LIKE :pattern");
$updateFollowQuery->bindValue(':userid', ",$userid", PDO::PARAM_STR);
$updateFollowQuery->bindValue(':pattern', "%,$userid%", PDO::PARAM_STR);
$updateFollowQuery->execute();
// フォロワーの更新
$updateFollowerQuery = $pdo->prepare("UPDATE account SET follower = REPLACE(follower, :userid, '') WHERE follower LIKE :pattern");
$updateFollowerQuery->bindValue(':userid', ",$userid", PDO::PARAM_STR);
$updateFollowerQuery->bindValue(':pattern', "%,$userid%", PDO::PARAM_STR);
$updateFollowerQuery->execute();
// いいねの更新
$updateFavoriteQuery = $pdo->prepare("UPDATE ueuse SET favorite = REPLACE(favorite, :favorite, '') WHERE favorite LIKE :pattern");
$updateFavoriteQuery->bindValue(':favorite', ",$userid", PDO::PARAM_STR);
$updateFavoriteQuery->bindValue(':pattern', "%,$userid%", PDO::PARAM_STR);
$updateFavoriteQuery->execute();
} catch (Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
if ($res) {
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($name, '', time()-1000, '/');
}
}
header("Location:../index.php");
exit;
} else {
$error_message[] = 'アカウント削除に失敗しました。';
}
// プリペアドステートメントを削除
$stmt = null;
}else{
$error_message[] = '確認用ユーザーIDが違います';
}
}
}
if( !empty($_POST['logout']) ) {
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($name, '', time()-1000, '/');
}
}
// リダイレクト先のURLへ転送する
$url = '../index.php';
header('Location: ' . $url, true, 303);
// すべての出力を終了
exit;
}
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>アカウント削除ページ - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<?php require('../require/leftbox.php');?>
<main>
<?php if( !empty($error_message) ): ?>
<ul class="errmsg">
<?php foreach( $error_message as $value ): ?>
<p> <?php echo $value; ?></p>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<form class="formarea" method="post">
<h1>アカウント削除ページ</h1>
<p>アカウント誤削除を防ぐため下の入力ボックスにご自身のユーザーIDを入力する必要があります。</p>
<?php if($res["admin"] === "yes"){?>
<p class="errmsg">あなたはこのサーバーの管理者のようです。<br>管理者アカウントの移行は済んでいますか?<br>アカウントを削除しても大丈夫なのですか...</p>
<?php }?>
<div>
<p>確認用ユーザーID</p>
<input id="chkuserid" placeholder="" class="inbox" type="text" name="chkuserid" value="">
</div>
<input type="submit" class = "irobutton" name="btn_submit" value="アカウント削除">
</form>
</main>
<?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?>
</body>
</html>
+202
View File
@@ -0,0 +1,202 @@
<?php
require('../db.php');
if (isset($_POST['uniqid']) && isset($_POST['Rptext']) && isset($_POST['upload_images']) && isset($_POST['upload_images2']) && isset($_POST['upload_videos1'])) {
$rpuniqid = $_POST['uniqid'];
$Rptext = $_POST['Rptext'];
$upload_images = $_POST['upload_images'];
$upload_images2 = $_POST['upload_images2'];
$upload_videos1 = $_POST['upload_videos1'];
$errors = array();
// メッセージの入力チェック
if( empty($Rptext) ) {
$error_message[] = '内容を入力してください。';
} else {
// 文字数を確認
if( 1024 < mb_strlen($Rptext, 'UTF-8') ) {
$errors[] = '内容は1024文字以内で入力してください。';
}
}
if (empty($upload_images['upload_images']['name'])) {
$photo1 = "none";
} else {
// アップロードされたファイル情報
$uploadedFile = $upload_images['upload_images'];
// アップロードされたファイルの拡張子を取得
$extension = pathinfo($uploadedFile['name'], PATHINFO_EXTENSION);
// 新しいファイル名を生成(uniqid + 拡張子)
$newFilename = uniqid() . '-'.$userid.'.' . $extension;
// 保存先のパスを生成
$uploadedPath = '../ueuseimages/' . $newFilename;
// ファイルを移動
$result = move_uploaded_file($uploadedFile['tmp_name'], $uploadedPath);
if ($result) {
$photo1 = $uploadedPath; // 保存されたファイルのパスを使用
} else {
$errors[] = 'アップロード失敗!(1)エラーコード:' . $uploadedFile['error'];
}
}
if (empty($upload_images2['upload_images2']['name'])) {
$photo2 = "none";
} else {
// アップロードされたファイル情報
$uploadedFile2 = $upload_images2['upload_images2'];
// アップロードされたファイルの拡張子を取得
$extension2 = pathinfo($uploadedFile2['name'], PATHINFO_EXTENSION);
// 新しいファイル名を生成(uniqid + 拡張子)
$newFilename2 = uniqid() . '-'.$userid.'.' . $extension2;
// 保存先のパスを生成
$uploadedPath2 = '../ueuseimages/' . $newFilename2;
// ファイルを移動
$result2 = move_uploaded_file($uploadedFile2['tmp_name'], $uploadedPath2);
if ($result2) {
$photo2 = $uploadedPath2; // 保存されたファイルのパスを使用
} else {
$errors[] = 'アップロード失敗!(2)エラーコード:' . $uploadedFile2['error'];
}
}
if (empty($upload_videos1['upload_videos1']['name'])) {
$video1 = "none";
} else {
// アップロードされたファイル情報
$uploadedFile3 = $upload_videos1['upload_videos1'];
// アップロードされたファイルの拡張子を取得
$extension3 = strtolower(pathinfo($uploadedFile3['name'], PATHINFO_EXTENSION)); // 小文字に変換
// サポートされている動画フォーマットの拡張子を配列で定義
$supportedExtensions = array("mp4", "avi", "mov", "webm");
if (in_array($extension3, $supportedExtensions)) {
// 正しい拡張子の場合、新しいファイル名を生成
$newFilename3 = uniqid() . '-'.$userid.'.' . $extension3;
// 保存先のパスを生成
$uploadedPath3 = '../ueusevideos/' . $newFilename3;
// ファイルを移動
$result3 = move_uploaded_file($uploadedFile3['tmp_name'], $uploadedPath3);
if ($result3) {
$video1 = $uploadedPath3; // 保存されたファイルのパスを使用
} else {
$errors[] = 'アップロード失敗!エラーコード:' . $uploadedFile3['error'];
}
} else {
$errors[] = '対応していないファイル形式です!';
}
}
error_reporting(E_ALL);
ini_set('display_errors', 1);
if( empty($error_message) ) {
// 書き込み日時を取得
$datetime = date("Y-m-d H:i:s");
$uniqid = createUniqId();
$abi = "none";
// トランザクション開始
$pdo->beginTransaction();
try {
// SQL作成
$stmt = $pdo->prepare("INSERT INTO ueuse (username, account, uniqid, rpuniqid, ueuse, photo1, photo2, video1, datetime, abi) VALUES (:username, :account, :uniqid, :rpuniqid, :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(':rpuniqid', $rpuniqid, PDO::PARAM_STR);
$stmt->bindParam(':ueuse', $Rptext, PDO::PARAM_STR);
$stmt->bindParam(':photo1', $photo1, PDO::PARAM_STR);
$stmt->bindParam(':photo2', $photo2, PDO::PARAM_STR);
$stmt->bindParam(':video1', $video1, PDO::PARAM_STR);
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
$stmt->bindParam(':abi', $abi, PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->execute();
// コミット
$res = $pdo->commit();
// 書き込み日時を取得
$datetime = date("Y-m-d H:i:s");
$title = ''.$userid.'さんが返信しました!'
$msg = ''.$userid.'さんがあなたの投稿に返信しました!'
$url = '/!'.$rpuniqid
// トランザクション開始
$pdo->beginTransaction();
$stmt = $pdo->prepare("INSERT INTO notification (touserid, title, msg, url, datetime) VALUES (:touserid, :title, :msg, :url, :datetime,)");
$stmt->bindParam(':touserid', $touserid, PDO::PARAM_STR);
$stmt->bindParam(':title', $title, PDO::PARAM_STR);
$stmt->bindParam(':msg', $msg, PDO::PARAM_STR);
$stmt->bindParam(':url', $url, PDO::PARAM_STR);
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
$res = $stmt->execute();
$res = $pdo->commit();
} catch(Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
if ($res) {
header('Content-Type: application/json');
echo json_encode(['success' => true]);
exit;
} else {
header('Content-Type: application/json');
echo json_encode(['success' => false, 'error' => '追加に失敗しました。']);
exit;
}
} catch(PDOException $e) {
header('Content-Type: application/json');
echo json_encode(['success' => false, 'error' => 'データベースエラー:' . $e->getMessage()]);
exit;
}
if (!empty($errors)) {
header('Content-Type: application/json');
echo json_encode(['success' => false, 'errors' => $errors]);
exit;
}
// プリペアドステートメントを削除
$stmt = null;
}
?>
+10
View File
@@ -0,0 +1,10 @@
<?php ?>
<div class="botbox">
<div class="lbtnzone">
<a href="/home" class="btmbutton">ホーム</a>
<a href="/search" class="btmbutton">検索</a>
<a href="/@<?php echo $userid; ?>" class="btmbutton">自情報</a>
<a href="/settings" class="btmbutton">設定</a>
</div>
</div>
<?php ?>
+26
View File
@@ -0,0 +1,26 @@
<?php ?>
<div class="userleftbox">
<div class="logo">
<img src="../img/uwuzucolorlogo.svg">
</div>
<hr>
<div class="lbtnzone">
<a href="/home" class="leftbutton">🏠ホーム</a>
<a href="/search" class="leftbutton">検索</a>
<a href="/notification" class="leftbutton">通知</a>
<a href="/emoji" class="leftbutton">絵文字</a>
<a href="/@<?php echo $userid; ?>" class="leftbutton">プロフィール</a>
<a href="/settings" class="leftbutton">設定</a>
<a href="/others" class="leftbutton">その他</a>
<?php if($res["admin"] === "yes"){?>
<hr>
<a href="/emoji/addemoji.php" class="leftbutton">絵文字登録</a>
<a href="/notice/addnotice.php" class="leftbutton">お知らせ配信</a>
<hr>
<?php }?>
<form method="post">
<input type="submit" name="logout" class="leftbutton" value="ログアウト">
</form>
</div>
</div>
<?php ?>
+45
View File
@@ -0,0 +1,45 @@
<div class="rightbox">
<?php
require('../notice/notice.php');
$servernamefile = "../server/servername.txt";
//-------------------------------------
$domain = $_SERVER['HTTP_HOST'];
//------------------------
$softwarefile = "../server/uwuzuinfo.txt";
$softwaredata = file_get_contents($softwarefile);
$softwaredata = explode( "\n", $softwaredata );
$cnt = count( $softwaredata );
for( $i=0;$i<$cnt;$i++ ){
$uwuzuinfo[$i] = ($softwaredata[$i]);
}
?>
<h1>お知らせ</h1>
<div class="noticearea">
<?php foreach ($notices as $valuen) {?>
<div class="noticebox">
<h4><?php echo $valuen['title'];?></h4>
<p><?php echo nl2br($valuen['note']);?></p>
<div class="makeup"><p>編集者 : <a href="/<?php echo $uneinoticeaccount?>"><?php echo htmlspecialchars($uneinoticeaccount)?></a></p></div>
<div class="time"><p><?php echo date('Y年m月d日 H:i', strtotime($valuen['datetime']));?></p></div>
</div>
<?php }?>
</div>
<h1>サーバー情報</h1>
<div class="btmbox">
<h2>Server</h2>
<h3><?php echo file_get_contents($servernamefile);?></h3>
<p><?php echo $domain;?></p>
<a href="/rule/terms">利用規約</a><a href="/rule/privacypolicy">プライバシーポリシー</a>
<h2>Software</h2>
<h3><?php echo $uwuzuinfo[0]?></h3>
<p>Version : <?php echo $uwuzuinfo[1]?></p>
<p>Developer : <?php echo $uwuzuinfo[3]?></p>
<a href="/rule/uwuzuabout">もっと詳しく!</a><a href="/rule/releasenotes">リリースノート</a>
</div>
</div>
+80
View File
@@ -0,0 +1,80 @@
<!DOCTYPE html>
<?php
$servernamefile = "../server/servername.txt";
//-------------------------------------
$domain = $_SERVER['HTTP_HOST'];
//------------------------
$contactfile = "../server/contact.txt";
$privacypolicyfile = "../server/privacypolicy.txt";
$privacypolicydata = file_get_contents($privacypolicyfile);
function processMarkdownAndWrapEmptyLines($markdownText) {
// コード(#code)をHTMLのdiv class="code"タグに変換
$markdownText = preg_replace('/^#code (.+)/m', '<div class="code"><p>$1</p></div>', $markdownText);
// 画像(#img)をHTMLのimgタグに変換
$markdownText = preg_replace('/^#img (.+)/m', '<img src="$1">', $markdownText);
// タイトル(#、##、###)をHTMLのhタグに変換
$markdownText = preg_replace('/^# (.+)/m', '<h2>$1</h2>', $markdownText);
$markdownText = preg_replace('/^## (.+)/m', '<h3>$1</h3>', $markdownText);
$markdownText = preg_replace('/^### (.+)/m', '<h4>$1</h4>', $markdownText);
// 箇条書き(-)をHTMLのul/liタグに変換
$markdownText = preg_replace('/^- (.+)/m', '<ul><li>$1</li></ul>', $markdownText);
// 空行の前に何もない行をHTMLのpタグに変換
$markdownText = preg_replace('/(^\s*)(?!\s)(.*)/m', '$1<p>$2</p>', $markdownText);
return $markdownText;
}
$sprivacypolicy = explode("\n", $privacypolicydata);
$htmltext = ''; // 初期化
foreach ($sprivacypolicy as $privacypolicy) {
$markdowntext = $privacypolicy;
$convertedText = processMarkdownAndWrapEmptyLines($markdowntext);
$htmltext .= $convertedText . "\n"; // 変換されたテキストを追加
}
?>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>プライバシーポリシー - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<div class="topbox">
<div class="logo">
<img src="../img/uwuzulogo.svg">
</div>
</div>
<div class="terms">
<h1><?php echo file_get_contents($servernamefile);?>プライバシーポリシー</h1>
<div class="p3"><?php echo file_get_contents($servernamefile);?></div>
<div class="p2c"><?php echo $domain;?></div>
<p><?php echo $htmltext;?></p>
</div>
</body>
</html>
+93
View File
@@ -0,0 +1,93 @@
<!DOCTYPE html>
<?php
$servernamefile = "../server/servername.txt";
//-------------------------------------
$domain = $_SERVER['HTTP_HOST'];
//------------------------
$contactfile = "../server/contact.txt";
$releasefile = "../server/uwuzurelease.txt";
$releasedata = file_get_contents($releasefile);
$softwarefile = "../server/uwuzuinfo.txt";
$softwaredata = file_get_contents($softwarefile);
$softwaredata = explode( "\n", $softwaredata );
$cnt = count( $softwaredata );
for( $i=0;$i<$cnt;$i++ ){
$uwuzuinfo[$i] = ($softwaredata[$i]);
}
function processMarkdownAndWrapEmptyLines($markdownText) {
// コード(#code)をHTMLのdiv class="code"タグに変換
$markdownText = preg_replace('/^#code (.+)/m', '<div class="code"><p>$1</p></div>', $markdownText);
// 画像(#img)をHTMLのimgタグに変換
$markdownText = preg_replace('/^#img (.+)/m', '<img src="$1">', $markdownText);
// タイトル(#、##、###)をHTMLのhタグに変換
$markdownText = preg_replace('/^# (.+)/m', '<h2>$1</h2>', $markdownText);
$markdownText = preg_replace('/^## (.+)/m', '<h3>$1</h3>', $markdownText);
$markdownText = preg_replace('/^### (.+)/m', '<h4>$1</h4>', $markdownText);
// 箇条書き(-)をHTMLのul/liタグに変換
$markdownText = preg_replace('/^- (.+)/m', '<ul><li>$1</li></ul>', $markdownText);
// 空行の前に何もない行をHTMLのpタグに変換
$markdownText = preg_replace('/(^\s*)(?!\s)(.*)/m', '$1<p>$2</p>', $markdownText);
return $markdownText;
}
$srelease = explode("\n", $releasedata);
$htmltext = ''; // 初期化
foreach ($srelease as $release) {
$markdowntext = $release;
$convertedText = processMarkdownAndWrapEmptyLines($markdowntext);
$htmltext .= $convertedText . "\n"; // 変換されたテキストを追加
}
?>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title><?php echo $uwuzuinfo[0]?> リリースノート - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<div class="topbox">
<div class="logo">
<img src="../img/uwuzulogo.svg">
</div>
</div>
<div class="terms">
<h1><?php echo $uwuzuinfo[0]?>リリースノート</h1>
<div class="p3"><?php echo file_get_contents($servernamefile);?></div>
<div class="p2c"><?php echo $domain;?></div>
<div class="p3"><?php echo $uwuzuinfo[0];?></div>
<div class="p2c">Version : <?php echo $uwuzuinfo[1];?><br>Developer : <?php echo $uwuzuinfo[3];?><br>Last Update : <?php echo $uwuzuinfo[2];?></div>
<p><?php echo $htmltext;?></p>
</div>
</body>
</html>
+80
View File
@@ -0,0 +1,80 @@
<!DOCTYPE html>
<?php
$servernamefile = "../server/servername.txt";
//-------------------------------------
$domain = $_SERVER['HTTP_HOST'];
//------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/terms.txt";
$termsdata = file_get_contents($termsfile);
function processMarkdownAndWrapEmptyLines($markdownText) {
// コード(#code)をHTMLのdiv class="code"タグに変換
$markdownText = preg_replace('/^#code (.+)/m', '<div class="code"><p>$1</p></div>', $markdownText);
// 画像(#img)をHTMLのimgタグに変換
$markdownText = preg_replace('/^#img (.+)/m', '<img src="$1">', $markdownText);
// タイトル(#、##、###)をHTMLのhタグに変換
$markdownText = preg_replace('/^# (.+)/m', '<h2>$1</h2>', $markdownText);
$markdownText = preg_replace('/^## (.+)/m', '<h3>$1</h3>', $markdownText);
$markdownText = preg_replace('/^### (.+)/m', '<h4>$1</h4>', $markdownText);
// 箇条書き(-)をHTMLのul/liタグに変換
$markdownText = preg_replace('/^- (.+)/m', '<ul><li>$1</li></ul>', $markdownText);
// 空行の前に何もない行をHTMLのpタグに変換
$markdownText = preg_replace('/(^\s*)(?!\s)(.*)/m', '$1<p>$2</p>', $markdownText);
return $markdownText;
}
$sterms = explode("\n", $termsdata);
$htmltext = ''; // 初期化
foreach ($sterms as $terms) {
$markdowntext = $terms;
$convertedText = processMarkdownAndWrapEmptyLines($markdowntext);
$htmltext .= $convertedText . "\n"; // 変換されたテキストを追加
}
?>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>利用規約 - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<div class="topbox">
<div class="logo">
<img src="../img/uwuzulogo.svg">
</div>
</div>
<div class="terms">
<h1><?php echo file_get_contents($servernamefile);?>利用規約</h1>
<div class="p3"><?php echo file_get_contents($servernamefile);?></div>
<div class="p2c"><?php echo $domain;?></div>
<p><?php echo $htmltext;?></p>
</div>
</body>
</html>
+93
View File
@@ -0,0 +1,93 @@
<!DOCTYPE html>
<?php
$servernamefile = "../server/servername.txt";
//-------------------------------------
$domain = $_SERVER['HTTP_HOST'];
//------------------------
$contactfile = "../server/contact.txt";
$termsfile = "../server/uwuzuabout.txt";
$termsdata = file_get_contents($termsfile);
$softwarefile = "../server/uwuzuinfo.txt";
$softwaredata = file_get_contents($softwarefile);
$softwaredata = explode( "\n", $softwaredata );
$cnt = count( $softwaredata );
for( $i=0;$i<$cnt;$i++ ){
$uwuzuinfo[$i] = ($softwaredata[$i]);
}
function processMarkdownAndWrapEmptyLines($markdownText) {
// コード(#code)をHTMLのdiv class="code"タグに変換
$markdownText = preg_replace('/^#code (.+)/m', '<div class="code"><p>$1</p></div>', $markdownText);
// 画像(#img)をHTMLのimgタグに変換
$markdownText = preg_replace('/^#img (.+)/m', '<img src="$1">', $markdownText);
// タイトル(#、##、###)をHTMLのhタグに変換
$markdownText = preg_replace('/^# (.+)/m', '<h2>$1</h2>', $markdownText);
$markdownText = preg_replace('/^## (.+)/m', '<h3>$1</h3>', $markdownText);
$markdownText = preg_replace('/^### (.+)/m', '<h4>$1</h4>', $markdownText);
// 箇条書き(-)をHTMLのul/liタグに変換
$markdownText = preg_replace('/^- (.+)/m', '<ul><li>$1</li></ul>', $markdownText);
// 空行の前に何もない行をHTMLのpタグに変換
$markdownText = preg_replace('/(^\s*)(?!\s)(.*)/m', '$1<p>$2</p>', $markdownText);
return $markdownText;
}
$sterms = explode("\n", $termsdata);
$htmltext = ''; // 初期化
foreach ($sterms as $terms) {
$markdowntext = $terms;
$convertedText = processMarkdownAndWrapEmptyLines($markdowntext);
$htmltext .= $convertedText . "\n"; // 変換されたテキストを追加
}
?>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title><?php echo $uwuzuinfo[0]?>について - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<div class="topbox">
<div class="logo">
<img src="../img/uwuzulogo.svg">
</div>
</div>
<div class="terms">
<h1><?php echo $uwuzuinfo[0]?>について</h1>
<div class="p3"><?php echo file_get_contents($servernamefile);?></div>
<div class="p2c"><?php echo $domain;?></div>
<div class="p3"><?php echo $uwuzuinfo[0];?></div>
<div class="p2c">Version : <?php echo $uwuzuinfo[1];?><br>Developer : <?php echo $uwuzuinfo[3];?><br>Last Update : <?php echo $uwuzuinfo[2];?></div>
<p><?php echo $htmltext;?></p>
</div>
</body>
</html>
+390
View File
@@ -0,0 +1,390 @@
<?php
$servernamefile = "../server/servername.txt";
function createUniqId(){
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime,10,36);
}
require('../db.php');
// 変数の初期化
$datetime = array();
$user_name = null;
$message = array();
$message_data = null;
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
session_start();
//------------------------------------------
// データベースに接続
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();
}
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_SESSION['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_SESSION['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_COOKIE['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
$username = $_COOKIE['username']; // クッキーから取得した値をセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} else {
// ログインが許可されていない場合、ログインページにリダイレクト
header("Location: ../login.php");
exit;
}
if(empty($userid)){
header("Location: ../login.php");
exit;
}
if(empty($username)){
header("Location: ../login.php");
exit;
}
//-------------------------------------------
if( !empty($_POST['logout']) ) {
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($name, '', time()-1000, '/');
}
}
// リダイレクト先のURLへ転送する
$url = '../index.php';
header('Location: ' . $url, true, 303);
// すべての出力を終了
exit;
}
// データベースの接続を閉じる
$pdo = null;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<link rel="stylesheet" href="../css/home.css">
<title>検索 - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<?php require('../require/leftbox.php');?>
<main class="outer">
<?php if( !empty($error_message) ): ?>
<ul class="errmsg">
<?php foreach( $error_message as $value ): ?>
<p> <?php echo $value; ?></p>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<div class="emojibox">
<h1>検索</h1>
</div>
<div class="sendbox">
<input class="inbox" placeholder="ユーズ検索" id="ueusetext" type="text" value="">
<button class="search_btn" id="search_btn">検索</button>
</div>
<section class="inner">
<div id="postContainer">
</div>
</section>
<div id="loading" class="loading" style="display: none;">
🤔
</div>
</div>
</main>
<div id="myDelModal" class="modal">
<div class="modal-content">
<p>ユーズを削除しますか?</p>
<form class="btn_area" method="post" id="deleteForm">
<input type="button" id="deleteButton" class="fbtn_no" name="delete" value="削除">
<input type="button" id="cancelButton" class="fbtn" value="キャンセル">
</form>
</div>
</div>
<div id="myAbiModal" class="modal">
<div class="modal-content">
<h1>ユーズに追記しますか?</h1>
<p>※追記は削除出来ません。</p>
<form method="post" id="AbiForm">
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlspecialchars( $_SESSION['abi'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
<div class="btn_area">
<input type="submit" id="AbiAddButton" class="fbtn_no" name="abi" value="追記">
<input type="button" id="AbiCancelButton" class="fbtn" value="キャンセル">
</div>
</form>
</div>
</div>
<?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?>
</body>
<script>
$(document).ready(function() {
$(document).on('click', '.search_btn', function(event) {
loadPosts();
});
var isLoading = false;
function loadPosts() {
if (isLoading) return;
isLoading = true;
$("#loading").show();
var ueusetext = document.getElementById('ueusetext');
var userid = '<?php echo $userid; ?>';
var keyword = ueusetext.value;
// 前回の検索結果をクリア
$('#postContainer').empty();
console.log(keyword)
// 新しいキーワードで検索を実行
$.ajax({
url: '../nextpage/searchpage.php', // PHPファイルへのパス
method: 'GET',
data: { keyword: keyword, userid: userid },
dataType: 'html',
success: function(response) {
$('#postContainer').append(response);
$("#loading").hide();
isLoading = false;
}
});
}
$(document).on('click', '.favbtn, .favbtn_after', function(event) {
event.preventDefault();
var postUniqid = $(this).data('uniqid');
var userid = '<?php echo $userid; ?>';
var likeCountElement = $(this).find('.like-count'); // いいね数を表示する要素
var isLiked = $(this).hasClass('favbtn_after'); // 現在のいいねの状態を判定
var $this = $(this); // ボタン要素を変数に格納
$.ajax({
url: '../favorite/favorite.php',
method: 'POST',
data: { uniqid: postUniqid, userid: userid }, // ここに自分のユーザーIDを指定
dataType: 'json',
success: function(response) {
if (response.success) {
// いいね成功時の処理
if (isLiked) {
$this.removeClass('favbtn_after'); // クラスを削除していいねを取り消す
$this.find('img').attr('src', '../img/sysimage/favorite_1.svg'); // 画像を元の画像に戻す
} else {
$this.addClass('favbtn_after'); // クラスを追加していいねを追加する
$this.find('img').attr('src', '../img/sysimage/favorite_2.svg'); // 画像を新しい画像に置き換える
}
var newFavoriteList = response.newFavorite.split(',');
var likeCount = newFavoriteList.length - 1;
likeCountElement.text(likeCount); // いいね数を更新
} else {
// いいね失敗時の処理
}
}.bind(this), // コールバック内でthisが適切な要素を指すようにbindする
error: function() {
// エラー時の処理
}
});
});
var modal = document.getElementById('myDelModal');
var deleteButton = document.getElementById('deleteButton');
var cancelButton = document.getElementById('cancelButton'); // 追加
$(document).on('click', '.delbtn', function (event) {
modal.style.display = 'block';
var uniqid2 = $(this).attr('data-uniqid2');
var postElement = $(this).closest('.ueuse');
deleteButton.addEventListener('click', () => {
modal.style.display = 'none';
$.ajax({
url: '../delete/delete.php',
method: 'POST',
data: { uniqid: uniqid2 },
dataType: 'json',
success: function (response) {
if (response.success) {
postElement.remove();
} else {
// 削除失敗時の処理
}
},
error: function () {
// エラー時の処理
}
});
});
cancelButton.addEventListener('click', () => { // 追加
modal.style.display = 'none';
});
});
var abimodal = document.getElementById('myAbiModal');
var AbiAddButton = document.getElementById('AbiAddButton');
var AbiCancelButton = document.getElementById('AbiCancelButton');
$(document).on('click', '.addabi', function (event) {
abimodal.style.display = 'block';
var uniqid2 = $(this).attr('data-uniqid2');
var postAbiElement = $(this).closest('.addabi');
AbiCancelButton.addEventListener('click', () => {
abimodal.style.display = 'none';
});
$('#AbiForm').off('submit').on('submit', function (event) {
event.preventDefault();
var abitext = document.getElementById("abitexts").value;
if(abitext == ""){
abimodal.style.display = 'none';
}else{
$.ajax({
url: '../abi/addabi.php',
method: 'POST',
data: { uniqid: uniqid2, abitext: abitext},
dataType: 'json',
success: function (response) {
console.log(response); // レスポンス内容をコンソールに表示
if (response.success) {
abimodal.style.display = 'none';
postAbiElement.remove();
} else {
}
},
error: function (xhr, status, error) {
}
});
}
});
});
});
</script>
</html>
+664
View File
@@ -0,0 +1,664 @@
<?php
$servernamefile = "../server/servername.txt";
function createUniqId(){
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime,10,36);
}
require('../db.php');
// 変数の初期化
$datetime = array();
$user_name = null;
$message = array();
$message_data = null;
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
session_start();
$userid = $_SESSION['userid'];
$username = $_SESSION['username'];
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();
}
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_SESSION['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_SESSION['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_COOKIE['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
$username = $_COOKIE['username']; // クッキーから取得した値をセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} else {
// ログインが許可されていない場合、ログインページにリダイレクト
header("Location: ../login.php");
exit;
}
if(empty($userid)){
header("Location: ../login.php");
exit;
}
if(empty($username)){
header("Location: ../login.php");
exit;
}
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,
));
$userQuery = $dbh->prepare("SELECT username, userid, profile, role FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $userid);
$userQuery->execute();
$userData = $userQuery->fetch();
$role = $userData["role"];
$dbh = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
$rerole = $dbh->prepare("SELECT username, userid, password, mailadds, profile, iconname, iconcontent, icontype, iconsize, headname, headcontent, headtype, headsize, role, datetime FROM account WHERE userid = :userid");
$rerole->bindValue(':userid', $userid);
// SQL実行
$rerole->execute();
$userdata = $rerole->fetch(); // ここでデータベースから取得した値を $role に代入する
}
if( !empty($_POST['btn_submit']) ) {
// 空白除去
$username = $_POST['username'];
$mailadds = $_POST['mailadds'];
$profile = $_POST['profile'];
$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 userid = :userid limit 1');
$query->execute(array(':userid' => $userid));
$result = $query->fetch();
// ユーザーネームの入力チェック
if( empty($username) ) {
$error_message[] = '表示名を入力してください。';
} else {
// 文字数を確認
if( 25 < mb_strlen($username, 'UTF-8') ) {
$error_message[] = 'ユーザーネームは25文字以内で入力してください。';
}
}
if( empty($error_message) ) {
// トランザクション開始
$pdo->beginTransaction();
$hashpassword = password_hash($password, PASSWORD_DEFAULT);
try {
// SQL作成
$stmt = $pdo->prepare("UPDATE account SET username = :username, mailadds = :mailadds, profile = :profile WHERE userid = :userid;");
// 他の値をセット
$stmt->bindParam(':username', $username, PDO::PARAM_STR);
$stmt->bindParam(':mailadds', $mailadds, PDO::PARAM_STR);
$stmt->bindParam(':profile', $profile, PDO::PARAM_STR);
// 条件を指定
// 以下の部分を適切な条件に置き換えてください
$stmt->bindValue(':userid', $userid, PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->execute();
// コミット
$res = $pdo->commit();
} catch (Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
if ($res) {
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location:".$url."");
exit;
} else {
$error_message[] = '更新に失敗しました。';
}
// プリペアドステートメントを削除
$stmt = null;
}
}
if( !empty($_POST['pass_submit']) ) {
$password = $_POST['password'];
$hashpassword = password_hash($password, PASSWORD_DEFAULT);
$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 userid = :userid limit 1');
$query->execute(array(':userid' => $userid));
$result = $query->fetch();
// ユーザーネームの入力チェック
if( empty($password) ) {
$error_message[] = 'パスワードを入力してください。';
} 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)) {
$error_message[] = "パスワードが弱いです。セキュリティ上変更してください。";
} else {
}
// 文字数を確認
if( 100 < mb_strlen($password, 'UTF-8') ) {
$error_message[] = 'パスワードは100文字以内で入力してください。';
}
if( 4 > mb_strlen($password, 'UTF-8') ) {
$error_message[] = 'パスワードは4文字以上である必要があります。';
}
}
if( empty($error_message) ) {
// トランザクション開始
$pdo->beginTransaction();
$hashpassword = password_hash($password, PASSWORD_DEFAULT);
try {
// SQL作成
$stmt = $pdo->prepare("UPDATE account SET password = :password WHERE userid = :userid;");
// 他の値をセット
$stmt->bindParam(':password', $hashpassword, PDO::PARAM_STR);
// 条件を指定
// 以下の部分を適切な条件に置き換えてください
$stmt->bindValue(':userid', $userid, PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->execute();
// コミット
$res = $pdo->commit();
} catch (Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
if ($res) {
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location:".$url."");
exit;
} else {
$error_message[] = '更新に失敗しました。';
}
// プリペアドステートメントを削除
$stmt = null;
}
}
if( !empty($_POST['logout']) ) {
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($name, '', time()-1000, '/');
}
}
// リダイレクト先のURLへ転送する
$url = '../index.php';
header('Location: ' . $url, true, 303);
// すべての出力を終了
exit;
}
if( !empty($_POST['img1btn_submit']) ) {
if (!empty($_FILES['image2s']['name'])) {
$headimg = $_FILES['image2s'];
}else{
$error_message[] = 'ヘッダー画像を選択してください';
}
$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 userid = :userid limit 1');
$query->execute(array(':userid' => $userid));
$result = $query->fetch();
if( empty($error_message) ) {
// トランザクション開始
$pdo->beginTransaction();
try {
// SQL作成
$stmt = $pdo->prepare("UPDATE account SET headname = :headname, headtype = :headtype, headcontent = :headcontent, headsize = :headsize WHERE userid = :userid");
// ヘッダー画像関連の処理
$headName = $headimg['name'];
$headType = $headimg['type'];
$headContent = file_get_contents($headimg['tmp_name']);
$headSize = $headimg['size'];
// ヘッダー画像のバインド
$stmt->bindValue(':headname', $headName, PDO::PARAM_STR);
$stmt->bindValue(':headtype', $headType, PDO::PARAM_STR);
$stmt->bindValue(':headcontent', $headContent, PDO::PARAM_STR);
$stmt->bindValue(':headsize', $headSize, PDO::PARAM_INT);
// ユーザーIDのバインド(WHERE句に必要)
$stmt->bindValue(':userid', $userid, PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->execute();
// コミット
$res = $pdo->commit();
} catch (Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
if ($res) {
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location:".$url."");
exit;
} else {
$error_message[] = '更新に失敗しました。';
}
// プリペアドステートメントを削除
$stmt = null;
}
}
if( !empty($_POST['img2btn_submit']) ) {
if (!empty($_FILES['image']['name'])) {
$img = $_FILES['image'];
}else{
$error_message[] = 'アイコン画像を選択してください';
}
$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 userid = :userid limit 1');
$query->execute(array(':userid' => $userid));
$result = $query->fetch();
if( empty($error_message) ) {
// トランザクション開始
$pdo->beginTransaction();
try {
// SQL作成
$stmt = $pdo->prepare("UPDATE account SET iconname = :iconname, icontype = :icontype, iconcontent = :iconcontent, iconsize = :iconsize WHERE userid = :userid");
$iconName = $img['name'];
$iconType = $img['type'];
$iconContent = file_get_contents($img['tmp_name']);
$iconSize = $img['size'];
// アイコン画像のバインド
$stmt->bindValue(':iconname', $iconName, PDO::PARAM_STR);
$stmt->bindValue(':icontype', $iconType, PDO::PARAM_STR);
$stmt->bindValue(':iconcontent', $iconContent, PDO::PARAM_STR);
$stmt->bindValue(':iconsize', $iconSize, PDO::PARAM_INT);
// ユーザーIDのバインド(WHERE句に必要)
$stmt->bindValue(':userid', $userid, PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->execute();
// コミット
$res = $pdo->commit();
} catch (Exception $e) {
// エラーが発生した時はロールバック
$pdo->rollBack();
}
if ($res) {
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location:".$url."");
exit;
} else {
$error_message[] = '更新に失敗しました。';
}
// プリペアドステートメントを削除
$stmt = null;
}
}
if( !empty($_POST['logout']) ) {
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($name, '', time()-1000, '/');
}
}
// リダイレクト先のURLへ転送する
$url = '../index.php';
header('Location: ' . $url, true, 303);
// すべての出力を終了
exit;
}
// データベースの接続を閉じる
$pdo = null;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="apple-touch-icon" type="image/png" href="../favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>設定 - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<?php require('../require/leftbox.php');?>
<main>
<?php if( !empty($error_message) ): ?>
<ul class="errmsg">
<?php foreach( $error_message as $value ): ?>
<p> <?php echo $value; ?></p>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<form class="formarea" enctype="multipart/form-data" method="post">
<div class="hed">
<img src="../user/headimage.php?account=<?php echo urlencode($userdata['userid']); ?>">
</div>
<div class="iconimg">
<img src="../image.php">
</div>
<label class="imgbtn" for="file_upload">アイコン選択
<input type="file" id="file_upload" name="image" accept="image/*">
</label>
<label class="imgbtn2" for="file_upload2">ヘッダー選択
<input type="file" id="file_upload2" name="image2s" accept="image/*">
</label>
<div class="sub">
<input type="submit" class = "imgbtn" name="img1btn_submit" value="ヘッダー画像更新">
<input type="submit" class = "imgbtn" name="img2btn_submit" value="アイコン画像更新">
</div>
<!--ユーザーネーム関係-->
<div>
<p>ユーザーネーム</p>
<input id="username" placeholder="" class="inbox" type="text" name="username" value="<?php if( !empty($userdata['username']) ){ echo htmlspecialchars( $userdata['username'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<div>
<p>メールアドレス</p>
<input id="mailadds" type="text" placeholder="" class="inbox" name="mailadds" value="<?php if( !empty($userdata['mailadds']) ){ echo htmlspecialchars( $userdata['mailadds'], ENT_QUOTES, 'UTF-8'); } ?>">
</div>
<!--プロフィール関連-->
<div>
<p>プロフィール</p>
<textarea id="profile" type="text" placeholder="" class="inbox" name="profile" value=""><?php if( !empty($userdata['profile']) ){ echo htmlspecialchars( $userdata['profile'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
</div>
<input type="submit" class = "irobutton" name="btn_submit" value="情報更新">
<div>
<p>パスワード</p>
<input id="password" type="text" class="inbox" name="password" oncopy="return false" onpaste="return false" oncontextmenu="return false" style="-webkit-text-security:disc;" value="">
</div>
<input type="submit" class = "irobutton" name="pass_submit" value="パスワード更新">
</form>
</main>
<?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?>
</body>
</html>
+41
View File
@@ -0,0 +1,41 @@
<?php
$servernamefile = "server/servername.txt";
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/style.css">
<link rel="apple-touch-icon" type="image/png" href="favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="favicon/icon-192x192.png">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>アカウント登録完了!!! - <?php echo file_get_contents($servernamefile);?></title>
</head>
<script src="js/back.js"></script>
<body>
<div class="leftbox2">
<div class="logo">
<img src="img/uwuzulogo.svg">
</div>
<div class="textbox">
<h1>アカウント作成完了!</h1>
<p><br>いぇ~い!</p>
<p>88888888888</p>
<p>アカウント登録が完了しました!</p>
<div class="btnbox">
<a href="login.php" class="sirobutton">ログイン</a>
</div>
</div>
</div>
</body>
</html>
+42
View File
@@ -0,0 +1,42 @@
var CACHE_NAME = "app_uwuzu";
var urlsToCache = [
"home/index.php",
"search/index.php",
"require/botbox.php",
"require/leftbox.php",
"require/rightbox.php",
"require/botbox.php",
"user/index.php",
"settings/index.php",
"rule/terms.php",
"rule/privacypolicy.php",
"rule/uwuzuabout.php",
"index.php",
"login.php",
"new.php",
"check.php",
"success.php",
];
self.addEventListener('install', function(event) {
event.waitUntil(
caches.open(CACHE_NAME)
.then(
function(cache){
return cache.addAll(urlsToCache);
})
);
});
self.addEventListener('fetch', function(event) {
event.respondWith(
caches.match(event.request)
.then(
function (response) {
if (response) {
return response;
}
return fetch(event.request);
})
);
});
+620
View File
@@ -0,0 +1,620 @@
<?php
function createUniqId(){
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime,10,36);
}
require('../db.php');
// タイムゾーン設定
date_default_timezone_set('Asia/Tokyo');
// 変数の初期化
$datetime = array();
$user_name = null;
$message = array();
$message_data = null;
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
session_start();
$userid = $_SESSION['userid'];
$username = $_SESSION['username'];
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();
}
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_SESSION['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_SESSION['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_COOKIE['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
$username = $_COOKIE['username']; // クッキーから取得した値をセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} else {
// ログインが許可されていない場合、ログインページにリダイレクト
header("Location: ../login.php");
exit;
}
if(empty($userid)){
header("Location: ../login.php");
exit;
}
if(empty($username)){
header("Location: ../login.php");
exit;
}
$ueuseid = str_replace('!', '', $_GET['ueuseid']);
$touserid = str_replace('~', '', $_GET['touser']);
if( !empty($_POST['btn_submit']) ) {
$ueuse = $_POST['ueuse'];
// メッセージの入力チェック
if( empty($ueuse) ) {
$error_message[] = '内容を入力してください。';
} else {
// 文字数を確認
if( 1024 < mb_strlen($ueuse, 'UTF-8') ) {
$error_message[] = '内容は1024文字以内で入力してください。';
}
}
if (empty($_FILES['upload_images']['name'])) {
$photo1 = "none";
} else {
// アップロードされたファイル情報
$uploadedFile = $_FILES['upload_images'];
// アップロードされたファイルの拡張子を取得
$extension = pathinfo($uploadedFile['name'], PATHINFO_EXTENSION);
// 新しいファイル名を生成(uniqid + 拡張子)
$newFilename = uniqid() . '-'.$userid.'.' . $extension;
// 保存先のパスを生成
$uploadedPath = '../ueuseimages/' . $newFilename;
// ファイルを移動
$result = move_uploaded_file($uploadedFile['tmp_name'], $uploadedPath);
if ($result) {
$photo1 = $uploadedPath; // 保存されたファイルのパスを使用
} else {
$error_message[] = 'アップロード失敗!(1)エラーコード:' . $uploadedFile['error'].'<br>'.var_dump($_FILES['upload_images']);
}
}
if (empty($_FILES['upload_images2']['name'])) {
$photo2 = "none";
} else {
if (empty($_FILES['upload_images']['name'])){
$error_message[] = '画像1から画像を選択してください!!!';
}
// アップロードされたファイル情報
$uploadedFile2 = $_FILES['upload_images2'];
if( 10000000 < $uploadedFile2["size"] ) {
$error_message[] = 'ファイルサイズが大きすぎます!';
}
// アップロードされたファイルの拡張子を取得
$extension2 = pathinfo($uploadedFile2['name'], PATHINFO_EXTENSION);
// 新しいファイル名を生成(uniqid + 拡張子)
$newFilename2 = uniqid() . '-'.$userid.'.' . $extension2;
// 保存先のパスを生成
$uploadedPath2 = '../ueuseimages/' . $newFilename2;
// ファイルを移動
$result2 = move_uploaded_file($uploadedFile2['tmp_name'], $uploadedPath2);
if ($result2) {
$photo2 = $uploadedPath2; // 保存されたファイルのパスを使用
} else {
$error_message[] = 'アップロード失敗!(2)エラーコード:' . $uploadedFile2['error'].'<br>'.var_dump($_FILES['upload_images']);
}
}
if (empty($_FILES['upload_videos1']['name'])) {
$video1 = "none";
} else {
// アップロードされたファイル情報
$uploadedFile3 = $_FILES['upload_videos1'];
// アップロードされたファイルの拡張子を取得
$extension3 = strtolower(pathinfo($uploadedFile3['name'], PATHINFO_EXTENSION)); // 小文字に変換
// サポートされている動画フォーマットの拡張子を配列で定義
$supportedExtensions = array("mp4", "avi", "mov", "webm");
if (in_array($extension3, $supportedExtensions)) {
// 正しい拡張子の場合、新しいファイル名を生成
$newFilename3 = uniqid() . '-'.$userid.'.' . $extension3;
// 保存先のパスを生成
$uploadedPath3 = '../ueusevideos/' . $newFilename3;
// ファイルを移動
$result3 = move_uploaded_file($uploadedFile3['tmp_name'], $uploadedPath3);
if ($result3) {
$video1 = $uploadedPath3; // 保存されたファイルのパスを使用
} else {
$error_message[] = 'アップロード失敗!エラーコード:' . $uploadedFile3['error'];
}
} else {
$error_message[] = '対応していないファイル形式です!';
}
}
if( empty($error_message) ) {
// 書き込み日時を取得
$datetime = date("Y-m-d H:i:s");
$uniqid = createUniqId();
$abi = "none";
// トランザクション開始
$pdo->beginTransaction();
try {
// SQL作成
$stmt = $pdo->prepare("INSERT INTO ueuse (username, account, uniqid, rpuniqid, ueuse, photo1, photo2, video1, datetime, abi) VALUES (:username, :account, :uniqid, :rpuniqid, :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(':rpuniqid', $ueuseid, PDO::PARAM_STR);
$stmt->bindParam(':ueuse', $ueuse, PDO::PARAM_STR);
$stmt->bindParam(':photo1', $photo1, PDO::PARAM_STR);
$stmt->bindParam(':photo2', $photo2, PDO::PARAM_STR);
$stmt->bindParam(':video1', $video1, PDO::PARAM_STR);
$stmt->bindParam(':datetime', $datetime, PDO::PARAM_STR);
$stmt->bindParam(':abi', $abi, PDO::PARAM_STR);
// SQLクエリの実行
$res = $stmt->execute();
// コミット
$res = $pdo->commit();
$pdo->beginTransaction();
$msg = ''.$ueuse.'';
$title = ''.$userid.'さんが返信しました!';
$url = $_SERVER['REQUEST_URI'];
$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();
}
if( $res ) {
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location:".$url."");
exit;
} else {
$error_message[] = $e->getMessage();
}
// プリペアドステートメントを削除
$stmt = null;
}
}
if( !empty($_POST['logout']) ) {
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($name, '', time()-1000, '/');
}
}
// リダイレクト先のURLへ転送する
$url = '../index.php';
header('Location: ' . $url, true, 303);
// すべての出力を終了
exit;
}
// データベースの接続を閉じる
$pdo = null;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/home.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1">
<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">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title>ID <?php echo htmlspecialchars($ueuseid, ENT_QUOTES, 'UTF-8'); ?> のユーズ - uwuzu</title>
</head>
<body>
<?php require('../require/leftbox.php');?>
<main class="outer">
<?php if( !empty($error_message) ): ?>
<ul class="errmsg">
<?php foreach( $error_message as $value ): ?>
<p> <?php echo $value; ?></p>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<div class="emojibox">
<h1>返信</h1>
</div>
<form method="post" enctype="multipart/form-data">
<div class="sendbox">
<textarea id="ueuse" placeholder="へんし~ん!!!" name="ueuse"><?php if( !empty($_SESSION['ueuse']) ){ echo htmlspecialchars( $_SESSION['ueuse'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
<p>画像のEXIF情報(位置情報など)は削除されません。<br>情報漏洩に気をつけてくださいね…</p>
<div class="fxbox">
<label for="upload_images" id="images">
<img src="../img/sysimage/image_1.svg">
<input type="file" name="upload_images" id ="upload_images" accept="image/*">
</label>
<label for="upload_images2" id="images2">
<img src="../img/sysimage/image_1.svg">
<input type="file" name="upload_images2" id ="upload_images2" accept="image/*">
</label>
<label for="upload_videos1" id="videos1">
<img src="../img/sysimage/video_1.svg">
<input type="file" name="upload_videos1" id ="upload_videos1" accept="video/*">
</label>
<input type="submit" class="ueusebtn" name="btn_submit" value="返信する">
</div>
</div>
</form>
<script>
document.getElementById("upload_videos1").addEventListener('change', function(e){
var file_reader = new FileReader();
// ファイルの読み込みを行ったら実行
file_reader.addEventListener('load', function(e) {
console.log(e.target.result);
const element = document.querySelector('#videos1');
const createElement = '<p>動画を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
});
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) {
console.log(e.target.result);
const element = document.querySelector('#images2');
const createElement = '<p>画像を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
});
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) {
console.log(e.target.result);
const element = document.querySelector('#images');
const createElement = '<p>画像を選択しました。</p>';
element.insertAdjacentHTML('afterend', createElement);
});
file_reader.readAsText(e.target.files[0]);
});
</script>
<section class="inner">
<div id="postContainer">
</div>
</section>
<div id="myDelModal" class="modal">
<div class="modal-content">
<p>ユーズを削除しますか?</p>
<form class="btn_area" method="post" id="deleteForm">
<input type="button" id="deleteButton" class="fbtn_no" name="delete" value="削除">
<input type="button" id="cancelButton" class="fbtn" value="キャンセル">
</form>
</div>
</div>
<div id="myAbiModal" class="modal">
<div class="modal-content">
<p>ユーズに追記しますか?</p>
<p>※追記は削除出来ません。</p>
<form method="post" id="AbiForm">
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlspecialchars( $_SESSION['abi'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
<div class="btn_area">
<input type="submit" id="AbiAddButton" class="fbtn_no" name="abi" value="追記">
<input type="button" id="AbiCancelButton" class="fbtn" value="キャンセル">
</div>
</form>
</div>
</div>
</main>
<?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?>
</body>
<script>
$(document).ready(function() {
loadPosts();
var pageNumber = 1;
var isLoading = false;
function loadPosts() {
if (isLoading) return;
isLoading = true;
var ueuseid = '<?php echo $ueuseid; ?>';
var userid = '<?php echo $userid; ?>';
$.ajax({
url: '../nextpage/ueusepage.php', // PHPファイルへのパス
method: 'GET',
data: { page: pageNumber, id: ueuseid ,userid: userid},
dataType: 'html',
success: function(response) {
$('#postContainer').append(response);
pageNumber++;
isLoading = false;
}
});
}
$('.outer').on('scroll', function() {
var innerHeight = $('.inner').innerHeight(), //内側の要素の高さ
outerHeight = $('.outer').innerHeight(), //外側の要素の高さ
outerBottom = innerHeight - outerHeight; //内側の要素の高さ - 外側の要素の高さ
if (outerBottom <= $('.outer').scrollTop()) {
var elem = document.getElementById("noueuse");
if (elem === null){
// 存在しない場合の処理
loadPosts();
} else {
// 存在する場合の処理
return;
}
}
});
$(document).on('click', '.favbtn, .favbtn_after', function(event) {
event.preventDefault();
var postUniqid = $(this).data('uniqid');
var userid = '<?php echo $userid; ?>';
var likeCountElement = $(this).find('.like-count'); // いいね数を表示する要素
var isLiked = $(this).hasClass('favbtn_after'); // 現在のいいねの状態を判定
var $this = $(this); // ボタン要素を変数に格納
$.ajax({
url: '../favorite/favorite.php',
method: 'POST',
data: { uniqid: postUniqid, userid: userid }, // ここに自分のユーザーIDを指定
dataType: 'json',
success: function(response) {
if (response.success) {
// いいね成功時の処理
if (isLiked) {
$this.removeClass('favbtn_after'); // クラスを削除していいねを取り消す
$this.find('img').attr('src', '../img/sysimage/favorite_1.svg'); // 画像を元の画像に戻す
} else {
$this.addClass('favbtn_after'); // クラスを追加していいねを追加する
$this.find('img').attr('src', '../img/sysimage/favorite_2.svg'); // 画像を新しい画像に置き換える
}
var newFavoriteList = response.newFavorite.split(',');
var likeCount = newFavoriteList.length - 1;
likeCountElement.text(likeCount); // いいね数を更新
} else {
// いいね失敗時の処理
}
}.bind(this), // コールバック内でthisが適切な要素を指すようにbindする
error: function() {
// エラー時の処理
}
});
});
var modal = document.getElementById('myDelModal');
var deleteButton = document.getElementById('deleteButton');
var cancelButton = document.getElementById('cancelButton'); // 追加
$(document).on('click', '.delbtn', function (event) {
modal.style.display = 'block';
var uniqid2 = $(this).attr('data-uniqid2');
var postElement = $(this).closest('.ueuse');
deleteButton.addEventListener('click', () => {
modal.style.display = 'none';
$.ajax({
url: '../delete/delete.php',
method: 'POST',
data: { uniqid: uniqid2 },
dataType: 'json',
success: function (response) {
if (response.success) {
postElement.remove();
} else {
// 削除失敗時の処理
}
},
error: function () {
// エラー時の処理
}
});
});
cancelButton.addEventListener('click', () => { // 追加
modal.style.display = 'none';
});
});
var abimodal = document.getElementById('myAbiModal');
var AbiAddButton = document.getElementById('AbiAddButton');
var AbiCancelButton = document.getElementById('AbiCancelButton');
$(document).on('click', '.addabi', function (event) {
abimodal.style.display = 'block';
var uniqid2 = $(this).attr('data-uniqid2');
var postAbiElement = $(this).closest('.addabi');
AbiCancelButton.addEventListener('click', () => {
abimodal.style.display = 'none';
});
$('#AbiForm').off('submit').on('submit', function (event) {
event.preventDefault();
var abitext = document.getElementById("abitexts").value;
if(abitext == ""){
abimodal.style.display = 'none';
}else{
$.ajax({
url: '../abi/addabi.php',
method: 'POST',
data: { uniqid: uniqid2, abitext: abitext},
dataType: 'json',
success: function (response) {
console.log(response); // レスポンス内容をコンソールに表示
if (response.success) {
abimodal.style.display = 'none';
postAbiElement.remove();
} else {
}
},
error: function (xhr, status, error) {
}
});
}
});
});
});
</script>
</html>
+78
View File
@@ -0,0 +1,78 @@
<?php
require('../db.php');
// 変数の初期化
$current_date = null;
$message_array = array();
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
$row["userid"] = array();
$row["password"] = array();
$ruserid = array();
$rpassword = array();
$userid = null;
$_SESSION["userid"]="";
$password = null;
$_SESSION["password"]="";
session_start();
$option = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
);
$pdo = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
//$row['userid'] = "daichimarukn";
$userid = $_GET['account'];
$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,
);
if( empty($userid) ) {
$filePath = 'img/deficon/icon.png';
$data = file_get_contents($filePath);
header('Content-type: image/png');
//データを出力
echo $data;
exit();
}else{
$dbh = new PDO('mysql:charset=UTF8;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option);
$result = $dbh->prepare("SELECT headname, headcontent, headtype, headsize profile FROM account WHERE userid = :userid");
$result->bindValue(':userid', $userid);
// SQL実行
$result->execute();
$row = $result->fetch(); // ここでデータベースから取得した値を $row に代入する
header('Content-type: ' . $row['headtype']);
echo $row['headcontent'];
exit();
}
+646
View File
@@ -0,0 +1,646 @@
<?php
$servernamefile = "../server/servername.txt";
function createUniqId(){
list($msec, $sec) = explode(" ", microtime());
$hashCreateTime = $sec.floor($msec*1000000);
$hashCreateTime = strrev($hashCreateTime);
return base_convert($hashCreateTime,10,36);
}
require('../db.php');
// 変数の初期化
$datetime = array();
$user_name = null;
$message = array();
$message_data = null;
$error_message = array();
$pdo = null;
$stmt = null;
$res = null;
$option = null;
session_start();
$userid = $_SESSION['userid'];
$username = $_SESSION['username'];
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();
}
if(isset($_SESSION['admin_login']) && $_SESSION['admin_login'] === true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_SESSION['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_SESSION['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_SESSION['userid']; // セッションに格納されている値をそのままセット
$username = $_SESSION['username']; // セッションに格納されている値をそのままセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} elseif (isset($_COOKIE['admin_login']) && $_COOKIE['admin_login'] == true) {
$passQuery = $pdo->prepare("SELECT username,userid,loginid,admin FROM account WHERE userid = :userid");
$passQuery->bindValue(':userid', $_COOKIE['userid']);
$passQuery->execute();
$res = $passQuery->fetch();
if(empty($res["userid"])){
header("Location: ../login.php");
exit;
}elseif($_COOKIE['loginid'] === $res["loginid"]){
// セッションに値をセット
$userid = $_COOKIE['userid']; // クッキーから取得した値をセット
$username = $_COOKIE['username']; // クッキーから取得した値をセット
$_SESSION['admin_login'] = true;
$_SESSION['userid'] = $userid;
$_SESSION['username'] = $username;
$_SESSION['loginid'] = $res["loginid"];
setcookie('userid', $userid, time() + 60 * 60 * 24 * 14);
setcookie('username', $username, time() + 60 * 60 * 24 * 14);
setcookie('loginid', $res["loginid"], time() + 60 * 60 * 24 * 14);
setcookie('admin_login', true, time() + 60 * 60 * 24 * 14);
}else{
header("Location: ../login.php");
exit;
}
} else {
// ログインが許可されていない場合、ログインページにリダイレクト
header("Location: ../login.php");
exit;
}
if(empty($userid)){
header("Location: ../login.php");
exit;
}
if(empty($username)){
header("Location: ../login.php");
exit;
}
function customStripTags($html, $allowedTags) {
$allowedTagsString = '<' . implode('><', $allowedTags) . '>';
return strip_tags($html, $allowedTagsString);
}
$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,
));
$uwuzuid = str_replace('@', '', $_GET['uwuzuid']);
// ユーズ内の絵文字を画像に置き換える
function replaceEmojisWithImages($postText) {
// ユーズ内で絵文字名(:emoji:)を検出して画像に置き換える
$pattern = '/:(\w+):/';
$postTextWithImages = preg_replace_callback($pattern, function($matches) {
$emojiName = $matches[1];
return "<img src='../emoji/emojiimage.php?emoji=" . urlencode($emojiName) . "' alt='$emojiName'>";
}, $postText);
return $postTextWithImages;
}
function replaceURLsWithLinks($postText) {
// URLを正規表現を使って検出
$pattern = '/(https?:\/\/[^\s]+)/';
preg_match_all($pattern, $postText, $matches);
// 検出したURLごとに処理を行う
foreach ($matches[0] as $url) {
// ドメイン部分を抽出
$parsedUrl = parse_url($url);
$domain = isset($parsedUrl['host']) ? $parsedUrl['host'] : '';
// ドメインのみを表示するaタグを生成
$link = "<a href='$url'>$domain</a>";
// URLをドメインのみを表示するaタグで置き換え
$postText = str_replace($url, $link, $postText);
}
return $postText;
}
$userQuery = $dbh->prepare("SELECT username, userid, profile, role, follower FROM account WHERE userid = :userid");
$userQuery->bindValue(':userid', $uwuzuid);
$userQuery->execute();
$userData = $userQuery->fetch();
if(!empty($userData["userid"])){
$roles = explode(',', $userData["role"]); // カンマで区切られたロールを配列に分割
$rerole = $dbh->prepare("SELECT follow, follower, username, userid, password, mailadds, profile, iconname, iconcontent, icontype, iconsize, headname, headcontent, headtype, headsize, role, datetime FROM account WHERE userid = :userid");
$rerole->bindValue(':userid', $uwuzuid);
// SQL実行
$rerole->execute();
$userdata = $rerole->fetch(); // ここでデータベースから取得した値を $role に代入する
$roleDataArray = array();
foreach ($roles as $roleId) {
$rerole = $dbh->prepare("SELECT rolename, roleauth, rolecolor FROM role WHERE roleidname = :role");
$rerole->bindValue(':role', $roleId);
$rerole->execute();
$roleDataArray[$roleId] = $rerole->fetch();
}
//-------フォロー数---------
$follow = $userdata['follow']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える
$followIds = explode(',', $follow);
$followCount = count($followIds)-1;
$follow_on_me = strpos($follow, $userid);
if ($follow_on_me !== false) {
$follow_yes = "フォローされています"; // worldを含む:6
}else{
$follow_yes = ""; // worldを含む:6
}
//-------フォロワー数---------
$follower = $userdata['follower']; // コンマで区切られたユーザーIDを含む変数
// コンマで区切って配列に分割し、要素数を数える
$followerIds = explode(',', $follower);
$followerCount = count($followerIds)-1;
$profileText = htmlspecialchars($userData['profile'], ENT_QUOTES, 'UTF-8');
}else{
$userData["userid"] = "none";
$userData['username'] = "ゆーざーなし";
}
}
if (!empty($_POST['follow'])) {
// フォローボタンが押された場合の処理
$followerList = explode(',', $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', $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', $userData["userid"], PDO::PARAM_STR);
$updateQuery->bindValue(':userid', $userid, PDO::PARAM_STR);
$res_follow = $updateQuery->execute();
if ($res && $res_follow) {
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location:" . $url);
exit;
} else {
$error_message[] = '更新に失敗しました。';
}
$stmt = null;
}
} elseif (!empty($_POST['unfollow'])) {
// フォロー解除ボタンが押された場合の処理
$followerList = explode(',', $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', $userData['userid'], PDO::PARAM_STR);
$res = $updateQuery->execute();
$deluserid = ",".$userdata["userid"];
// 自分のfollowカラムから相手のユーザーIDを削除
$updateQuery = $pdo->prepare("UPDATE account SET follow = REPLACE(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) {
$url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location:" . $url);
exit;
} else {
$error_message[] = '更新に失敗しました。';
}
$stmt = null;
}
}
if( !empty($_POST['logout']) ) {
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($name, '', time()-1000, '/');
}
}
// リダイレクト先のURLへ転送する
$url = '../index.php';
header('Location: ' . $url, true, 303);
// すべての出力を終了
exit;
}
// データベースの接続を閉じる
$pdo = null;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<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">
<link rel="icon" type="image/png" href="../favicon/icon-192x192.png">
<title><?php echo htmlspecialchars($userData['username'], ENT_QUOTES, 'UTF-8'); ?> さんのプロフィール - <?php echo file_get_contents($servernamefile);?></title>
</head>
<body>
<?php require('../require/leftbox.php');?>
<main class="outer">
<?php if( !empty($error_message) ): ?>
<ul class="errmsg">
<?php foreach( $error_message as $value ): ?>
<p> <?php echo $value; ?></p>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<div class="userheader">
<?php if($userData["userid"] == "none"){?>
<div class="tokonone" id="noueuse"><p>このユーザーは存在しません</p></div>
<?php }else{?>
<div class="hed">
<img src="../user/headimage.php?account=<?php echo urlencode($userData['userid']); ?>">
</div>
<div class="icon">
<img src="../home/tlimage.php?account=<?php echo urlencode($userData['userid']); ?>">
<h2><?php echo htmlspecialchars($userData['username'], ENT_QUOTES, 'UTF-8'); ?></h2>
<p>@<?php echo htmlspecialchars($userData['userid'], ENT_QUOTES, 'UTF-8'); ?></p>
</div>
<div class="roleboxes">
<?php foreach ($roles as $roleId): ?>
<?php $roleData = $roleDataArray[$roleId]; ?>
<div class="rolebox" style="border: 1px solid <?php echo '#' . $roleData["rolecolor"]; ?>;">
<p style="color: <?php echo '#' . $roleData["rolecolor"]; ?>;">
<?php if (!empty($roleData["rolename"])) { echo htmlspecialchars($roleData["rolename"], ENT_QUOTES, 'UTF-8'); } ?>
</p>
</div>
<?php endforeach; ?>
</div>
<div class="profile">
<p><?php echo nl2br($profileText); ?></p>
</div>
</div>
<div class="fzone">
<div class="time">
<p><?php echo date('Y年m月d日 H:i:s', strtotime($userdata['datetime'])); ?>からuwuzuを利用しています。</p>
<p>フォロー数:<?php echo $followCount;?> フォロワー数:<?php echo $followerCount;?></p>
</div>
<?php if(!empty($follow_yes)){?>
<div class="follow_yes">
<p><?php echo $follow_yes;?></p>
</div>
<?php }?>
<?php if ($userData['userid'] == $userid) { ?>
<div class="follow">
<a href="../settings/" class="fbtn_no">設定</a>
</div>
<?php } else { ?>
<form method="post">
<div class="follow">
<?php
$followerList = explode(',', $userdata['follower']);
if (in_array($userid, $followerList)) {
// フォロー済みの場合はフォロー解除ボタンを表示
echo '<input type="button" id="openModalButton" class="fbtn_un" name="unfollow" value="フォロー解除">';
} else {
// 未フォローの場合はフォローボタンを表示
echo '<input type="submit" class="fbtn" name="follow" value="フォロー">';
}
?>
</div>
</form>
<?php } ?>
<?php } ?>
</div>
<div id="myModal" class="modal">
<div class="modal-content">
<p><?php echo htmlspecialchars($userData['username'], ENT_QUOTES, 'UTF-8'); ?>さんをフォロー解除しますか?</p>
<form class="btn_area" method="post">
<input type="submit" id="openModalButton" class="fbtn_no" name="unfollow" value="フォロー解除">
<input type="button" id="closeModal" class="fbtn" value="キャンセル">
</form>
</div>
</div>
<hr>
<section class="inner">
<div id="postContainer">
</div>
</section>
<div id="loading" class="loading" style="display: none;">
🤔
</div>
<div id="myDelModal" class="modal">
<div class="modal-content">
<p>ユーズを削除しますか?</p>
<form class="btn_area" method="post" id="deleteForm">
<input type="button" id="deleteButton" class="fbtn_no" name="delete" value="削除">
<input type="button" id="cancelButton" class="fbtn" value="キャンセル">
</form>
</div>
</div>
<div id="myAbiModal" class="modal">
<div class="modal-content">
<p>ユーズに追記しますか?</p>
<p>※追記は削除出来ません。</p>
<form method="post" id="AbiForm">
<textarea id="abitexts" placeholder="なに追記する~?" name="abi"><?php if( !empty($_SESSION['abi']) ){ echo htmlspecialchars( $_SESSION['abi'], ENT_QUOTES, 'UTF-8'); } ?></textarea>
<div class="btn_area">
<input type="submit" id="AbiAddButton" class="fbtn_no" name="abi" value="追記">
<input type="button" id="AbiCancelButton" class="fbtn" value="キャンセル">
</div>
</form>
</div>
</div>
</main>
<?php require('../require/rightbox.php');?>
<?php require('../require/botbox.php');?>
</body>
<script>
$(document).ready(function() {
loadPosts();
var pageNumber = 1;
var isLoading = false;
function loadPosts() {
if (isLoading) return;
isLoading = true;
$("#loading").show();
var uwuzuid = '<?php echo $uwuzuid; ?>';
var userid = '<?php echo $userid; ?>';
$.ajax({
url: '../nextpage/userpage.php', // PHPファイルへのパス
method: 'GET',
data: { page: pageNumber, id: uwuzuid ,userid: userid},
dataType: 'html',
success: function(response) {
$('#postContainer').append(response);
pageNumber++;
isLoading = false;
$("#loading").hide();
}
});
}
$('.outer').on('scroll', function() {
var innerHeight = $('.inner').innerHeight(), //内側の要素の高さ
outerHeight = $('.outer').innerHeight(), //外側の要素の高さ
outerBottom = innerHeight - outerHeight; //内側の要素の高さ - 外側の要素の高さ
if (outerBottom <= $('.outer').scrollTop()) {
var elem = document.getElementById("noueuse");
if (elem === null){
// 存在しない場合の処理
loadPosts();
} else {
// 存在する場合の処理
return;
}
}
});
$(document).on('click', '.favbtn, .favbtn_after', function(event) {
event.preventDefault();
var postUniqid = $(this).data('uniqid');
var userid = '<?php echo $userid; ?>';
var likeCountElement = $(this).find('.like-count'); // いいね数を表示する要素
var isLiked = $(this).hasClass('favbtn_after'); // 現在のいいねの状態を判定
var $this = $(this); // ボタン要素を変数に格納
$.ajax({
url: '../favorite/favorite.php',
method: 'POST',
data: { uniqid: postUniqid, userid: userid }, // ここに自分のユーザーIDを指定
dataType: 'json',
success: function(response) {
if (response.success) {
// いいね成功時の処理
if (isLiked) {
$this.removeClass('favbtn_after'); // クラスを削除していいねを取り消す
$this.find('img').attr('src', '../img/sysimage/favorite_1.svg'); // 画像を元の画像に戻す
} else {
$this.addClass('favbtn_after'); // クラスを追加していいねを追加する
$this.find('img').attr('src', '../img/sysimage/favorite_2.svg'); // 画像を新しい画像に置き換える
}
var newFavoriteList = response.newFavorite.split(',');
var likeCount = newFavoriteList.length - 1;
likeCountElement.text(likeCount); // いいね数を更新
} else {
// いいね失敗時の処理
}
}.bind(this), // コールバック内でthisが適切な要素を指すようにbindする
error: function() {
// エラー時の処理
}
});
});
});
// JavaScriptでウィンドウを制御
const modal1 = document.getElementById('myModal');
const openModalButton = document.getElementById('openModalButton');
const closeButton = document.getElementById('closeModal');
openModalButton.addEventListener('click', () => {
modal1.style.display = 'block';
});
closeButton.addEventListener('click', () => {
modal1.style.display = 'none';
});
var modal = document.getElementById('myDelModal');
var deleteButton = document.getElementById('deleteButton');
var cancelButton = document.getElementById('cancelButton'); // 追加
$(document).on('click', '.delbtn', function (event) {
modal.style.display = 'block';
var uniqid2 = $(this).attr('data-uniqid2');
var postElement = $(this).closest('.ueuse');
deleteButton.addEventListener('click', () => {
modal.style.display = 'none';
$.ajax({
url: '../delete/delete.php',
method: 'POST',
data: { uniqid: uniqid2 },
dataType: 'json',
success: function (response) {
if (response.success) {
postElement.remove();
} else {
// 削除失敗時の処理
}
},
error: function () {
// エラー時の処理
}
});
});
cancelButton.addEventListener('click', () => { // 追加
modal.style.display = 'none';
});
});
var abimodal = document.getElementById('myAbiModal');
var AbiAddButton = document.getElementById('AbiAddButton');
var AbiCancelButton = document.getElementById('AbiCancelButton');
$(document).on('click', '.addabi', function (event) {
abimodal.style.display = 'block';
var uniqid2 = $(this).attr('data-uniqid2');
var postAbiElement = $(this).closest('.addabi');
AbiCancelButton.addEventListener('click', () => {
abimodal.style.display = 'none';
});
$('#AbiForm').off('submit').on('submit', function (event) {
event.preventDefault();
var abitext = document.getElementById("abitexts").value;
if(abitext == ""){
abimodal.style.display = 'none';
}else{
$.ajax({
url: '../abi/addabi.php',
method: 'POST',
data: { uniqid: uniqid2, abitext: abitext},
dataType: 'json',
success: function (response) {
console.log(response); // レスポンス内容をコンソールに表示
if (response.success) {
abimodal.style.display = 'none';
postAbiElement.remove();
} else {
}
},
error: function (xhr, status, error) {
}
});
}
});
});
</script>
</html>