PageRenderTime 44ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/blog/wp-content/themes/twenty-eight/comments.php

https://bitbucket.org/sergiohzlz/reportaprod
PHP | 78 lines | 70 code | 8 blank | 0 comment | 12 complexity | c05506fd52a28088e7bf844265b1dc89 MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-2.1
  1. <?php // Do not delete these lines
  2. if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  3. die ('Please do not load this page directly. Thanks!');
  4. if ( post_password_required() ) {
  5. ?>
  6. <p class="center"><?php _e("This post is password protected. Enter the password to view comments."); ?></p>
  7. <?php
  8. return;
  9. }
  10. function twenty_eight_comment($comment, $args, $depth) {
  11. $GLOBALS['comment'] = $comment;
  12. extract($args, EXTR_SKIP);
  13. ?>
  14. <li <?php comment_class(empty( $args['has_children'] ) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>">
  15. <div id="div-comment-<?php comment_ID() ?>">
  16. <div class="comment-author vcard">
  17. <?php if ($args['avatar_size'] != 0) echo get_avatar( $comment, $args['avatar_size'] ); ?>
  18. <span class="commentauthor fn" style="font-weight: normal;"><?php comment_author_link(); ?></span>
  19. </div>
  20. <?php edit_comment_link('<img src="'.get_bloginfo(template_directory).'/images/pencil.png" alt="Edit Link" />','<span class="commentseditlink">','</span>'); ?>
  21. <p class="metadata" style="color:#9c9c9c;font-size:12px;margin-top:2px;"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>" title="<?php { ?>Permalink to Comment<?php } ?>"><?php comment_date() ?> at <?php comment_time() ?></a></p>
  22. <div class="itemtext"><?php comment_text() ?></div>
  23. <?php if ($comment->comment_approved == '0') : ?>
  24. <p class="alert"><strong>Your comment is awaiting moderation.</strong></p>
  25. <?php endif; ?>
  26. <div class="reply">
  27. <?php comment_reply_link(array_merge( $args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
  28. </div>
  29. </div>
  30. <?php
  31. }
  32. function twenty_eight_ping($comment, $args, $depth) {
  33. $GLOBALS['comment'] = $comment;
  34. global $count_pings;
  35. extract($args, EXTR_SKIP);
  36. ?>
  37. <li <?php comment_class(empty( $args['has_children'] ) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>">
  38. <a href="#comment-<?php comment_ID() ?>" title="Permanent Link to this Comment" class="counter"><?php echo $count_pings; $count_pings++; ?></a>
  39. <span class="commentauthor"><?php comment_author_link() ?></span>
  40. <small class="commentmetadata">
  41. <span class="pingtype"><?php comment_type(); ?></span> on <a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>" title="<?php if (function_exists('time_since')) { $comment_datetime = strtotime($comment->comment_date); echo time_since($comment_datetime) ?> ago<?php } else { ?>Permalink to Comment<?php } ?>"><?php comment_date('M jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('<img src="'.get_bloginfo(template_directory).'/images/pencil.png" alt="Edit Link" />','<span class="commentseditlink">','</span>'); ?>
  42. </small>
  43. <?php comment_text(); ?>
  44. <?php
  45. }
  46. ?>
  47. <?php if ((have_comments()) or (comments_open())) { ?>
  48. <hr />
  49. <div class="comments" id="comments">
  50. <div class="center">
  51. <h4><a href="#comments"><?php comments_number('Leave a Comment', 'One Reply', '% Replies' );?></a></h4>
  52. </div>
  53. <ol class="commentlist" id='commentlist'>
  54. <?php if (have_comments()) : ?>
  55. <?php wp_list_comments(array('callback'=>'twenty_eight_comment', 'avatar_size'=>48, 'type'=>'comment')); ?>
  56. </ol>
  57. <ol class="pinglist">
  58. <?php global $count_pings; $count_pings = 1; ?>
  59. <?php wp_list_comments(array('callback'=>'twenty_eight_ping', 'avatar_size'=>48, 'type'=>'pings')); ?>
  60. </ol>
  61. <div class="navigation">
  62. <div class="alignleft"><?php previous_comments_link() ?></div>
  63. <div class="alignright"><?php next_comments_link() ?></div>
  64. </div>
  65. <br />
  66. <?php endif; ?>
  67. <?php include (TEMPLATEPATH . '/navigation.php'); ?>
  68. <?php comment_form(); ?>
  69. </div>
  70. <?php } ?>