136
|
1 |
<?php // Do not delete these lines |
|
2 |
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) |
|
3 |
die ('Please do not load this page directly. Thanks!'); |
|
4 |
if (!empty($post->post_password)) { // if there's a password |
|
5 |
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie |
|
6 |
?> |
|
7 |
<p class="nocomments">This post is password protected. Enter the password to view comments.</p> |
|
8 |
<?php |
|
9 |
return; |
|
10 |
} |
|
11 |
} |
|
12 |
/* This variable is for alternating comment background */ |
|
13 |
$oddcomment = 'class="comments-alt" '; |
|
14 |
?> |
|
15 |
<!-- You can start editing here. --> |
|
16 |
<?php if ($comments) : ?> |
|
17 |
<h2 id="comments"><?php comments_number('No Responses', 'Responses', 'Responses' );?></h2> |
|
18 |
<div class="small"> |
|
19 |
<span class="feedlink"><?php comments_rss_link('Feed'); ?></span> |
|
20 |
<?php if ('open' == $post-> ping_status) { ?><span class="trackbacklink"><a href="<?php trackback_url() ?>" title="Copy this URI to trackback this entry.">Trackback Address</a></span><?php } ?> |
|
21 |
</div> |
|
22 |
<ol class="commentlist"> |
|
23 |
<?php foreach ($comments as $comment) : ?> |
|
24 |
<li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>"> |
|
25 |
<cite><?php comment_author_link() ?></cite> says: |
|
26 |
<?php if ($comment->comment_approved == '0') : ?> |
|
27 |
<em>Your comment is awaiting moderation.</em> |
|
28 |
<?php endif; ?> |
|
29 |
<br /> |
|
30 |
<p class="small"><?php comment_date('F jS, Y') ?> at <?php comment_time() ?> (<a href="#comment-<?php comment_ID() ?>" title="">#</a>) <?php edit_comment_link('edit',' ',''); ?></p> |
|
31 |
<?php comment_text() ?> |
|
32 |
</li> |
|
33 |
<?php |
|
34 |
/* Changes every other comment to a different class */ |
|
35 |
$oddcomment = ( empty( $oddcomment ) ) ? 'class="comments-alt" ' : ''; |
|
36 |
?> |
|
37 |
<?php endforeach; /* end for each comment */ ?> |
|
38 |
</ol> |
|
39 |
<?php else : // this is displayed if there are no comments so far ?> |
|
40 |
<?php if ('open' == $post->comment_status) : ?> |
|
41 |
<!-- If comments are open, but there are no comments. --> |
|
42 |
<?php else : // comments are closed ?> |
|
43 |
<!-- If comments are closed. --> |
|
44 |
|
|
45 |
<?php endif; ?> |
|
46 |
<?php endif; ?> |
|
47 |
<?php if ('open' == $post->comment_status) : ?> |
|
48 |
<h2 id="respond">Leave a Response</h2> |
|
49 |
<?php if ( get_option('comment_registration') && !$user_ID ) : ?> |
|
50 |
<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> |
|
51 |
<?php else : ?> |
|
52 |
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> |
|
53 |
<?php if ( $user_ID ) : ?> |
|
54 |
<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> |
|
55 |
<?php else : ?> |
|
56 |
<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" /> |
|
57 |
<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p> |
|
58 |
<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" /> |
|
59 |
<label for="email"><small>Email (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p> |
|
60 |
<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /> |
|
61 |
<label for="url"><small>Website</small></label></p> |
|
62 |
<?php endif; ?> |
|
63 |
<!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>--> |
|
64 |
<p><textarea name="comment" id="comment" cols="10" rows="20" tabindex="4"></textarea></p> |
|
65 |
<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /> |
|
66 |
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> |
|
67 |
</p> |
|
68 |
<?php do_action('comment_form', $post->ID); ?> |
|
69 |
</form> |
|
70 |
<?php endif; // If registration required and not logged in ?> |
|
71 |
<?php endif; // if you delete this the sky will fall on your head ?> |