Advertisement
Darvil

Untitled

Jan 14th, 2012
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.78 KB | None | 0 0
  1. <?php
  2. // Do not delete these lines
  3.     if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  4.         die ('Please do not load this page directly. Thanks!');
  5.  
  6.     if ( post_password_required() ) { ?>
  7.         <p class="nocomments">This post is password protected. Enter the password to view comments.</p>
  8.     <?php
  9.         return;
  10.     }
  11. ?>
  12.  
  13. <!-- You can start editing here. -->
  14. <?php do_action("comment_form_before");?>
  15. <?php if (have_comments()) { ?>
  16.  
  17. <div class="box">
  18.   <div id="commentspost"><a name="commentspost"></a>
  19.     <h2 class="title"><?php comment_type_count();?> <?php _e('Comments', 'wpzoom'); ?></h2>
  20.     <ol class="normalComments"><?php wp_list_comments('type=all&avatar_size=40');?></ol>
  21.     </div><!-- end #commentspost -->
  22.  
  23. <?php if ('closed' == $post->comment_status) : ?>
  24. </div>
  25. <?php endif; ?>
  26.    
  27.  <?php }
  28.  else { // this is displayed if there are no comments so far ?>
  29.  
  30.     <?php if ('open' == $post->comment_status) { ?>
  31.         <!-- If comments are open, but there are no comments. -->
  32. <div class="box">
  33. <div id="commentspost">
  34.     <h2 class="title">0 <?php _e('Comments', 'wpzoom'); ?></h2>
  35.   <p><?php _e('You can be the first one to leave a comment', 'wpzoom'); ?>.</p>
  36. </div>
  37.      <?php } else { // comments are closed ?>
  38.         <!-- If comments are closed. -->
  39.     <?php } ?>
  40. <?php } ?>
  41.  
  42. <?php if ('open' == $post->comment_status) : ?>
  43.  
  44.  
  45. <div id="respond">
  46.  
  47. <h2 class="title"><?php comment_form_title( __('Leave a Comment', 'wpzoom'), __('Leave a Reply to %s', 'wpzoom') ); ?></h2>
  48. <div class="cleaner">&nbsp;</div>
  49. <div class="cancel-comment-reply"><p><?php cancel_comment_reply_link(); ?></p></div>
  50.  
  51. <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
  52. <p><?php _e('You must be', 'wpzoom'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>"><?php _e('logged in', 'wpzoom'); ?></a> <?php _e('to post a comment.', 'wpzoom'); ?></p>
  53. <?php else : ?>
  54.  
  55. <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  56.  
  57. <?php if ( $user_ID ) : ?>
  58.  
  59. <p><?php _e('Logged in as', 'wpzoom'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account"><?php _e('Log out', 'wpzoom'); ?> &raquo;</a></p>
  60.  
  61. <?php else : ?>
  62. <div id="formLabels">
  63. <label for="author"><?php _e('Name', 'wpzoom'); ?> <?php if ($req) _e('required', 'wpzoom'); ?>:</label>
  64. <input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> /><br />
  65.  
  66. <label for="email"><?php _e('E-Mail', 'wpzoom'); ?> <?php if ($req) _e('required', 'wpzoom'); ?>:</label>
  67. <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> /><br />
  68.  
  69. <label for="url"><?php _e('Website', 'wpzoom'); ?>:</label>
  70. <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /><br />
  71. </div>
  72. <?php endif; ?>
  73. <div id="formContent">
  74. <label for="comment"><?php _e('Comment', 'wpzoom'); ?>:</label>
  75. <textarea name="comment" id="comment" tabindex="4" cols="140" rows="8"></textarea><br />
  76. <input name="submit" type="submit" id="submit" value="<?php _e('Add Comment', 'wpzoom'); ?>" />
  77. <!--<p><strong>XHTML:</strong> You can use these tags: <br /><code><?php echo allowed_tags(); ?></code></p>-->
  78. </div>
  79. <div class="cleaner">&nbsp;</div>
  80. <?php comment_id_fields(); ?>
  81. <?php do_action("comment_form_after"); ?>
  82. </form>
  83. <?php endif; // If registration required and not logged in ?>
  84. </div>
  85. </div>
  86. <?php endif; // if you delete this the sky will fall on your head ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement