I'm using Fivestar Extra for comments with the "HOWTO: Hide Comments Below a Certain Rating" patch suggested in the documentation.

This has worked fine until yesterday evening, when, without changing the site, executing a cron job or even making a new post, suddenly comment previews were being hidden.

Now when I or anyone else previews a comment, we see:

(view hidden comment) Subject newby username

"Subject" is the actual subject line and "username" is the actual username. The "(view hidden comment) Subject" part is a link to "/comment/reply/#comment-".

Any idea what may be causing this or why it seemed to happen spontaneously?

Comments

Richard Blackborder’s picture

Assigned: Unassigned » Richard Blackborder
Status: Active » Postponed (maintainer needs more info)

What is the URL of the comment preview page on which you are seeing that error?

oregonmc’s picture

Any comment area here: http://tinyurl.com/phpq5d

Just start an anonymous comment and hit preview.

Richard Blackborder’s picture

Try this format:

function phptemplate_comment_view($comment, $node, $links = array(), $visible = TRUE) {
  $rating_threshold = 21;
  $count_threshold = 2;
  $votes = fivestar_get_votes('comment', $comment->cid);
  if ( $votes['average']['value'] < $rating_threshold
       && $votes['count']['value'] > $count_threshold
       && arg(2) != $comment->cid
       && $comment->preview != 'Preview') {
     $visible = FALSE;
     $comment->subject = t("(view hidden comment)") . " " . $comment->subject;
  }
  return theme_comment_view($comment, $node, $links, $visible);
}

By the way, what are your values of $count_threshold and $rating_threshold?

oregonmc’s picture

Hm, it just started working again without me doing anything. If it happens again, I'll try your code. Thanks!

oregonmc’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)