Advertisement
Guest User

Simplio Comments Form

a guest
Nov 2nd, 2012
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.59 KB | None | 0 0
  1. <?php
  2.  
  3. // Do not delete these lines
  4. if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  5. die ('Please do not load this page directly. Thanks!');
  6.  
  7. if ( post_password_required() ) { ?>
  8. <p class="nocomments">This post is password protected. Enter the password to view comments.</p>
  9. <?php
  10. return;
  11. }
  12. ?>
  13.  
  14. <!-- You can start editing here. -->
  15.  
  16. <?php if ( have_comments() ) : ?>
  17. <h2 class="h2comments"><?php comments_number('No Comments', '1 Comment', '% Comments' );?></h2>
  18.  
  19. <ul class="commentlist">
  20. <?php wp_list_comments('callback=mytheme_comment'); ?>
  21. </ul>
  22. <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
  23. <div class="navigation">
  24. <div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments') ); ?></div>
  25. <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>') ); ?></div>
  26. </div><!-- .navigation -->
  27. <?php endif; // check for comment navigation ?>
  28. <?php 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.  
  33. <?php else : // comments are closed ?>
  34. <!-- If comments are closed. -->
  35. <p class="nocomments">Comments are closed.</p>
  36.  
  37. <?php endif; ?>
  38. <?php endif; ?>
  39.  
  40.  
  41. <?php if ('open' == $post->comment_status) : ?>
  42.  
  43. <div id="respond">
  44.  
  45. <h2 id="commentsForm"><?php comment_form_title( 'Leave a comment', 'Leave a comment to %s' ); ?></h2>
  46.  
  47. <div class="cancel-comment-reply">
  48. <small><?php cancel_comment_reply_link(); ?></small>
  49. </div>
  50.  
  51. <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
  52. <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>
  53. <?php else : ?>
  54.  
  55. <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  56. <?php if ( $user_ID ) : ?>
  57.  
  58. <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>
  59.  
  60. <?php else : ?>
  61.  
  62. <p><label for="author">Name <?php if ($req) echo "(required)"; ?></label>
  63. <input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
  64. </p>
  65.  
  66. <p><label for="email">Mail (will not be published) <?php if ($req) echo "(required)"; ?></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'"; ?> />
  68. </p>
  69.  
  70. <p><label for="url">Website</label>
  71. <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
  72. </p>
  73.  
  74. <?php endif; ?>
  75.  
  76. <!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
  77.  
  78. <p><label for="comment">Comment</label>
  79. <textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
  80.  
  81. <p><input name="submit" type="submit" id="submit" tabindex="5" value="POST COMMENT" />
  82. <?php comment_id_fields(); ?>
  83. </p>
  84.  
  85. <?php do_action('comment_form', $post->ID); ?>
  86.  
  87. </form>
  88.  
  89. <?php endif; // If registration required and not logged in ?>
  90. </div>
  91.  
  92. <?php endif; // if you delete this the sky will fall on your head ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement