<?php
// Fist full of comments
function custom_comment($comment, $args, $depth) {
   $GLOBALS['comment'] = $comment; ?>
                 
   <li <?php comment_class(); ?> id="comment-<?php comment_ID() ?>">
      <a name="comment-<?php comment_ID() ?>"></a>
      <div class="comment-head cl">
      
      <?php if(get_comment_type() == "comment"){ ?>
          <div class="avatar"><?php the_commenter_avatar() ?></div>
          <?php } ?>
          <div class="user-meta">
                  <strong class="name"><?php the_commenter_link() ?></strong> <?php if(get_comment_type() == "comment"){ echo get_comment_date("j F Y") ?> <?php _e('at',woothemes); ?> <?php echo get_comment_time(); edit_comment_link('Edit', ' <span class="edit-link">(', ')</span>'); ?> <a class="comment-permalink" href="<?php echo get_comment_link(); ?>" title="<?php _e('Direct link to this comment',woothemes); ?>">#</a><?php }?>
          </div>
      </div>
      <div class="comment-entry"  id="comment-<?php comment_ID(); ?>">
                                <?php comment_text() ?>
                                <?php if ($comment->comment_approved == '0') echo "<p class='unapproved'>".__('Your comment is awaiting moderation.',woothemes)."</p>\n"; ?>
                                <div class="reply">
                              <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
            </div>

      </div>

<?php 
}

// PINGBACK / TRACKBACK OUTPUT
function list_pings($comment, $args, $depth) {

	$GLOBALS['comment'] = $comment; ?>
	
	<li id="comment-<?php comment_ID(); ?>">
		<span class="author"><?php comment_author_link(); ?></span> - 
		<span class="date"><?php echo get_comment_date(get_option('date_format')) ?></span>
		<span class="pingcontent"><?php comment_text() ?></span>

<?php
}

function the_commenter_link() {
    $commenter = get_comment_author_link();
    if ( ereg( ']* class=[^>]+>', $commenter ) ) {$commenter = ereg_replace( '(]* class=[\'"]?)', '\\1url ' , $commenter );
    } else { $commenter = ereg_replace( '(<a )/', '\\1class="url "' , $commenter );}
    echo $commenter ;
}

function the_commenter_avatar() {
    $email = get_comment_author_email();
    $avatar = str_replace( "class='avatar", "class='photo avatar", get_avatar( "$email", "32" ) );
    echo $avatar;
}

?>