Advertisement
Guest User

Untitled

a guest
Jul 11th, 2011
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.83 KB | None | 0 0
  1. // Produces an avatar image with the hCard-compliant photo class
  2. function commenter_link() {
  3.     $commenter = get_comment_author_link();
  4.     if ( ereg( '<a[^>]* class=[^>]+>', $commenter ) ) {
  5.         $commenter = ereg_replace( '(<a[^>]* class=[\'"]?)', '\\1url ' , $commenter );
  6.     } else {
  7.         $commenter = ereg_replace( '(<a )/', '\\1class="url "' , $commenter );
  8.     }
  9.     $avatar_email = get_comment_author_email();
  10.     $avatar = str_replace( "class='avatar", "class='photo avatar", get_avatar( $avatar_email, 80 ) );
  11.     echo $avatar . ' <span class="fn n">' . $commenter . '</span>';
  12. } // end commenter_link
  13.  
  14.  
  15. // Custom callback to list comments in the shape style
  16. function custom_comments($comment, $args, $depth) {
  17.   $GLOBALS['comment'] = $comment;
  18.     $GLOBALS['comment_depth'] = $depth;
  19.   ?>
  20.     <li id="comment-<?php comment_ID() ?>" class="<?php comment_class() ?>">
  21.         <div class="comment-author vcard"><?php commenter_link() ?></div>
  22.         <div class="comment-meta"><?php printf(__('Posted %1$s at %2$s <span class="meta-sep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'shape'),
  23.                     get_comment_date(),
  24.                     get_comment_time(),
  25.                     '#comment-' . get_comment_ID() );
  26.                     edit_comment_link(__('Edit', 'shape'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>'); ?></div>
  27.   <?php if ($comment->comment_approved == '0') _e("\t\t\t\t\t<span class='unapproved'>Your comment is awaiting moderation.</span>\n", 'shape') ?>
  28.           <div class="comment-content">
  29.             <?php comment_text() ?>
  30.         </div>
  31.         <?php // echo the comment reply link with help from Justin Tadlock http://justintadlock.com/ and Will Norris http://willnorris.com/
  32.             if($args['type'] == 'all' || get_comment_type() == 'comment') :
  33.                 comment_reply_link(array_merge($args, array(
  34.                     'reply_text' => __('Reply','shape'),
  35.                     'login_text' => __('Log in to reply.','shape'),
  36.                     'depth' => $depth,
  37.                     'before' => '<div class="comment-reply-link">',
  38.                     'after' => '</div>'
  39.                 )));
  40.             endif;
  41.         ?>
  42. <?php } // end custom_comments
  43.  
  44.  
  45. // Custom callback to list pings
  46. function custom_pings($comment, $args, $depth) {
  47.        $GLOBALS['comment'] = $comment;
  48.         ?>
  49.             <li id="comment-<?php comment_ID() ?>" class="<?php comment_class() ?>">
  50.                 <div class="comment-author"><?php printf(__('By %1$s on %2$s at %3$s', 'shape'),
  51.                         get_comment_author_link(),
  52.                         get_comment_date(),
  53.                         get_comment_time() );
  54.                         edit_comment_link(__('Edit', 'shape'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>'); ?></div>
  55.     <?php if ($comment->comment_approved == '0') _e('\t\t\t\t\t<span class="unapproved">Your trackback is awaiting moderation.</span>\n', 'shape') ?>
  56.             <div class="comment-content">
  57.                 <?php comment_text() ?>
  58.             </div>
  59. <?php } // end custom_ping
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement