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) <frumph_dragon@yahoo.com>
This commit is contained in:
parent
333701cd61
commit
8778c3c569
|
@ -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;
|
||||
}
|
||||
|
||||
?>
|
|
@ -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 '<img src="'.get_template_directory_uri().'/'.$avatar.'" class="photo trackping" />';
|
||||
|
@ -121,9 +121,13 @@ function comicpress_comments_callback($comment, $args, $depth) {
|
|||
$GLOBALS['comment_depth'] = $depth;
|
||||
?>
|
||||
|
||||
<li id="comment-<?php comment_ID(); ?>" class="<?php comicpress_comment_class(); ?>">
|
||||
<li id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>>
|
||||
|
||||
<div class="comment-avatar">
|
||||
<?php comicpress_avatar(); // Avatar filter ?>
|
||||
</div>
|
||||
|
||||
<div class="comment-content">
|
||||
|
||||
<div class="comment-meta-data">
|
||||
|
||||
|
@ -163,6 +167,7 @@ function comicpress_comments_callback($comment, $args, $depth) {
|
|||
</div>
|
||||
<?php } ?>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
/**
|
||||
|
@ -177,51 +182,6 @@ function comicpress_comments_end_callback() {
|
|||
echo '</li>';
|
||||
}
|
||||
|
||||
/**
|
||||
* 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; ?>
|
||||
<li id="comment-<?php comment_ID(); ?>">
|
||||
|
|
22
style.css
22
style.css
|
@ -611,6 +611,11 @@ h3, h3 a {
|
|||
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,10 +644,14 @@ 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue