PageRenderTime 50ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/blog/wp-content/themes/redoable-lite/comments.php

https://bitbucket.org/sergiohzlz/reportaprod
PHP | 147 lines | 120 code | 25 blank | 2 comment | 15 complexity | a2ede1c508a99f3692047357bef72409 MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-2.1
  1. <hr />
  2. <div id="comment-block">
  3. <?php
  4. // Do not access this file directly
  5. if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) { die (__('Please do not load this page directly. Thanks!','redo_domain')); }
  6. // Password Protection
  7. if (post_password_required()) {
  8. ?>
  9. <p class="nopassword"><?php _e('This post is password protected. Enter the password to view comments.','redo_domain'); ?></p>
  10. </div>
  11. <?php return;
  12. }
  13. function redoable_lite_comment($comment, $args, $depth) {
  14. $GLOBALS['comment'] = $comment;
  15. global $comment_count;
  16. $comment_count++;
  17. extract($args, EXTR_SKIP);
  18. ?>
  19. <li id="comment-<?php comment_ID(); ?>" <?php comment_class(redo_comment_class($comment_count, false)); ?>>
  20. <div id="div-comment-<?php comment_ID() ?>">
  21. <div class="vcard">
  22. <?php if ($args['avatar_size'] != 0) echo get_avatar( $comment, $args['avatar_size'] ); ?>
  23. <a href="#comment-<?php comment_ID(); ?>" class="counter" title="<?php _e('Permanent Link to this Comment','redo_domain'); ?>"><?php echo $comment_count; ?></a>
  24. <span class="commentauthor fn"><?php comment_author_link(); ?></span>
  25. </div>
  26. <small class="comment-meta">
  27. <?php
  28. printf('<a href="#comment-%1$s" title="%2$s">%3$s</a>',
  29. get_comment_ID(),
  30. (function_exists('time_since')?
  31. sprintf(__('%s ago.','redo_domain'),
  32. time_since(abs(strtotime($comment->comment_date_gmt . " GMT")), time())
  33. ):
  34. __('Permanent Link to this Comment','redo_domain')
  35. ),
  36. sprintf(__('%1$s at %2$s','redo_domain'),
  37. get_comment_date(get_option('date_format')),
  38. get_comment_time()
  39. )
  40. );
  41. ?>
  42. </small>
  43. <div class="comment-content">
  44. <?php comment_text(); ?>
  45. </div>
  46. <div class="reply">
  47. <?php comment_reply_link(array_merge( $args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
  48. </div>
  49. <?php if ('0' == $comment->comment_approved) { ?><p class="alert"><strong><?php _e('Your comment is awaiting moderation.','redo_domain'); ?></strong></p><?php } ?>
  50. </div>
  51. <?php
  52. }
  53. function redoable_lite_ping($comment, $args, $depth) {
  54. $GLOBALS['comment'] = $comment;
  55. global $ping_count;
  56. $ping_count++;
  57. extract($args, EXTR_SKIP);
  58. ?>
  59. <li id="comment-<?php comment_ID(); ?>" <?php comment_class(redo_comment_class($ping_count, false)); ?>>
  60. <div id="div-comment-<?php comment_ID() ?>">
  61. <a href="#comment-<?php comment_ID() ?>" title="<?php _e('Permanent Link to this Comment','redo_domain'); ?>" class="counter"><?php echo $ping_index; ?></a>
  62. <span class="commentauthor"><?php comment_author_link(); ?></span>
  63. <small class="comment-meta">
  64. <?php
  65. printf(__('%1$s on %2$s','redo_domain'),
  66. '<span class="pingtype">' . get_redo_ping_type(__('Trackback','redo_domain'), __('Pingback','redo_domain')) . '</span>',
  67. sprintf('<a href="#comment-%1$s" title="%2$s">%3$s</a>',
  68. get_comment_ID(),
  69. (function_exists('time_since')?
  70. sprintf(__('%s ago.','redo_domain'),
  71. time_since(abs(strtotime($comment->comment_date_gmt . " GMT")), time())
  72. ):
  73. __('Permanent Link to this Comment','redo_domain')
  74. ),
  75. sprintf(__('%1$s at %2$s','redo_domain'),
  76. get_comment_date(__('M jS, Y','redo_domain')),
  77. get_comment_time()
  78. )
  79. )
  80. );
  81. ?>
  82. <?php if ($user_ID) { edit_comment_link(__('Edit','redo_domain'),'<span class="comment-edit">','</span>'); } ?>
  83. </small>
  84. </div>
  85. <?php
  86. }
  87. if ((have_comments()) or (comments_open())) : $shownavigation = 'yes'; ?>
  88. <div class="comments">
  89. <h4><?php printf(__('%1$s %2$s to &#8220;%3$s&#8221;','redo_domain'), '<span id="comments">' . get_comments_number() . '</span>', (1 == $post->comment_count) ? __('Response','redo_domain'): __('Responses','redo_domain'), the_title_attribute( 'echo=0' ) ); ?></h4>
  90. <div class="metalinks">
  91. <span class="commentsrsslink"><?php post_comments_feed_link( __( 'Feed for this Entry','redo_domain' ) ); ?></span>
  92. <?php if (pings_open()) { ?><span class="trackbacklink"><a href="<?php trackback_url(); ?>" title="<?php _e('Copy this URI to trackback this entry.','redo_domain'); ?>"><?php _e('Trackback Address','redo_domain'); ?></a></span><?php } ?>
  93. </div>
  94. <hr />
  95. <ol id="commentlist">
  96. <?php wp_list_comments(array('callback'=>'redoable_lite_comment', 'type'=>'comment')); ?>
  97. </ol> <!-- END #commentlist -->
  98. <div class="navigation">
  99. <div class="alignleft"><?php previous_comments_link() ?></div>
  100. <div class="alignright"><?php next_comments_link() ?></div>
  101. </div>
  102. <br />
  103. <ol id="pinglist">
  104. <?php wp_list_comments(array('callback'=>'redoable_lite_ping', 'type'=>'pings')); ?>
  105. </ol> <!-- END #pinglist -->
  106. <?php /* Comments open, but empty */ if ( ($post->comment_count < 1) and ('open' == $post->comment_status) ) { ?>
  107. <ol id="commentlist">
  108. <li id="leavecomment">
  109. <?php _e('Leave a Comment','redo_domain'); ?>
  110. </li>
  111. </ol>
  112. <?php } ?>
  113. <?php /* Comments closed */ if (!comments_open() and is_single()) { ?>
  114. <div><?php _e('Comments are currently closed.','redo_domain'); ?></div>
  115. <?php } ?>
  116. </div> <!-- END .comments 1 -->
  117. <?php endif; ?>
  118. <?php comment_form(); ?>
  119. <div class="comments">
  120. <?php if ($shownavigation) { include (TEMPLATEPATH . '/navigation.php'); } ?>
  121. </div>
  122. </div>