質問編集履歴
2
HTMLPHPのコードが抜けていたので修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -44,6 +44,22 @@
|
|
44
44
|
|
45
45
|
コード
|
46
46
|
|
47
|
+
<?php if ($post['user'] !== $member['user']) :?>
|
48
|
+
|
49
|
+
<?php for ($i = 0; $i < count($outLike); $i++) :?>
|
50
|
+
|
51
|
+
<?php if ($outLike[$i]['favorite_id'] === $post['id'] && $outLike[$i]['favorite'] === 'favorite') :?>
|
52
|
+
|
53
|
+
<?php $icon = 'fas fa-thumbs-up'?>
|
54
|
+
|
55
|
+
<?php $boolean = 'hoge'?>
|
56
|
+
|
57
|
+
<?php break?>
|
58
|
+
|
59
|
+
<?php endif ;?>
|
60
|
+
|
61
|
+
<?php endfor; ?>
|
62
|
+
|
47
63
|
<?php while ($post = $posts->fetch()) : ?>
|
48
64
|
|
49
65
|
<form id="like_form" action="" method="post">
|
1
javascript DOMコードを記入するのを忘れてました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -96,7 +96,19 @@
|
|
96
96
|
|
97
97
|
コード
|
98
98
|
|
99
|
+
const likeBtn = document.querySelectorAll('.like__btn');
|
100
|
+
|
101
|
+
const hidden_id = document.querySelectorAll('.hidden_id');
|
102
|
+
|
103
|
+
const hidden_boolean = document.querySelectorAll('.hidden_boolean');
|
104
|
+
|
105
|
+
let likeIcon = document.querySelectorAll('.icon');
|
106
|
+
|
107
|
+
let clicked = null;
|
108
|
+
|
109
|
+
|
110
|
+
|
99
|
-
|
111
|
+
for (let i = 0; i < likeBtn.length; i++) {
|
100
112
|
|
101
113
|
likeBtn[i].addEventListener('click', () => {
|
102
114
|
|