Posted by freestyler on April 3, 2009 at 12:53am
Jump to:
| Project: | Fivestar Extra |
| Version: | 6.x-1.0-beta3 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | hide comments |
Issue Summary
I have a suggestion:
Would it be possible for fivestar extra to place a div arround each comment? This div would state the score
In this way it would be possible to filter comments below certain score, this could be done through javascript in the template or maybe through an option in this module.
I think this would be a really useful feature. Could it be done?
Comments
#1
That's an interesting idea. I've seen the kind of thing you mean. It would certainly be possible to do this around the comment body. I'll look into it, and maybe add the feature in future.
#2
I accomplish this by adding this code to my theme's template.php:
function phptemplate_comment_view($comment, $node, $links = array(), $visible = TRUE) {$rating_threshold = 21;
$count_threshold = 1;
$votes = fivestar_get_votes('comment', $comment->cid);
if ( $votes['average']['value'] < $rating_threshold
&& $votes['count']['value'] > $count_threshold
&& arg(2) != $comment->cid) {
$visible = FALSE;
$comment->subject = t("(view hidden comment)") . " " . $comment->subject;
}
return theme_comment_view($comment, $node, $links, $visible);
}
#3
Thank you, Matt. I've added this tip to the Fivestar Extra handbook page.
http://drupal.org/node/540884
#4
Automatically closed -- issue fixed for 2 weeks with no activity.