elmanisero

comments.php

Dec 27th, 2012
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.94 KB | None | 0 0
  1. <?php // Do not delete these lines
  2.     if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  3.         die ('Please do not load this page directly. Thanks!');
  4.  
  5.     if (!empty($post->post_password)) { // if there's a password
  6.         if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
  7.             ?>
  8.  
  9.             <p class="nocomments">This post is password protected. Enter the password to view comments.<p>
  10.  
  11.             <?php
  12.             return;
  13.         }
  14.     }
  15.  
  16.     /* This variable is for alternating comment background */
  17.     $oddcomment = 'alt';
  18. ?>
  19.  
  20. <!-- You can start editing here. -->
  21.  
  22. <div id="commentblock">
  23. <?php if ($comments) : ?>
  24.     <p id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</p>
  25.  
  26.     <ol class="commentlist">
  27.  
  28.     <?php foreach ($comments as $comment) : ?>
  29.  
  30.         <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">
  31.             <?php if(function_exists('get_avatar')) { echo get_avatar($comment, '50'); } ?>
  32.                     <span class="auth-name"><?php comment_author_link() ?></span><br />
  33.                     <span class="auth-time"><?php if ($comment->comment_approved == '0') : ?></span>
  34.                
  35.                     <span class="awaiting"><em>Your comment is awaiting moderation.</em></span><br />
  36.                     <?php endif; ?>
  37.                     <?php comment_date('F jS, Y') ?> @ <?php comment_time() ?> <?php edit_comment_link('edit','',''); ?>
  38.        
  39.                     <div class="commenttext">
  40.                     <?php comment_text() ?>
  41.                     </div>
  42.                    
  43.            
  44.         </li>
  45.  
  46.     <?php /* Changes every other comment to a different class */
  47.         if ('alt' == $oddcomment) $oddcomment = '';
  48.         else $oddcomment = 'alt';
  49.     ?>
  50.  
  51.     <?php endforeach; /* end for each comment */ ?>
  52.  
  53.     </ol>
  54.  
  55.  <?php else : // this is displayed if there are no comments so far ?>
  56.  
  57.     <?php if ('open' == $post->comment_status) : ?>
  58.         <!-- If comments are open, but there are no comments. -->
  59.  
  60.      <?php else : // comments are closed ?>
  61.         <!-- If comments are closed. -->
  62.         <p class="nocomments">Comments are closed.</p>
  63.  
  64.     <?php endif; ?>
  65. <?php endif; ?>
  66. </div>
  67.  
  68. <?php if ('open' == $post->comment_status) : ?>
  69.  
  70. <p id="respond">Leave a Reply</p>
  71.  
  72. <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
  73. <p>You must be <a href="../stauffer/<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
  74. <?php else : ?>
  75.  
  76. <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  77.  
  78. <?php if ( $user_ID ) : ?>
  79.  
  80. <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>
  81.  
  82. <?php else : ?>
  83.  
  84. <p><label for="author">Name <?php if ($req) echo "(required)"; ?></label><br />
  85. <input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="48" tabindex="1" /></p>
  86.  
  87. <p><label for="email">Email Address<?php if ($req) echo "(required)"; ?></label><br />
  88. <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="48" tabindex="2" /></p>
  89.  
  90. <p><label for="url">Website</label><br />
  91. <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="48" tabindex="3" /></p>
  92.  
  93. <?php endif; ?>
  94.  
  95. <!--<p><small><strong>XHTML:</strong> You can use these tags: <?php echo allowed_tags(); ?></small></p>-->
  96.  
  97. <p><label for="url">Comments</label><br />
  98. <textarea name="comment" id="comment" cols="47" rows="10" tabindex="4"></textarea></p>
  99.  
  100. <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
  101. <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /></p>
  102.  
  103. <?php do_action('comment_form', $post->ID); ?>
  104.  
  105. </form>
  106. </div>
  107.  
  108. <?php endif; // If registration required and not logged in ?>
  109.  
  110. <?php endif; // if you delete this the sky will fall on your head ?>
Advertisement
Add Comment
Please, Sign In to add comment