PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 1ms

/comments.php

https://github.com/petergibbons/OpenCounterWP
PHP | 96 lines | 61 code | 30 blank | 5 comment | 18 complexity | 5b13c8b09481d4ff22226d728c9c1d85 MD5 | raw file
  1. <?php
  2. /**
  3. * @package WordPress
  4. * @subpackage Default_Theme
  5. */
  6. // Do not delete these lines
  7. if (isset($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  8. die ('Please do not load this page directly. Thanks!');
  9. if ( post_password_required() ) { ?>
  10. <p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.', 'kubrick'); ?></p>
  11. <?php
  12. return;
  13. }
  14. ?>
  15. <!-- You can start editing here. -->
  16. <?php if ( have_comments() ) : ?>
  17. <h3 id="comments"><?php comments_number(__('No Responses', 'kubrick'), __('One Response', 'kubrick'), __('% Responses', 'kubrick'));?> <?php printf(__('to &#8220;%s&#8221;', 'kubrick'), the_title('', '', false)); ?></h3>
  18. <div class="navigation">
  19. <div class="alignleft"><?php previous_comments_link() ?></div>
  20. <div class="alignright"><?php next_comments_link() ?></div>
  21. </div>
  22. <ol class="commentlist">
  23. <?php wp_list_comments();?>
  24. </ol>
  25. <div class="navigation">
  26. <div class="alignleft"><?php previous_comments_link() ?></div>
  27. <div class="alignright"><?php next_comments_link() ?></div>
  28. </div>
  29. <?php else : // this is displayed if there are no comments so far ?>
  30. <?php if ( comments_open() ) : ?>
  31. <!-- If comments are open, but there are no comments. -->
  32. <?php else : // comments are closed ?>
  33. <!-- If comments are closed. -->
  34. <p class="nocomments"><?php _e('Comments are closed.', 'kubrick'); ?></p>
  35. <?php endif; ?>
  36. <?php endif; ?>
  37. <?php if ( comments_open() ) : ?>
  38. <div id="respond">
  39. <h3><?php comment_form_title( __('Leave a Reply', 'kubrick'), __('Leave a Reply for %s' , 'kubrick') ); ?></h3>
  40. <div id="cancel-comment-reply">
  41. <small><?php cancel_comment_reply_link() ?></small>
  42. </div>
  43. <?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
  44. <p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.', 'kubrick'), wp_login_url( get_permalink() )); ?></p>
  45. <?php else : ?>
  46. <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  47. <?php if ( is_user_logged_in() ) : ?>
  48. <p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>.', 'kubrick'), get_option('siteurl') . '/wp-admin/profile.php', $user_identity); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php _e('Log out of this account', 'kubrick'); ?>"><?php _e('Log out &raquo;', 'kubrick'); ?></a></p>
  49. <?php else : ?>
  50. <p><input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
  51. <label for="author"><small><?php _e('Name', 'kubrick'); ?> <?php if ($req) _e("(required)", "kubrick"); ?></small></label></p>
  52. <p><input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
  53. <label for="email"><small><?php _e('Mail (will not be published)', 'kubrick'); ?> <?php if ($req) _e("(required)", "kubrick"); ?></small></label></p>
  54. <p><input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" />
  55. <label for="url"><small><?php _e('Website', 'kubrick'); ?></small></label></p>
  56. <?php endif; ?>
  57. <!--<p><small><?php printf(__('<strong>XHTML:</strong> You can use these tags: <code>%s</code>', 'kubrick'), allowed_tags()); ?></small></p>-->
  58. <p><textarea name="comment" id="comment" cols="58" rows="10" tabindex="4"></textarea></p>
  59. <p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Submit Comment', 'kubrick'); ?>" />
  60. <?php comment_id_fields(); ?>
  61. </p>
  62. <?php do_action('comment_form', $post->ID); ?>
  63. </form>
  64. <?php endif; // If registration required and not logged in ?>
  65. </div>
  66. <?php endif; // if you delete this the sky will fall on your head ?>