We've run into a small problem at our site that I'd like to finagle my way around.
The problem is that post/comment numbers (usually right side with #1, #2, etc.) do not omit unpublished comments. The result is that ordinary users (who don't see unpublished comments) see different comment numbers than privileged users who can see unpublished comments.

Solutions going through my mind:
a) Omit unpublished comments form normal numbering... display CID instead?
b) Just display CID on all comments
c) Display "link" on each comment w/no post numbering at all

To complicate things a little, I use Permalink to give the comment numbers a "works from anywhere" url. Definitely want to keep that.

So I've been looking at forum_preprocess_comment.inc... to see if I can get that to do what I like. But my knowledge of PHP isn't quite adequate without a little help.
How might I go about getting either "a" or "b" in place.

I suppose if there is enough interest, this could be a feature request.
Probably related #1506276: Incorrect #Num in replies


aharown07’s picture

Category:feature» support

Found a way to do option b) above.
in preprocess_comment.inc around line 89, the $linktext variable gets built.
Comment out this line:
/*$linktext = '#' . (($page_number * $posts_per_page) + $post_number);*/
Replace with
$linktext = $comment->cid;

Of course, this is a crude hack... Can anyone steer me toward a more elegant, theme-based solution?

Is there interest in making "use CID as post #" an option in the module config options... as a feature request?

aharown07’s picture

Issue summary:View changes


aharown07’s picture

Category:support» feature

I'm going to make this a feature request: after playing with options for a while, it seems least confusing to users if unpublished comments are simply omitted from the post numbering. Maybe display CID on the unpublished ones.
I'm not sure how to code that (yet) or I'd probably submit a patch.