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

/blog/wp-content/themes/extinct/sandbox-097/comments.php

https://bitbucket.org/sergiohzlz/reportaprod
PHP | 142 lines | 113 code | 29 blank | 0 comment | 22 complexity | f647d3af7cff08efbedffab251f7b545 MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-2.1
  1. <div id="comments">
  2. <?php
  3. $req = get_settings('require_name_email'); // Checks if fields are required. Thanks, Adam. ;-)
  4. if ( 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']) )
  5. die ( 'Please do not load this page directly. Thanks!' );
  6. if ( post_password_required() ) :
  7. ?> <div class="nopassword"><?php _e('This post is password protected. Enter the password to view any comments.', 'sandbox') ?></div>
  8. </div><!-- .comments -->
  9. <?php
  10. return;
  11. endif;
  12. function sandbox_097_comment($comment, $args, $depth) {
  13. $GLOBALS['comment'] = $comment;
  14. extract($args, EXTR_SKIP);
  15. ?>
  16. <li <?php comment_class(sandbox_comment_class(false)); ?> id="comment-<?php comment_ID() ?>">
  17. <div id="div-comment-<?php comment_ID() ?>">
  18. <div class="vcard">
  19. <div class="comment-avatar"><?php if ($args['avatar_size'] != 0) echo get_avatar( $comment, $args['avatar_size'] ); ?></div>
  20. <div class="comment-author"><span class="fn n"><?php comment_author_link() ?></span></div>
  21. </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>', 'sandbox'),
  23. get_comment_date(),
  24. get_comment_time(),
  25. '#comment-' . get_comment_ID() );
  26. edit_comment_link(__('Edit', 'sandbox'), ' <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", 'sandbox') ?>
  28. <?php comment_text(); ?>
  29. <div class="reply">
  30. <?php comment_reply_link(array_merge( $args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
  31. </div>
  32. </div>
  33. <?php
  34. }
  35. function sandbox_097_ping($comment, $args, $depth) {
  36. $GLOBALS['comment'] = $comment;
  37. extract($args, EXTR_SKIP);
  38. ?>
  39. <li <?php comment_class(sandbox_comment_class(false)); ?> id="comment-<?php comment_ID() ?>">
  40. <div class="comment-author"><?php printf(__('By %1$s on %2$s at %3$s', 'sandbox'),
  41. get_comment_author_link(),
  42. get_comment_date(),
  43. get_comment_time() );
  44. edit_comment_link(__('Edit', 'sandbox'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>'); ?></div>
  45. <?php if ($comment->comment_approved == '0') _e('\t\t\t\t\t<span class="unapproved">Your trackback is awaiting moderation.</span>\n', 'sandbox') ?>
  46. <?php comment_text() ?>
  47. <?php
  48. }
  49. if ( have_comments() ) : ?>
  50. <?php global $sandbox_comment_alt ?>
  51. <?php /* numbers of pings and comments */
  52. $ping_count = $comment_count = 0;
  53. foreach ( $comments as $comment )
  54. get_comment_type() == "comment" ? ++$comment_count : ++$ping_count;
  55. ?>
  56. <?php if ( $comment_count ) : ?>
  57. <?php $sandbox_comment_alt = 0 ?>
  58. <div id="comments-list" class="comments">
  59. <h3><?php printf($comment_count > 1 ? __('<span>%d</span> Comments', 'sandbox') : __('<span>One</span> Comment', 'sandbox'), $comment_count) ?></h3>
  60. <ol>
  61. <?php wp_list_comments(array('callback'=>'sandbox_097_comment', 'avatar_size'=>16, 'type'=>'comment')); ?>
  62. </ol>
  63. <div class="navigation">
  64. <div class="alignleft"><?php previous_comments_link() ?></div>
  65. <div class="alignright"><?php next_comments_link() ?></div>
  66. </div>
  67. <br />
  68. </div><!-- #comments-list .comments -->
  69. <?php endif; /* if ( $comment_count ) */ ?>
  70. <?php if ( $ping_count ) : ?>
  71. <?php $sandbox_comment_alt = 0 ?>
  72. <div id="trackbacks-list" class="comments">
  73. <h3><?php printf($ping_count > 1 ? __('<span>%d</span> Trackbacks', 'sandbox') : __('<span>One</span> Trackback', 'sandbox'), $ping_count) ?></h3>
  74. <ol>
  75. <?php wp_list_comments(array('callback'=>'sandbox_097_ping', 'type'=>'pings')); ?>
  76. </ol>
  77. </div><!-- #trackbacks-list .comments -->
  78. <?php endif /* if ( $ping_count ) */ ?>
  79. <?php endif /* if ( $comments ) */ ?>
  80. <?php if ( comments_open() ) : ?>
  81. <div id="respond">
  82. <h3><?php comment_form_title( __('Post a Comment', 'sandbox'), __('Post a Comment to %s', 'sandbox') ); ?></h3>
  83. <div id="cancel-comment-reply"><small><?php cancel_comment_reply_link() ?></small></div>
  84. <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
  85. <p id="login-req"><?php printf(__('You must be <a href="%s" title="Log in">logged in</a> to post a comment.', 'sandbox'),
  86. get_option('siteurl') . '/wp-login.php?redirect_to=' . get_permalink() ) ?></p>
  87. <?php else : ?>
  88. <div class="formcontainer">
  89. <form id="commentform" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post">
  90. <?php if ( $user_ID ) : ?>
  91. <p id="login"><?php printf(__('<span class="loggedin">Logged in as <a href="%1$s" title="Logged in as %2$s">%2$s</a>.</span> <span class="logout"><a href="%3$s" title="Log out of this account">Log out?</a></span>', 'sandbox'),
  92. get_option('siteurl') . '/wp-admin/profile.php',
  93. esc_html( $user_identity ),
  94. get_option('siteurl') . '/wp-login.php?action=logout&amp;redirect_to=' . get_permalink() ) ?></p>
  95. <?php else : ?>
  96. <p id="comment-notes"><?php if ($req) _e('Required fields are marked <span class="required">*</span>', 'sandbox') ?></p>
  97. <div class="form-label"><label for="author"><?php _e('Name', 'sandbox') ?></label> <?php if ($req) _e('<span class="required">*</span>', 'sandbox') ?></div>
  98. <div class="form-input"><input id="author" name="author" type="text" value="<?php echo $comment_author ?>" size="30" maxlength="20" tabindex="3" /></div>
  99. <div class="form-label"><label for="email"><?php _e('Email', 'sandbox') ?></label> <?php if ($req) _e('<span class="required">*</span>', 'sandbox') ?></div>
  100. <div class="form-input"><input id="email" name="email" type="text" value="<?php echo $comment_author_email ?>" size="30" maxlength="50" tabindex="4" /></div>
  101. <div class="form-label"><label for="url"><?php _e('Website', 'sandbox') ?></label></div>
  102. <div class="form-input"><input id="url" name="url" type="text" value="<?php echo $comment_author_url ?>" size="30" maxlength="50" tabindex="5" /></div>
  103. <?php endif /* if ( $user_ID ) */ ?>
  104. <div class="form-label"><label for="comment"><?php _e('Comment', 'sandbox') ?></label></div>
  105. <div class="form-textarea"><textarea id="comment" name="comment" cols="45" rows="8" tabindex="6"></textarea></div>
  106. <div class="form-submit"><input id="submit" name="submit" type="submit" value="<?php _e('Post Comment', 'sandbox') ?>" tabindex="7" /><?php comment_id_fields(); ?></div>
  107. <?php do_action('comment_form', $post->ID); ?>
  108. </form><!-- #commentform -->
  109. </div><!-- .formcontainer -->
  110. <?php endif /* if ( get_option('comment_registration') && !$user_ID ) */ ?>
  111. </div><!-- #respond -->
  112. <?php endif /* if ( 'open' == $post->comment_status ) */ ?>
  113. </div><!-- #comments -->