Advertisement
alchymyth

comments form before list

Jul 28th, 2011
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.79 KB | None | 0 0
  1. <div class="Comments">
  2.  
  3. <?php // Do not delete these lines
  4. if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  5. die ('Please do not load this page directly. Thanks!');
  6. if (!empty($post->post_password)) { // if there's a password
  7.   if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
  8. ?>
  9.   <p class="nocomments">This post is password protected. Enter the password to view comments.<p>
  10.   <?php return; }}?>
  11.  
  12.   <?php if ('open' == $post->comment_status) : ?><br />
  13.  
  14.   <div class="Form"><div class="FormTop"></div>
  15.   <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
  16.     <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>
  17.   <?php else : ?>
  18.  
  19.     <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  20.     <?php if ( $user_ID ) : ?>
  21.       <p style="display: block; margin-top: 5px;">Logged in as <a href="http://www.rockitmembers.us/sf-forum/profile/"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>">Logout &raquo;</a></p>
  22.     <?php else : ?>
  23.       <p>
  24.       <label for="author">
  25.       <input type="text" name="author" maxlength="35" id="author" value="Your name" onfocus="if (value =='Your name'){value =''}" onblur="if (value ==''){value='Your name'}" tabindex="1" class="namefield" />
  26.       </label></p>
  27.       <p>
  28.       <label for="email">
  29.       <input type="text" name="email" id="email" value="Your Email"  maxlength="35" onfocus="if (value =='Your Email'){value =''}" onblur="if (value ==''){value='Your Email'}" tabindex="2" class="email"  />
  30.       </label></p>
  31.       <p>
  32.       <label for="url">
  33.       <input maxlength="35" type="text" name="url" id="url" value="Your website or blog" onfocus="if (value =='Your website or blog'){value =''}" onblur="if (value ==''){value='Your website or blog'}" tabindex="3" class="website"/>
  34.       </label></p>
  35.     <?php endif; ?>
  36.     <br clear="all" />
  37.     <p><textarea name="comment" id="comment" rows="10" tabindex="4" class="TextArea"></textarea></p>
  38.     <p>
  39.     <label>
  40.     <input maxlength="30" name="SubmitComment" type="submit" name="button" id="button" class="SubmitComment" alt="Post Your Comment" value="Submit" />
  41.     </label>
  42.     <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
  43.     <?php do_action('comment_form', $post->ID); ?></p>
  44.     </form>
  45.   </div><!<--/.Form-->
  46.  
  47.   <?php endif; // If registration required and not logged in ?>
  48.  
  49. <div class="List">
  50. <?php if ($comments) : ?>
  51.   <h4 id="Comments"><?php comments_number('No Comments', 'One Comment', '% Comments' );?> for "<?php the_title(); ?>"</h4>
  52.  
  53. <ol><?php foreach ($comments as $comment) : ?>
  54. <li class="ComListLi" id="comment-<?php comment_ID() ?>">
  55. <table><tbody><tr>
  56. <td valign="top" style="padding-right: 5px;"><?php sf_show_forum_avatar($comment->comment_author_email); ?></td>
  57. <td valign="top"><?php comment_author_link() ?> | <?php comment_date('m/d/y') ?><?php edit_comment_link('&nbsp;&nbsp;<strong>Edit</strong>','',''); ?></a>
  58. <div class="linebreak"></div>
  59. <?php comment_text() ?>
  60. </td></tr></tbody></table></li></ol>
  61. <?php if ($comment->comment_approved == '0') : ?>Your comment is awaiting moderation.
  62. <?php endif; ?>
  63.   <?php endforeach; /* end for each comment */ ?>
  64.   <?php else : // this is displayed if there are no comments so far ?>
  65.     <?php if ('open' == $post->comment_status) : ?>
  66.     <?php else : // comments are closed ?>
  67.       <p class="nocomments">Comments are closed.</p>
  68.     <?php endif; ?>
  69.   <?php endif; ?>
  70. </div><!--/.list-->
  71.  
  72. <?php endif; // if you delete this the sky will fall on your head ?>
  73.  
  74. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement