SHARE
TWEET

Nicki

a guest Dec 15th, 2008 292 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php // Do not delete these lines
  2.         if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  3.                 die ('Please do not load this page directly. Thanks!');
  4.                
  5.         if (function_exists('post_password_required')) {
  6.                 if ( post_password_required() ) {
  7.                         echo '<p class="nocomments">This post is password protected. Enter the password to view comments.</p>';
  8.                         return;
  9.                 }
  10.         } else {
  11.                 if (!empty($post->post_password)) {
  12.                         // if there's a password
  13.                         if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {
  14.                                 // and it doesn't match the cookie  ?>
  15.                                 <p class="nocomments">This post is password protected. Enter the password to view comments.</p>
  16.                                 <?php return;
  17.                         }
  18.                 }
  19.         }
  20. ?>
  21. <div id="commentblock">
  22. <?php
  23. if (function_exists('wp_list_comments')) :
  24.         //WP 2.7 Comment Loop
  25.         if ( have_comments() ) : ?>
  26.         <p id="comments"><b><?php comments_number('No Responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</b></p>
  27.         <ol class="commentlist">
  28.             <?php wp_list_comments('avatar_size=70&type=comment&callback=custom_comment'); ?>
  29.         </ol>
  30.        
  31.         <?php /* *************************************/
  32.                                 // Come back later and style this ...
  33.                 ?>
  34.                 <?php /*?><h3>Trackbacks / Pingbacks</h3>
  35.         <ul class="trackback">
  36.             <?php wp_list_comments('type=pings'); ?>
  37.         </ul><?php */?>
  38.         <?php /* *************************************/ ?>
  39.        
  40.                 <div class="navigation">
  41.                         <div class="alignleft"><?php previous_comments_link() ?></div>
  42.                         <div class="alignright"><?php next_comments_link() ?></div>
  43.                 </div>
  44.         <?php else : // this is displayed if there are no comments so far ?>
  45.                 <?php if ('open' == $post->comment_status) :
  46.                         // If comments are open, but there are no comments.
  47.                 else : ?><p class="nocomments">Comments are closed.</p>
  48.                 <?php endif;
  49.         endif;
  50. else:
  51.         //WP 2.6 and older Comment Loop
  52.         /* This variable is for alternating comment background */
  53.         $oddcomment = 'alt';
  54.        
  55.         if ($comments) : ?>
  56.                 <h3 id="comments"><?php comments_number('No comments filed', 'One comment', '% comments' );?> to &#8220;<?php the_title(); ?>&#8221;</h3>
  57.                 <ol class="commentlist">
  58.                         <?php foreach ( $comments as $comment ) : ?>
  59.                 <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">
  60.                     Comment by <em><?php comment_author_link() ?></em>:
  61.                     <?php if ($comment->comment_approved == '0') : ?>
  62.                     <em>Your comment is awaiting moderation.</em>
  63.                     <?php endif; ?>
  64.                     <br />
  65.                     <small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('l, F jS Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('Edit','',''); ?></small>
  66.                     <?php comment_text() ?>
  67.                 </li>
  68.      
  69.                 <?php /* Changes every other comment to a different class */   
  70.                     if ('alt' == $oddcomment) $oddcomment = '';
  71.                     else $oddcomment = 'alt';
  72.                 ?>
  73.             <?php endforeach; /* end for each comment */ ?>
  74.                 </ol>
  75.         <?php else : // this is displayed if there are no comments so far ?>
  76.                 <?php if ('open' == $post->comment_status) : ?>
  77.                         <!-- If comments are open, but there are no comments. -->
  78.                 <?php else : // comments are closed ?>
  79.                         <!-- If comments are closed. -->
  80.                         <p class="nocomments">Comments are closed.</p>
  81.                 <?php endif; ?>
  82.         <?php endif; ?>
  83.  
  84. <?php endif; // 2.6 and older Comment Loop end ?>
  85.  
  86. <?php if ('open' == $post->comment_status) : ?>
  87.         <div<?php /*?> id="respond"<?php */?>>
  88.                 <h3>Leave a Reply</h3>
  89.         <p id="respond">Feel free to leave a comment. If you want an image to show, make sure you have
  90.                 a <a rel="external" href="http://en.gravatar.com" >gravatar</a> set!</p>
  91.  
  92.                 <?php if (function_exists('cancel_comment_reply_link')) /*2.7 comment loop code*/ { ?>
  93.                         <div id="cancel-comment-reply">
  94.                                 <small><?php cancel_comment_reply_link();?></small>
  95.                         </div>
  96.                 <?php } ?>
  97.                
  98.                 <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
  99.                 <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>
  100.                 <?php else : ?>
  101.                         <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="comment_form">
  102.                                 <?php if ( $user_ID ) : ?>
  103.                         <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>
  104.                     <?php else : ?>
  105.                     <p><label for="name"><strong>Name:</strong> <?php if ($req) echo "(required)"; ?></label><br />
  106.                         <input type="text" name="author" id="name" value="<?php echo $comment_author; ?>" size="50" tabindex="1" /></p>
  107.                     <p><label for="email"><strong>Email Address:</strong> <?php if ($req) echo "(required)"; ?></label><br />
  108.                         <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="50" tabindex="2" /></p>
  109.                     <p><label for="url"><strong>Website:</strong> </label><br />
  110.                         <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="50" tabindex="3" /></p>
  111.                     <?php endif; ?>
  112.  
  113.                 <p><?php if (function_exists('lmbbox_comment_quicktags_display')) { lmbbox_comment_quicktags_display(); } ?></p>
  114.  
  115.                     <?php comment_id_fields(); ?>
  116.                     <!--<p><small><strong>XHTML:</strong> You can use these tags: <?php echo allowed_tags(); ?></small></p>-->
  117.                 <p><label for="words"><strong>Speak your mind:</strong> </label><br />
  118.                         <textarea name="comment" id="comment" cols="40" rows="10" tabindex="4" style="width:460px;"></textarea></p>
  119.                     <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
  120.                         <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
  121.                     </p>
  122.                    
  123.                     <?php do_action('comment_form', $post->ID); ?>
  124.                         </form>
  125.         </div>
  126. </div>
  127. <?php endif; // If registration required and not logged in ?>
  128.  
  129. <?php endif; // if you delete this the sky will fall on your head ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top