From 8778c3c569f37f9ceb38691860e13cf7e9395eef Mon Sep 17 00:00:00 2001 From: "Philip M. Hofer (Frumph)" Date: Tue, 17 Nov 2009 01:45:52 -0800 Subject: [PATCH] Moved comment_class to the classes.php adjusted avatar size to 72 and sub avatar size to 48 Signed-off-by: Philip M. Hofer (Frumph) --- functions/classes.php | 16 ++++ functions/comment-functions.php | 132 +++++++++++--------------------- style.css | 22 +++--- 3 files changed, 74 insertions(+), 96 deletions(-) diff --git a/functions/classes.php b/functions/classes.php index a22b46c..e858d49 100644 --- a/functions/classes.php +++ b/functions/classes.php @@ -135,4 +135,20 @@ function comicpress_post_class($class = '') { echo apply_filters( 'comicpress_post_class', $class ); } +add_filter('comment_class','comicpress_comment_class'); + +function comicpress_comment_class($classes = '') { + + /* + * http://microid.org + */ + $email = get_comment_author_email(); + $url = get_comment_author_url(); + if(!empty($email) && !empty($url)) { + $microid = 'microid-mailto+http:sha1:' . sha1(sha1('mailto:'.$email).sha1($url)); + $classes[] = $microid; + } + return $classes; +} + ?> \ No newline at end of file diff --git a/functions/comment-functions.php b/functions/comment-functions.php index 5a8c5f8..472357a 100644 --- a/functions/comment-functions.php +++ b/functions/comment-functions.php @@ -38,7 +38,7 @@ function comicpress_avatar() { $id_or_email = get_comment_author_email(); if (empty($id_or_email)) $id_or_email = get_comment_author(); if(function_exists('comicpress_get_avatar') && $comment_type != 'pingback' && $comment_type != 'trackback' ) { - echo str_replace("alt='", "alt='".wp_specialchars(get_comment_author(), 1)."' title='".wp_specialchars(get_comment_author(), 1), comicpress_get_avatar($id_or_email, 64)); + echo str_replace("alt='", "alt='".wp_specialchars(get_comment_author(), 1)."' title='".wp_specialchars(get_comment_author(), 1), comicpress_get_avatar($id_or_email, 72)); } else { if ($comment_type == 'pingback' || $comment_type == 'trackback') { echo ''; @@ -121,48 +121,53 @@ function comicpress_comments_callback($comment, $args, $depth) { $GLOBALS['comment_depth'] = $depth; ?> -
  • +
  • > - - - - - -
    - +
    + +
    + +
    + + + + +
    + +
    + +
    - -
    '; } -/** -* Sets a class for each comment -* Sets alt, odd/even, and author/user classes -* Adds author, user, and reader classes -* -* @since 0.2 -*/ -function comicpress_comment_class() { - global $comment; - static $comment_alt; - $classes = array(); - - if(function_exists('get_comment_class')) - $classes = get_comment_class(); - - $classes[] = get_comment_type();; - - /* - * User classes - */ - if($comment->user_id > 0 && $user = get_userdata($comment->user_id)) : - - $classes[] = 'user user-' . $user->user_nicename; - - if($post = get_post($post_id)) : - if($comment->user_id === $post->post_author) - $classes[] = 'author author-' . $user->user_nicename; - endif; - else : - $classes[] = 'reader'; - endif; - - /* - * http://microid.org - */ - $email = get_comment_author_email(); - $url = get_comment_author_url(); - if(!empty($email) && !empty($url)) { - $microid = 'microid-mailto+http:sha1:' . sha1(sha1('mailto:'.$email).sha1($url)); - $classes[] = $microid; - } - $classes = join(' ', $classes); - echo $classes; -} - function list_pings($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • diff --git a/style.css b/style.css index 4f5b98c..1b78a7d 100644 --- a/style.css +++ b/style.css @@ -610,6 +610,11 @@ h3, h3 a { padding: 0; float: left; } + + .comment .comment .avatar { + width: 48px; + height: 48px; + } .comment .trackping { float: left; @@ -626,8 +631,8 @@ h3, h3 a { } .comment-text { - padding-bottom: 5px; - padding-left: 5px; + font-size: 13px; + padding: 10px 5px 5px; float: left; } @@ -639,9 +644,13 @@ h3, h3 a { .comment-author cite { padding: 0; margin: 0; - font-size: 14px; + font-size: 16px; display: inline; } + + .comment .comment .comment-author cite { + font-size: 14px; + } .comment-time { padding-left: 5px; @@ -657,17 +666,10 @@ h3, h3 a { } .comment-meta-data { - margin: 0; - padding-left: 5px; -} - -.bypostauthor .comment-meta-data { } .comment-meta { display: inline; - padding: 0 0 0 5px; - margin: 0 0 0 2px; border-left: 1px solid #000; }