PageRenderTime 62ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/webroot/blog/wp-content/themes/la-school-blue/legacy.comments.php

https://github.com/Wargo/reddevil
PHP | 103 lines | 67 code | 34 blank | 2 comment | 22 complexity | ef1b65ef2916ab74eaed5df5629b76a9 MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0, LGPL-2.1, GPL-3.0
  1. <?php // Do not delete these lines
  2. if (isset($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  3. die ('Please do not load this page directly. Thanks!');
  4. if (!empty($post->post_password)) { // if there's a password
  5. if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
  6. ?>
  7. <p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.', 'laschool'); ?></p>
  8. <?php
  9. return;
  10. }
  11. }
  12. /* This variable is for alternating comment background */
  13. $oddcomment = 'class="alt" ';
  14. ?>
  15. <?php if ($comments) : ?>
  16. <h2 id="comments"><?php comments_number(__('No Responses', 'laschool'), __('One Response', 'laschool'), __('% Responses', 'laschool'));?> <?php printf(__('to &#8220;%s&#8221;', 'laschool'), the_title('', '', false)); ?></h2>
  17. <ol class="comments">
  18. <?php foreach ($comments as $comment) : ?>
  19. <li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
  20. <?php echo get_avatar( $comment, 32 ); ?>
  21. <p class="data"><?php comment_author_link(); ?>
  22. <?php if ($comment->comment_approved == '0') : ?>
  23. <small class="approve"><?php _e('Your comment is awaiting moderation.', 'laschool'); ?></small>
  24. <?php endif; ?>
  25. <br /><small><?php printf(__('%1$s at %2$s', 'laschool'), get_comment_date(__('F jS, Y', 'laschool')), get_comment_time()); ?> <?php edit_comment_link(__('edit', 'laschool'),'&nbsp;',''); ?></small></p>
  26. <?php comment_text() ?>
  27. </li>
  28. <?php
  29. /* Changes every other comment to a different class */
  30. $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
  31. ?>
  32. <?php endforeach; /* end for each comment */ ?>
  33. </ol>
  34. <?php else : // this is displayed if there are no comments so far ?>
  35. <?php if ('open' == $post->comment_status) : ?>
  36. <!-- If comments are open, but there are no comments. -->
  37. <?php else : // comments are closed ?>
  38. <!-- If comments are closed. -->
  39. <p class="nocomments"><?php _e('Comments are closed.', 'laschool'); ?></p>
  40. <?php endif; ?>
  41. <?php endif; ?>
  42. <?php if ('open' == $post->comment_status) : ?>
  43. <h2 id="respond"><?php _e('Leave a Reply', 'laschool'); ?></h2>
  44. <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
  45. <p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.', 'laschool'), get_option('siteurl') . '/wp-login.php?redirect_to=' . urlencode(get_permalink())); ?></p>
  46. <?php else : ?>
  47. <fieldset>
  48. <legend><?php _e('Leave a Reply', 'laschool'); ?></legend>
  49. <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  50. <?php if ( $user_ID ) : ?>
  51. <p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>.', 'laschool'), get_option('siteurl') . '/wp-admin/profile.php', $user_identity); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account', 'laschool'); ?>"><?php _e('Log out &raquo;', 'laschool'); ?></a></p>
  52. <?php else : ?>
  53. <p><label for="author"><?php _e('Name', 'laschool'); ?> <?php if ($req) _e("<small>required</small>", "laschool"); ?></label>
  54. <input type="text" id="author" name="author" value="<?php echo $comment_author; ?>" class="input" tabindex="1" /></p>
  55. <p><label for="email"><?php _e('Mail <small>will not be published</small>', 'laschool'); ?><?php if ($req) _e("<small>, required</small>", "laschool"); ?></label>
  56. <input type="text" id="email" name="email" value="<?php echo $comment_author_email; ?>" class="input" tabindex="2" /></p>
  57. <p><label for="url"><?php _e('Website', 'laschool'); ?></label>
  58. <input type="text" id="url" name="url" value="<?php echo $comment_author_url; ?>" class="input" tabindex="3" /></p>
  59. <?php endif; ?>
  60. <p><label for="comment"><?php _e('Comment', 'laschool'); ?> <?php _e('<small>no spam</small>', 'laschool'); ?></label>
  61. <textarea id="comment" name="comment" class="textarea" cols="45" rows="8" tabindex="4"></textarea>
  62. </p>
  63. <p><input type="submit" id="submit" name="submit" value="<?php _e('Submit Comment', 'laschool'); ?>" class="submit" tabindex="5" /> <?php _e('or', 'laschool'); ?> <a href="" tabindex="6"><?php _e('chancel', 'laschool'); ?></a>
  64. <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /></p>
  65. <?php do_action('comment_form', $post->ID); ?>
  66. </form>
  67. </fieldset>
  68. <?php endif; // If registration required and not logged in ?>
  69. <?php endif; // if you delete this the sky will fall on your head ?>