[1] | 1 | <?php // Do not delete these lines
|
---|
| 2 | if (isset($_SERVER['SCRIPT_FILENAME']) && '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 |
|
---|
[64] | 9 | <p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.', 'xpress'); ?></p>
|
---|
[1] | 10 |
|
---|
| 11 | <?php
|
---|
| 12 | return;
|
---|
| 13 | }
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | /* This variable is for alternating comment background */
|
---|
| 17 | $oddcomment = 'class="alt" ';
|
---|
| 18 | ?>
|
---|
| 19 |
|
---|
| 20 | <!-- You can start editing here. -->
|
---|
| 21 |
|
---|
| 22 | <?php if ($comments) : ?>
|
---|
[64] | 23 | <h3 id="xpress_comments"><?php comments_number(__('No Responses', 'xpress'), __('One Response', 'xpress'), __('% Responses', 'xpress'));?> <?php printf(__('to “%s”', 'xpress'), the_title('', '', false)); ?></h3>
|
---|
[1] | 24 | <?php if (function_exists('wp_list_comments')) : ?>
|
---|
| 25 | <ol class="xpress_commentlist">
|
---|
| 26 | <?php wp_list_comments();?>
|
---|
| 27 | <div class="navigation">
|
---|
| 28 | <div class="alignleft"><?php previous_comments_link() ?></div>
|
---|
| 29 | <div class="alignright"><?php next_comments_link() ?></div>
|
---|
| 30 | </div>
|
---|
| 31 | </ol>
|
---|
| 32 | <?php else : ?>
|
---|
| 33 | <ol class="xpress_commentlist">
|
---|
| 34 |
|
---|
| 35 | <?php foreach ($comments as $comment) : ?>
|
---|
| 36 |
|
---|
| 37 | <li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
|
---|
| 38 | <?php if(function_exists('get_avatar')) : ?><?php echo get_avatar( $comment, 32 ); ?><?php endif; ?>
|
---|
[64] | 39 | <?php printf(__('<cite>%s</cite> Says:', 'xpress'), get_comment_author_link()); ?>
|
---|
[1] | 40 | <?php if ($comment->comment_approved == '0') : ?>
|
---|
[64] | 41 | <em><?php _e('Your comment is awaiting moderation.', 'xpress'); ?></em>
|
---|
[1] | 42 | <?php endif; ?>
|
---|
| 43 | <br />
|
---|
| 44 |
|
---|
[64] | 45 | <small class="xpress_commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php printf(__('%1$s at %2$s', 'xpress'), get_comment_date(__('F jS, Y', 'xpress')), get_comment_time()); ?></a> <?php edit_comment_link(__('edit', 'xpress'),' ',''); ?></small>
|
---|
[1] | 46 |
|
---|
| 47 | <?php comment_text() ?>
|
---|
| 48 |
|
---|
| 49 | </li>
|
---|
| 50 |
|
---|
| 51 | <?php
|
---|
| 52 | /* Changes every other comment to a different class */
|
---|
| 53 | $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
|
---|
| 54 | ?>
|
---|
| 55 |
|
---|
| 56 | <?php endforeach; /* end for each comment */ ?>
|
---|
| 57 |
|
---|
| 58 | </ol>
|
---|
| 59 | <?php endif; ?>
|
---|
| 60 | <?php else : // this is displayed if there are no comments so far ?>
|
---|
| 61 |
|
---|
| 62 | <?php if ('open' == $post->comment_status) : ?>
|
---|
| 63 | <!-- If comments are open, but there are no comments. -->
|
---|
| 64 |
|
---|
| 65 | <?php else : // comments are closed ?>
|
---|
| 66 | <!-- If comments are closed. -->
|
---|
[64] | 67 | <p class="nocomments"><?php _e('Comments are closed.', 'xpress'); ?></p>
|
---|
[1] | 68 |
|
---|
| 69 | <?php endif; ?>
|
---|
| 70 | <?php endif; ?>
|
---|
| 71 |
|
---|
| 72 |
|
---|
| 73 | <?php if ('open' == $post->comment_status) : ?>
|
---|
| 74 | <div id="respond">
|
---|
[64] | 75 | <h3><?php _e('Leave a Reply', 'xpress'); ?></h3>
|
---|
[1] | 76 | <?php if ( function_exists('cancel_comment_reply_link') ): ?>
|
---|
| 77 | <div class="cancel-comment-reply">
|
---|
| 78 | <small><?php cancel_comment_reply_link(); ?></small>
|
---|
| 79 | </div>
|
---|
| 80 | <?php endif; ?>
|
---|
| 81 |
|
---|
| 82 | <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
|
---|
[64] | 83 | <p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.', 'xpress'), get_option('siteurl') . '/wp-login.php?redirect_to=' . urlencode(get_permalink())); ?></p>
|
---|
[1] | 84 | <?php else : ?>
|
---|
| 85 |
|
---|
| 86 | <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="xpress_commentform">
|
---|
| 87 |
|
---|
| 88 | <?php if ( $user_ID ) : ?>
|
---|
| 89 |
|
---|
[123] | 90 | <p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>.', 'xpress'), get_option('siteurl') . '/wp-admin/profile.php', $user_identity); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php _e('Log out of this account', 'xpress'); ?>"><?php _e('Log out »', 'xpress'); ?></a></p>
|
---|
[1] | 91 |
|
---|
| 92 | <?php else : ?>
|
---|
| 93 |
|
---|
| 94 | <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
|
---|
[64] | 95 | <label for="author"><small><?php _e('Name', 'xpress'); ?> <?php if ($req) _e("(required)", "xpress"); ?></small></label></p>
|
---|
[1] | 96 |
|
---|
| 97 | <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
|
---|
[64] | 98 | <label for="email"><small><?php _e('Mail (will not be published)', 'xpress'); ?> <?php if ($req) _e("(required)", "xpress"); ?></small></label></p>
|
---|
[1] | 99 |
|
---|
| 100 | <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
|
---|
[64] | 101 | <label for="url"><small><?php _e('Website', 'xpress'); ?></small></label></p>
|
---|
[1] | 102 |
|
---|
| 103 | <?php endif; ?>
|
---|
| 104 |
|
---|
[64] | 105 | <!--<p><small><?php printf(__('<strong>XHTML:</strong> You can use these tags: <code>%s</code>', 'xpress'), allowed_tags()); ?></small></p>-->
|
---|
[1] | 106 |
|
---|
| 107 | <p><textarea name="comment" id="xpress_comment" cols="100%" rows="10" tabindex="4"></textarea></p>
|
---|
| 108 |
|
---|
[64] | 109 | <p><input name="submit" type="submit" id="xpress_submit" tabindex="5" value="<?php _e('Submit Comment', 'xpress'); ?>" />
|
---|
[1] | 110 | <?php if (function_exists('comment_id_fields')) : ?>
|
---|
| 111 | <?php comment_id_fields(); //@since 2.7.0 ?>
|
---|
| 112 | <?php else : ?>
|
---|
| 113 | <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
|
---|
| 114 | <?php endif; ?>
|
---|
| 115 | </p>
|
---|
| 116 | <?php do_action('comment_form', $post->ID); ?>
|
---|
| 117 |
|
---|
| 118 | </form>
|
---|
| 119 |
|
---|
| 120 | <?php endif; // If registration required and not logged in ?>
|
---|
| 121 | </div>
|
---|
| 122 | <?php endif; // if you delete this the sky will fall on your head ?>
|
---|