Advertisement
ksnider

Comments - Julie

Feb 5th, 2012
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.67 KB | None | 0 0
  1. <?php
  2.  
  3. // Do not delete these lines
  4.  
  5. if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
  6. die ('Please do not load this page directly. Thanks!');
  7.  
  8. if ( post_password_required() ) { ?>
  9. <p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.', 'woothemes') ?></p>
  10.  
  11. <?php return; } ?>
  12.  
  13. <?php $comments_by_type = &separate_comments($comments); ?>
  14.  
  15. <!-- You can start editing here. -->
  16.  
  17. <div id="comments">
  18.  
  19. <?php if ( have_comments() ) : ?>
  20.  
  21. <?php if ( ! empty($comments_by_type['comment']) ) : ?>
  22.  
  23. <h3><?php comments_number(__('No Responses', 'woothemes'), __('One Response', 'woothemes'), __('% Responses', 'woothemes') );?> <?php _e('to', 'woothemes') ?> &#8220;<?php the_title(); ?>&#8221;</h3>
  24.  
  25. <ol class="commentlist">
  26.  
  27. <?php wp_list_comments('avatar_size=40&callback=custom_comment&type=comment'); ?>
  28.  
  29. </ol>
  30.  
  31. <div class="navigation">
  32. <div class="fl"><?php previous_comments_link() ?></div>
  33. <div class="fr"><?php next_comments_link() ?></div>
  34. <div class="fix"></div>
  35. </div><!-- /.navigation -->
  36. <?php endif; ?>
  37.  
  38. <?php if ( ! empty($comments_by_type['pings']) ) : ?>
  39.  
  40. <h3 id="pings"><?php _e('Trackbacks/Pingbacks', 'woothemes') ?></h3>
  41.  
  42. <ol class="pinglist">
  43. <?php wp_list_comments('type=pings&callback=list_pings'); ?>
  44. </ol>
  45.  
  46. <?php endif; ?>
  47.  
  48. <?php else : // this is displayed if there are no comments so far ?>
  49.  
  50. <?php if ('open' == $post->comment_status) : ?>
  51. <!-- If comments are open, but there are no comments. -->
  52. <p class="nocomments"><?php _e('No comments yet.', 'woothemes') ?></p>
  53.  
  54. <?php else : // comments are closed ?>
  55. <!-- If comments are closed. -->
  56. <p class="nocomments"><?php _e('Comments are closed.', 'woothemes') ?></p>
  57.  
  58. <?php endif; ?>
  59.  
  60. <?php endif; ?>
  61.  
  62. </div> <!-- /#comments_wrap -->
  63.  
  64. <?php if ('open' == $post->comment_status) : ?>
  65.  
  66. <div id="respond">
  67.  
  68. <h3><?php comment_form_title( __('Leave a Reply', 'woothemes'), __('Leave a Reply to %s', 'woothemes') ); ?></h3>
  69.  
  70. <div class="cancel-comment-reply">
  71. <small><?php cancel_comment_reply_link(); ?></small>
  72. </div><!-- /.cancel-comment-reply -->
  73.  
  74. <?php if ( get_option('comment_registration') && !$user_ID ) : //If registration required & not logged in. ?>
  75.  
  76. <p><?php _e('You must be', 'woothemes') ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>"><?php _e('logged in', 'woothemes') ?></a> <?php _e('to post a comment.', 'woothemes') ?></p>
  77.  
  78. <?php else : //No registration required ?>
  79.  
  80. <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  81.  
  82. <?php if ( $user_ID ) : //If user is logged in ?>
  83.  
  84. <p><?php _e('Logged in as', 'woothemes') ?> <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(); ?>" title="<?php _e('Log out of this account', 'woothemes') ?>"><?php _e('Logout', 'woothemes') ?> &raquo;</a></p>
  85.  
  86. <?php else : //If user is not logged in ?>
  87.  
  88. <p>
  89. <input type="text" name="author" class="txt" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
  90. <label for="author"><?php _e('Name', 'woothemes') ?> <?php if ($req) echo "(required)"; ?></label>
  91. </p>
  92.  
  93. <p>
  94. <input type="text" name="email" class="txt" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
  95. <label for="email"><?php _e('Mail (will not be published)', 'woothemes') ?> <?php if ($req) ?> (<?php _e('Required', 'woothemes'); ?>) <?php ; ?></label>
  96. </p>
  97.  
  98. <p>
  99. <input type="text" name="url" class="txt" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
  100. <label for="url"><?php _e('Website', 'woothemes') ?></label>
  101. </p>
  102.  
  103. <?php endif; // End if logged in ?>
  104.  
  105. <!--<p><strong>XHTML:</strong> <?php _e('You can use these tags', 'woothemes'); ?>: <?php echo allowed_tags(); ?></p>-->
  106.  
  107. <p><textarea name="comment" id="comment" rows="10" cols="50" tabindex="4"></textarea></p>
  108.  
  109. <input name="submit" type="submit" id="submit" class="button" tabindex="5" value="<?php _e('Submit Comment', 'woothemes') ?>" />
  110. <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
  111.  
  112. <?php comment_id_fields(); ?>
  113. <?php do_action('comment_form', $post->ID); ?>
  114.  
  115. </form><!-- /#commentform -->
  116.  
  117. <?php endif; // If registration required ?>
  118.  
  119. <div class="fix"></div>
  120.  
  121. </div><!-- /#respond -->
  122.  
  123. <?php endif; // if you delete this the sky will fall on your head ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement