1
|
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 |
} |
|
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 |
?><p class="nocomments">This post is password protected. Enter the password to view comments.<p><?php |
|
8 |
return; |
|
9 |
} |
|
10 |
} |
|
11 |
?> |
|
12 |
|
|
13 |
<?php /* COMMENTS */ ?> |
|
14 |
<?php if ('open' == $post->comment_status || $comments) : ?> |
|
15 |
<div id="comments"> |
|
16 |
<?php if ($comments) : ?> |
|
17 |
<h2><a href="#respond"><?php comments_number('No Comments', '1 Comment', '% Comments' );?></a></h2> |
|
18 |
<?php $oddcomment = ''; ?> |
|
19 |
|
|
20 |
<?php foreach ($comments as $comment) : ?> |
|
21 |
|
|
22 |
<?php /* Check if author of blog */ |
|
23 |
if (get_comment_author_email() == get_the_author_email()) { |
|
24 |
$oddcomment .= ' author'; |
|
25 |
} ?> |
|
26 |
|
|
27 |
<div class="comment-wrap<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>"> |
|
28 |
<div class="comment-left"> |
|
29 |
<a href="<?php comment_author_url(); ?>" title="Visit <?php comment_author(); ?>'s website" rel="external nofollow"> |
|
30 |
<?php $size = "56"; $email = get_comment_author_email(); $default = get_bloginfo('template_url').'/images/gravatar.jpg'; ?> |
|
31 |
<?php if (function_exists('get_avatar')) { echo get_avatar( $email, $size, $default ); } else { ?> |
|
32 |
<img src="http://www.gravatar.com/avatar.php?gravatar_id=<?=md5($email)?>&default=<?=$default?>&size=<?=$size?>" height="<?=$size?>" width="<?=$size?>" class="avatar" /> |
|
33 |
<?php } ?> |
|
34 |
</a> |
|
35 |
</div> |
|
36 |
<div class="comment-right"> |
|
37 |
<cite><b><?php comment_author_link() ?></b> |
|
38 |
<small><a href="#comment-<?php comment_ID() ?>" title="Permanent link to this comment"><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> |
|
39 |
<?php edit_comment_link('Edit',' · ',''); ?></small></cite> |
|
40 |
<?php if ($comment->comment_approved == '0') : ?> |
|
41 |
<p style="color:#C64021;"><b><?php _e('This comment is awaiting moderation.'); ?></b></p> |
|
42 |
<?php else : ?> |
|
43 |
<?php comment_text() ?> |
|
44 |
<?php endif; ?> |
|
45 |
</div> |
|
46 |
</div> |
|
47 |
|
|
48 |
<?php /* Changes every other comment to a different class */ |
|
49 |
if ($oddcomment != '') $oddcomment = ''; |
|
50 |
else $oddcomment = ' alt'; ?> |
|
51 |
|
|
52 |
<?php endforeach; /* end for each comment */ ?> |
|
53 |
|
|
54 |
<?php else : /* this is displayed if there are no comments so far */ ?> |
|
55 |
<?php if ('open' == $post->comment_status) : ?> |
|
56 |
<!-- If no comments on this post |
|
57 |
<h3>There are no comments on this post</h3> --> |
|
58 |
<?php else : // comments are closed ?> |
|
59 |
<!-- If comments are closed |
|
60 |
<h3>Comments are closed.</h3> --> |
|
61 |
<?php endif; ?> |
|
62 |
<?php endif; ?> |
|
63 |
|
|
64 |
<?php /* PINGBACKS AND TRACKBACKS */ ?> |
|
65 |
<?php global $trackbacks; ?> |
|
66 |
<?php if ($trackbacks) : ?> |
|
67 |
<?php $comments = $trackbacks; ?> |
|
68 |
<h3 id="trackbacks"><?php echo sizeof($trackbacks); ?> <?php _e('Trackbacks and Pingbacks'); ?></h3> |
|
69 |
<ul> |
|
70 |
<?php foreach ($comments as $comment) : ?> |
|
71 |
<li> |
|
72 |
<cite><b><?php comment_author_link() ?></b> · |
|
73 |
<small><a href="#comment-<?php comment_ID() ?>" title="Permanent link to this comment"> |
|
74 |
<?php comment_date('F jS, Y') ?></a> |
|
75 |
<?php edit_comment_link('Edit',' · ',''); ?></small></cite> |
|
76 |
<?php comment_text() ?> |
|
77 |
</li> |
|
78 |
<?php endforeach; ?> |
|
79 |
</ul> |
|
80 |
<?php endif; /* end if there are trackbacks */ ?> |
|
81 |
|
|
82 |
<?php /* COMMENT FORM */ ?> |
|
83 |
<?php if ('open' == $post->comment_status) : ?> |
|
84 |
<h3 id="respond"><?php _e('Write a Comment'); ?></h3> |
|
85 |
<?php if ( get_option('comment_registration') && !$user_ID ) : ?> |
|
86 |
<p><?php _e('You must be'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>"><?php _e('logged in'); ?></a> <?php _e('to post a comment.'); ?></p> |
|
87 |
<?php else : ?> |
|
88 |
<form id="comment_form" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post"> |
|
89 |
<fieldset> |
|
90 |
<?php if ( $user_ID ) : ?> |
|
91 |
<p> |
|
92 |
<?php _e('Logged in as'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a> · |
|
93 |
<a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account"><?php _e('Logout'); ?></a> |
|
94 |
</p> |
|
95 |
<div class="clear"></div> |
|
96 |
<?php else : ?> |
|
97 |
|
|
98 |
<label for="author"><?php if ($req) echo "* "; ?><?php _e('Your Name'); ?>:</label> |
|
99 |
<input class="text" type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" /> |
|
100 |
|
|
101 |
<label for="email"><?php if ($req) echo "* "; ?><?php _e('Email'); ?>:</label> |
|
102 |
<input class="text" type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" /> |
|
103 |
|
|
104 |
<label for="url"><?php _e('Website'); ?>:</label> |
|
105 |
<input class="text" type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /> |
|
106 |
|
|
107 |
<?php endif; ?> |
|
108 |
|
|
109 |
<!--<p>You can use these tags: <?php echo allowed_tags(); ?></p>--> |
|
110 |
<label for="comment"><?php _e('Message'); ?>:</label> |
|
111 |
<textarea class="text" name="comment" id="comment" cols="50" rows="5" tabindex="4"></textarea> |
|
112 |
|
|
113 |
<p> |
|
114 |
<input class="button" name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /> |
|
115 |
</p> |
|
116 |
<div class="clear"></div> |
|
117 |
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> |
|
118 |
<?php do_action('comment_form', $post->ID); ?> |
|
119 |
</fieldset> |
|
120 |
</form> |
|
121 |
<?php endif; // end if registration required and not logged in ?> |
|
122 |
|
|
123 |
<?php endif; // end if there are comments ?> |
|
124 |
</div> |
|
125 |
<?php endif; // end if comments are open for this post ?> |