By pstamant on
I know this goes against the spirit of a blog, but is there a way to hide comments from users so that the only comments a user can see are the comments that they themselves made (unless they are an admin in which they'd be able to see all comments)? If I have to hack a file or 2 that is ok by me.
Comments
Well...
...one way to do it, would be in the theming. In comment.tpl.php you could wrap the whole thing in a condition like
if($comment->uid==$user->uid || in_array('administratorrole', $user->roles)) {
// Here's the content
}
good idea
Thanks. That's just what I was looking for.
hmmmm for me $user->uid does
hmmmm for me $user->uid does never return anything inside comment.tpl.php only in node.tpl
Need to hide the reply comment link for any non authenticated users and just don´t want to hack core any ideas?
ok more searching of slow drupal.org revealed that I have to user $user as a global so to make above work inside a comment.tpl.php you need to add:
>>
http://drupal.org/node/162735