Advertisement
briefbri

Untitled

Feb 28th, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.05 KB | None | 0 0
  1. <?php if (function_exists('wp_list_comments')) : ?>
  2.  
  3. <?php
  4. /**
  5. * @package WordPress
  6. * @subpackage Default_Theme
  7. */
  8.  
  9. // Do not delete these lines
  10. if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  11. die ('Please do not load this page directly. Thanks!');
  12.  
  13. if ( post_password_required() ) { ?>
  14. <p class="nocomments">This post is password protected. Enter the password to view comments.</p>
  15. <?php
  16. return;
  17. }
  18. ?>
  19.  
  20. <!-- You can start editing here. -->
  21.  
  22. <?php if ( have_comments() ) : ?>
  23. <h2>Comments<?php comments_number('', ' (1)', ' (%)' );?></h2>
  24. <p>&nbsp;</p>
  25.  
  26. <ol class="commentlist">
  27. <?php wp_list_comments(); ?>
  28. </ol>
  29.  
  30. <div class="navigation">
  31. <div class="alignleft"><?php previous_comments_link() ?></div>
  32. <div class="alignright"><?php next_comments_link() ?></div>
  33. </div>
  34. <?php else : // this is displayed if there are no comments so far ?>
  35.  
  36. <?php if ('open' == $post->comment_status) : ?>
  37. <!-- If comments are open, but there are no comments. -->
  38.  
  39. <?php else : // comments are closed ?>
  40. <!-- If comments are closed. -->
  41. <p class="nocomments">Comments are closed.</p>
  42.  
  43. <?php endif; ?>
  44. <?php endif; ?>
  45.  
  46.  
  47. <?php if ('open' == $post->comment_status) : ?>
  48.  
  49. <div id="respond">
  50.  
  51. <h2><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h2>
  52.  
  53. <div class="cancel-comment-reply">
  54. <small><?php cancel_comment_reply_link(); ?></small>
  55. </div>
  56.  
  57. <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
  58. <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
  59. <?php else : ?>
  60.  
  61. <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  62.  
  63. <?php if ( $user_ID ) : ?>
  64.  
  65. <p>Logged in as <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">Log out &raquo;</a></p>
  66.  
  67. <?php else : ?>
  68.  
  69. <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
  70. <label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>
  71.  
  72. <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
  73. <label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>
  74.  
  75. <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
  76. <label for="url"><small>Website</small></label></p>
  77.  
  78. <?php endif; ?>
  79.  
  80. <!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
  81.  
  82. <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
  83.  
  84. <p><button name="submit" type="submit" id="submit">Submit Comment</button>
  85. <?php comment_id_fields(); ?>
  86. </p>
  87. <?php # do_action('comment_form', $post->ID); ?>
  88.  
  89. </form>
  90.  
  91. <?php endif; // If registration required and not logged in ?>
  92. </div>
  93.  
  94. <?php endif; // if you delete this the sky will fall on your head ?>
  95.  
  96. <?php else: ?>
  97.  
  98.  
  99. <?php // Do not delete these lines
  100. if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  101. die ('Please do not load this page directly. Thanks!');
  102. if (!empty($post->post_password)) { // if there's a password
  103. if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
  104. ?>
  105. <p class="nocomments">This post is password protected. Enter the password to view comments.<p>
  106. <?php
  107. return;
  108. }
  109. }
  110. /* This variable is for alternating comment background */
  111. $oddcomment = 'comment1';
  112. ?>
  113. <h2>Comments<?php comments_number('', ' (1)', ' (%)' );?></h2>
  114. <?php comments_number('<p>No Comments</p>', '', '' );?>
  115. <?php if ($comments) : $first = true; ?>
  116. <?php foreach ($comments as $comment) : ?>
  117. <div class="<?php echo $oddcomment; ?><?php if ($first) { echo ' first'; $first = false; } ?>" id="comment-<?php comment_ID() ?>">
  118. <div class="commentdetails">
  119. <p class="commentauthor"><?php comment_author_link() ?></p>
  120. <?php if ($comment->comment_approved == '0') : ?>
  121. <em>Your comment is awaiting moderation.</em>
  122. <?php endif; ?>
  123. <p class="commentdate"><?php comment_date('F jS, Y') ?> at <?php comment_time() ?>
  124. &nbsp; &nbsp; <?php edit_comment_link('Edit Comment','',''); ?>
  125. </p>
  126. </div>
  127. <?php dp_gravatar(); ?>
  128. <br class="break" />
  129. <?php comment_text() ?>
  130. </div>
  131. <?php endforeach; /* end for each comment */ ?>
  132. <?php endif; ?>
  133. <h2 id="respond">Leave a reply</h2>
  134. <?php if ('open' == $post->comment_status) : ?>
  135. <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
  136. <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
  137. <?php else : ?>
  138. <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  139. <?php if ( $user_ID ) : ?>
  140. <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout &raquo;</a></p>
  141. <?php else : ?>
  142. <p><input size="36" type="text" name="author" /> Name <span class="required">*</span></p>
  143. <p><input size="36" type="text" name="email" /> Mail <span class="required">*</span></p>
  144. <p><input size="36" type="text" name="url" /> Website</p>
  145. <?php endif; ?>
  146. <p><textarea rows="12" cols="42" name="comment"></textarea></p>
  147. <p><button name="submit" type="submit" id="submit" tabindex="5">Submit Comment</button>
  148. <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
  149. </p>
  150. <?php # do_action('comment_form', $post->ID); ?>
  151. </form>
  152. <?php endif; ?>
  153. <?php endif; ?>
  154.  
  155. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement