comments-seo.php 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. if (!function_exists('duoshuo_comment')){
  3. function duoshuo_comment( $comment, $args, $depth ) {
  4. $GLOBALS['comment'] = $comment;
  5. switch ( $comment->comment_type ) :
  6. case 'pingback' :
  7. case 'trackback' :
  8. ?>
  9. <li class="post pingback">
  10. <p><?php _e( 'Pingback:', 'duoshuo' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( 'Edit', 'duoshuo' ), '<span class="edit-link">', '</span>' ); ?></p>
  11. <?php
  12. // end_el函数会自己输出一个</li>
  13. break;
  14. default :
  15. ?>
  16. <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
  17. <article id="comment-<?php comment_ID(); ?>" class="comment">
  18. <footer class="comment-meta">
  19. <cite class="comment-author vcard">
  20. <?php
  21. /* translators: 1: comment author, 2: date and time */
  22. printf( __( '%1$s on %2$s <span class="says">said:</span>', 'duoshuo' ),
  23. sprintf( '<span class="fn">%s</span>', get_comment_author_link() ),
  24. sprintf( '<a rel="nofollow" href="%1$s"><time pubdate datetime="%2$s">%3$s</time></a>',
  25. esc_url( get_comment_link( $comment->comment_ID ) ),
  26. get_comment_time( 'c' ),
  27. /* translators: 1: date, 2: time */
  28. sprintf( __( '%1$s at %2$s', 'duoshuo' ), get_comment_date(), get_comment_time() )
  29. )
  30. );
  31. ?>
  32. </cite><!-- .comment-author .vcard -->
  33. </footer>
  34. <div class="comment-content">
  35. <?php //comment_text(); ?>
  36. <?php $current_comment = get_comment_text(); ?>
  37. <?php
  38. $current_comment = preg_replace('/(http\:\/\/img.t.sinajs.cn\/t35\/style\/images\/common\/face\/ext\/normal\/)/i',"https://www.solomp.com/custom/catimg.php?src=$1",$current_comment);
  39. $current_comment = preg_replace('/(http\:\/\/static.duoshuo.com\/images)/i',"https://www.solomp.com/custom/catimg.php?src=$1",$current_comment);
  40. ?>
  41. <?php echo $current_comment;?>
  42. </div>
  43. </article><!-- #comment-## -->
  44. <?php
  45. // end_el函数会自己输出一个</li>
  46. break;
  47. endswitch;
  48. }
  49. }
  50. ?>
  51. <div id="ds-ssr">
  52. <?php if (get_comment_pages_count() > 1 && get_option('page_comments')): ?>
  53. <nav id="comment-nav-above">
  54. <h1 class="assistive-text"><?php _e( 'Comment navigation', 'duoshuo' ); ?></h1>
  55. <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'duoshuo' ) ); ?></div>
  56. <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'duoshuo' ) ); ?></div>
  57. </nav>
  58. <?php endif;?>
  59. <ol id="commentlist">
  60. <?php
  61. /* Loop through and list the comments. Tell wp_list_comments()
  62. * to use Duoshuo::comment() to format the comments.
  63. */
  64. wp_list_comments(array('callback' => 'duoshuo_comment'));
  65. ?>
  66. </ol>
  67. <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :?>
  68. <nav id="comment-nav-below">
  69. <h1 class="assistive-text"><?php _e( 'Comment navigation', 'duoshuo' ); ?></h1>
  70. <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'duoshuo' ) ); ?></div>
  71. <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'duoshuo' ) ); ?></div>
  72. </nav>
  73. <?php endif; // check for comment navigation ?>
  74. </div>