summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Robbins2007-01-21 17:50:41 (GMT)
committer Jeff Robbins2007-01-21 17:50:41 (GMT)
commit67b2f71ad87af9250269a7b7e6c5a15bb0bcb67c (patch)
tree0edbacfa03699bb685efd9c759745fa32003cb6b
parent0950dc6258ea495340dc3497d2f26761b98c5257 (diff)
#111409 - author comments styled differently from others
-rw-r--r--comment.tpl.php6
-rw-r--r--style.css5
-rw-r--r--template.php19
3 files changed, 27 insertions, 3 deletions
diff --git a/comment.tpl.php b/comment.tpl.php
index 974638b..c6cf21b 100644
--- a/comment.tpl.php
+++ b/comment.tpl.php
@@ -1,8 +1,8 @@
-<div class="comment<?php if ($comment->status == COMMENT_NOT_PUBLISHED) print ' comment-unpublished'; ?>">
+<div class="<?php print $comment_classes; ?>">
<?php if ($new != '') { ?><span class="new"><?php print $new; ?></span><?php } ?>
-<h3 class="title"><?php print $title; ?></h3>
+<?php if ($title) { ?><h3 class="title"><?php print $title; ?></h3><?php } ?>
<?php if ($picture) print $picture; ?>
<div class="submitted"><?php print t('On ') . format_date($comment->timestamp, 'custom', 'F jS, Y'); ?> <?php print theme('username', $comment) . t(' says:'); ?></div>
<div class="content"><?php print $content; ?></div>
<div class="links"><?php print $links; ?></div>
-</div>
+</div> <!-- /comment -->
diff --git a/style.css b/style.css
index 47bf9d1..f094f94 100644
--- a/style.css
+++ b/style.css
@@ -497,6 +497,11 @@ div.error {
background: #EBF2F8;
}
+.comment-by-author {
+ background: none;
+ border: 1px solid #EBF2F8;
+}
+
.comment h3.title, .comment h3.title a {
font-size: 122%;
color: #2266AB;
diff --git a/template.php b/template.php
index 2e0f855..1ab04fd 100644
--- a/template.php
+++ b/template.php
@@ -184,6 +184,25 @@ function _phptemplate_variables($hook, $vars = array()) {
// if the author of this comment is equal to the author of the node, we set a variable
// then in our theme we can theme this comment differently to stand out
$vars['author_comment'] = $vars['comment']->uid == $node->uid ? TRUE : FALSE;
+
+ $comment_classes = array('comment');
+ if ($vars['comment']->status == COMMENT_NOT_PUBLISHED) {
+ $comment_classes[] = 'comment-unpublished';
+ }
+ if ($vars['author_comment']) {
+ $comment_classes[] = 'comment-by-author';
+ }
+ if ($vars['comment']->uid == 0) {
+ $comment_classes[] = 'comment-by-anon';
+ }
+ $vars['comment_classes'] = implode(' ', $comment_classes);
+
+
+ // if comment subjects are disabled, don't display 'em
+ if (variable_get('comment_subject_field', 1) == 0) {
+ $vars['title'] = '';
+ }
+
break;
}