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

Add files via upload

This commit is contained in:
だいちまる
2023-08-21 13:57:56 +09:00
committed by GitHub
parent 965d7b903c
commit 76cf76475c
21 changed files with 453 additions and 181 deletions
+5 -6
View File
@@ -41,6 +41,11 @@ if (!empty($pdo)) {
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();
// トランザクション開始
$pdo->beginTransaction();
@@ -52,12 +57,6 @@ if (!empty($pdo)) {
$res = $stmt->execute();
$res = $pdo->commit();
$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 を渡さない
+6 -2
View File
@@ -7,7 +7,11 @@ class MessageDisplay {
}
public function display() {
echo '<div class="notification">';
if($this->value['userchk'] === "none"){
echo '<div class="notification2">';
}else{
echo '<div class="notification">';
}
echo ' <div class="flebox">';
echo ' <div class="time">';
@@ -24,7 +28,7 @@ class MessageDisplay {
// 投稿内のHTMLコードを表示する部分
echo ' <h3>' . htmlentities($this->value['title']) . '</h3>';
echo ' <p>' . htmlentities($this->value['msg']) . '</p>';
echo ' <a href="' . htmlentities($this->value['url']) . '">続きをみる</a>';
echo ' <a href="' . htmlentities($this->value['url']) . '">詳細をみる</a>';
echo '</div>';
}