This is a weird little bug - the comment count is doubled, so the first comment is marked #2, second #4 and so on - see the screenshot attached.
I checked the demo website and the comment count looks fine there. Anyway, it would be interesting to see if anyone else experiences this issue. Perhaps someone knows what could be causing it?
| Comment | File | Size | Author |
|---|---|---|---|
| adv-forum-comment-count.png | 25.24 KB | mkrakowiak |
Comments
Comment #1
mkrakowiak commentedI did a little test to see what's going on, and this should be helpful.
I replaced line 243
$linktext = '#' . (($page_number * $post_per_page) + $post_number);with this:$linktext = 'initial post number: ' . $post_number . ' | #' . (($page_number * $post_per_page) + $post_number) . ' | page number: ' . $page_number . ' | post per page: ' . $post_per_page . ' | post number: ' . $post_number;and here's what I got:initial post number: 4 | #4 | page number: 0 | post per page: 10 | post number: 4
initial post number: 6 | #6 | page number: 0 | post per page: 10 | post number: 6
Any ideas?
Comment #2
michelleThe post counter gets incremented in the comment pre-process, which is called from the "comment" hook in _phptemplate_variables. So my guess is something on your system is calling that twice per post. If you have devel installed, you can try putting
dsm($vars['comment']->cid);right before $post_number++; and see if you get the same cid twice for every post.Michelle
Comment #3
mkrakowiak commentedThanks, Michelle! Thanks for directing me... Once you mentioned pre-processing, I took a look at my template.php file and found that it was indeed calling twice:
After removing the $hook variable from the first line, it works like a charm.
Comment #4
michelleAh, there you go. :)
Michelle
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.