質問編集履歴

2

HTMLを追記致しました

2017/10/28 00:58

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -45,3 +45,65 @@
45
45
  自分としてはmatchが怪しいのではないかと思い、色々調べてみたのですがどうにもできないのが現状です。
46
46
 
47
47
  御力をお貸しいただけませんでしょうか?
48
+
49
+
50
+
51
+
52
+
53
+ 追記
54
+
55
+
56
+
57
+ ```ここに言語を入力<div class="container">
58
+
59
+ <div class="container">
60
+
61
+ <div class="comments">
62
+
63
+ <ol class= "comments-list">
64
+
65
+ <?php foreach($posts as $post => $values): ?>
66
+
67
+ <?php $i++ ;?>
68
+
69
+ <span class="thread" id = "<?=$i;?>">
70
+
71
+ <h1><?=$i;?></h1>
72
+
73
+ <div>
74
+
75
+ <?php foreach($values as $value) :?>
76
+
77
+ <form class="" action="" method="post">
78
+
79
+ <input type="hidden" name="comment_id" value="<?= $post;?>">
80
+
81
+ <input type="hidden" name="id" value="<?= $sledid;?>">
82
+
83
+ <input type="button" name="re" value="返信する" class = "replay">
84
+
85
+ </form>
86
+
87
+ <li class = "text">名前:<?= h($value['name']);?><p>本文:<?= h($value['body']); ?></p>
88
+
89
+ </li>
90
+
91
+ <div class="linkers<?=$i?>">
92
+
93
+ 返信元:
94
+
95
+ </div>
96
+
97
+ <?php endforeach; ?>
98
+
99
+ </div>
100
+
101
+ </span>
102
+
103
+ <?php endforeach; ?>
104
+
105
+ </ol>
106
+
107
+ </div>
108
+
109
+ ```

1

ややこしい箇所を削除しました

2017/10/28 00:58

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -12,17 +12,11 @@
12
12
 
13
13
  var res = $(this).text().match(/>+\d{1,3}/)
14
14
 
15
- var id = $(this).text().match(/\d{1,3}/)
16
-
17
15
  var replay_id = $(this).text().match(/\d{1,3}/)
18
16
 
19
17
  if (res) {
20
18
 
21
19
  var thread_id = parseInt($(this).parents('.thread').attr('id'));
22
-
23
- //thread_idはコメントの順番の数字
24
-
25
- var new_text = $(this).text().replace(/(>+)(\d{1,3})/g,'<a href="/talk.php/' + thread_id + '/$2" class = "onMouse" name = "$2">$1$2</a>');
26
20
 
27
21
  $('.linkers'+replay_id).append('<a href="#" class = "onMouse" name = '+thread_id+'>>'+thread_id+'</a>');
28
22