Alternate Comment Rows
From Habari Project
You can configure your theme to 'style' comment rows differently. By using CSS, this can be used to make comment lists visually easier to differentiate. We can also set a custom CSS class whenever the owner responds.
Here is a sample of this being accomplished:<?php if( $post->comments->moderated->count ) : $class = ''; ?> <h3 id="comments"><?php echo $post->comments->moderated->count; ?> Responses to “<?php echo $post->title; ?>”</h3> <ol class="commentlist"> <?php foreach ( $post->comments->moderated as $comment ) : // The alternate row change $class = (($class == '') ? 'alt' : ''); //check to see if post author email is same as comment author email if( $comment->email == $post->author->email ) { $class= 'owner'; } if ( $comment->status == Comment::STATUS_UNAPPROVED ) { $class= 'unapproved'; } ?> <li id="comment-<?php echo $comment->id; ?>" class="<?php echo $class; ?>"> <span class="commentauthor"><a href="<?php echo $comment->url; ?>" rel="external"><?php echo $comment->name; ?></a></span> <small class="commentmetadata"><a href="#comment-<?php echo $comment->id; ?>" title="Time of this comment"> <?php echo $comment->date; ?></a> <?php if ( $comment->status == Comment::STATUS_UNAPPROVED ) { ?> <em>Your comment is awaiting moderation.</em><?php } ?></small> <?php echo $comment->content_out; ?> </li> <?php endforeach; ?> </ol> <?php endif; ?>