pcommentで、belowかつreplyを指定した際、返信動作がうまくいかず、返信したはずのものがネストは下げつつも最新の場所に表示され、返信になりません。
#pcomment(ページ名,10,noname,below,reply)
diff -u -r1.38 pcomment.inc.php --- pcomment.inc.php 30 Jan 2005 01:13:11 -0000 1.38 +++ pcomment.inc.php 3 Mar 2005 04:27:03 -0000 @@ -243,12 +243,14 @@ $dir = isset($vars['dir']) ? $vars['dir'] : ''; //リプライ先のコメントを検索 + $b_reply = false; if ($reply_hash != '') { while ($pos < count($postdata)) { $matches = array(); if (preg_match('/^(\-{1,2})(?!\-)(.*)$/', $postdata[$pos++], $matches) && md5($matches[2]) == $reply_hash) { + $b_reply = true; $level = strlen($matches[1]) + 1; //挿入するレベル // コメントの末尾を検索 @@ -261,18 +263,10 @@ break; } } - } else { - $pos = ($dir == 0) ? $start_pos : count($postdata); } - if ($dir == '0') { - if ($pos == count($postdata)) { - $pos = $start_pos; //先頭 - } - } else { - if ($pos == 0) { - $pos = count($postdata); //末尾 - } + if (! $b_reply) { + $pos = ($dir == '0') ? $start_pos : count($postdata); } //コメントを挿入