Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php // Do not delete these lines
- if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
- die ('Please do not load this page directly. Thanks!');
- if (function_exists('post_password_required')) {
- if ( post_password_required() ) {
- echo '<p class="nocomments">This post is password protected. Enter the password to view comments.</p>';
- return;
- }
- } else {
- if (!empty($post->post_password)) {
- // if there's a password
- if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {
- // and it doesn't match the cookie ?>
- <p class="nocomments">This post is password protected. Enter the password to view comments.</p>
- <?php return;
- }
- }
- }
- ?>
- <div id="commentblock">
- <?php
- if (function_exists('wp_list_comments')) :
- //WP 2.7 Comment Loop
- if ( have_comments() ) : ?>
- <p id="comments"><b><?php comments_number('No Responses', 'One Response', '% Responses' );?> to “<?php the_title(); ?>”</b></p>
- <ol class="commentlist">
- <?php wp_list_comments('avatar_size=70&type=comment&callback=custom_comment'); ?>
- </ol>
- <?php /* *************************************/
- // Come back later and style this ...
- ?>
- <?php /*?><h3>Trackbacks / Pingbacks</h3>
- <ul class="trackback">
- <?php wp_list_comments('type=pings'); ?>
- </ul><?php */?>
- <?php /* *************************************/ ?>
- <div class="navigation">
- <div class="alignleft"><?php previous_comments_link() ?></div>
- <div class="alignright"><?php next_comments_link() ?></div>
- </div>
- <?php else : // this is displayed if there are no comments so far ?>
- <?php if ('open' == $post->comment_status) :
- // If comments are open, but there are no comments.
- else : ?><p class="nocomments">Comments are closed.</p>
- <?php endif;
- endif;
- else:
- //WP 2.6 and older Comment Loop
- /* This variable is for alternating comment background */
- $oddcomment = 'alt';
- if ($comments) : ?>
- <h3 id="comments"><?php comments_number('No comments filed', 'One comment', '% comments' );?> to “<?php the_title(); ?>”</h3>
- <ol class="commentlist">
- <?php foreach ( $comments as $comment ) : ?>
- <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">
- Comment by <em><?php comment_author_link() ?></em>:
- <?php if ($comment->comment_approved == '0') : ?>
- <em>Your comment is awaiting moderation.</em>
- <?php endif; ?>
- <br />
- <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>
- <?php comment_text() ?>
- </li>
- <?php /* Changes every other comment to a different class */
- if ('alt' == $oddcomment) $oddcomment = '';
- else $oddcomment = 'alt';
- ?>
- <?php endforeach; /* end for each comment */ ?>
- </ol>
- <?php else : // this is displayed if there are no comments so far ?>
- <?php if ('open' == $post->comment_status) : ?>
- <!-- If comments are open, but there are no comments. -->
- <?php else : // comments are closed ?>
- <!-- If comments are closed. -->
- <p class="nocomments">Comments are closed.</p>
- <?php endif; ?>
- <?php endif; ?>
- <?php endif; // 2.6 and older Comment Loop end ?>
- <?php if ('open' == $post->comment_status) : ?>
- <div<?php /*?> id="respond"<?php */?>>
- <h3>Leave a Reply</h3>
- <p id="respond">Feel free to leave a comment. If you want an image to show, make sure you have
- a <a rel="external" href="http://en.gravatar.com" >gravatar</a> set!</p>
- <?php if (function_exists('cancel_comment_reply_link')) /*2.7 comment loop code*/ { ?>
- <div id="cancel-comment-reply">
- <small><?php cancel_comment_reply_link();?></small>
- </div>
- <?php } ?>
- <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
- <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>
- <?php else : ?>
- <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="comment_form">
- <?php if ( $user_ID ) : ?>
- <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 »</a></p>
- <?php else : ?>
- <p><label for="name"><strong>Name:</strong> <?php if ($req) echo "(required)"; ?></label><br />
- <input type="text" name="author" id="name" value="<?php echo $comment_author; ?>" size="50" tabindex="1" /></p>
- <p><label for="email"><strong>Email Address:</strong> <?php if ($req) echo "(required)"; ?></label><br />
- <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="50" tabindex="2" /></p>
- <p><label for="url"><strong>Website:</strong> </label><br />
- <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="50" tabindex="3" /></p>
- <?php endif; ?>
- <p><?php if (function_exists('lmbbox_comment_quicktags_display')) { lmbbox_comment_quicktags_display(); } ?></p>
- <?php comment_id_fields(); ?>
- <!--<p><small><strong>XHTML:</strong> You can use these tags: <?php echo allowed_tags(); ?></small></p>-->
- <p><label for="words"><strong>Speak your mind:</strong> </label><br />
- <textarea name="comment" id="comment" cols="40" rows="10" tabindex="4" style="width:460px;"></textarea></p>
- <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
- <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
- </p>
- <?php do_action('comment_form', $post->ID); ?>
- </form>
- </div>
- </div>
- <?php endif; // If registration required and not logged in ?>
- <?php endif; // if you delete this the sky will fall on your head ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement