source: trunk/www.guidonia.net/wp/wp-content/themes/atahualpa/legacy.comments.php@ 44

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 8.1 KB
Line 
1<?php // Do not delete these lines
2 if ('legacy.comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
3 die (__('Please do not load this page directly. Thanks!','atahualpa'));
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><?php _e('This post is password protected. Enter the password to view comments.','atahualpa'); ?></p>
8 <?php
9 return;
10 }
11 }
12
13 /* This variable is for alternating comment background */
14 $oddcomment = 'class="alt clearfix" ';
15
16global $options;
17foreach ($options as $value) {
18if (get_option( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_option( $value['id'] ); } }
19?>
20<!-- You can start editing below: -->
21
22<?php // If there are any comments
23if ($comments) : ?>
24
25 <h3 id="comments"><?php // Comment Area Title
26 comments_number(__('No comments yet to ', 'atahualpa'), __('1 comment to ', 'atahualpa'), __('% comments to ', 'atahualpa')); echo get_the_title();
27 ?>
28 </h3>
29
30 <!-- Comment List -->
31 <ol class="commentlist">
32
33
34 <?php // Traditional or reverse display
35 if ($bfa_ata_comment_display_order == "Oldest on top") {
36 $comment_number = 1; $all_comments = $comments;
37 } else {
38 $post_data = get_post($post->ID, ARRAY_A);
39 $comment_number = $post_data['comment_count'];
40 $all_comments = array_reverse($comments);
41 }
42
43 // Do this for every comment -->
44 foreach ($all_comments as $comment) :
45 if ( ($bfa_ata_separate_trackbacks == "Yes" AND get_comment_type() == 'comment') OR $bfa_ata_separate_trackbacks == "No" ) {
46 ?>
47
48 <li <?php if ( $bfa_ata_author_highlight == "Yes" AND $comment->comment_author_email == get_the_author_email() ) { echo 'class="authorcomment clearfix" '; } else { echo $oddcomment; } ?>id="comment-<?php comment_ID() ?>">
49
50 <?php // GRAVATAR
51 if (get_comment_type() == 'comment') {
52 if ($bfa_ata_avatar_size != 0 AND $bfa_ata_avatar_size != "") {
53 if (function_exists('get_avatar')) {
54 echo get_avatar($comment -> comment_author_email, $size=$bfa_ata_avatar_size);}
55 # if this WP version has no gravatars, use the theme's custom gravatar function:
56 else { if(!empty($comment -> comment_author_email)) {
57 $md5 = md5($comment -> comment_author_email);
58 $default = urlencode(get_bloginfo('template_directory') . '/images/no-gravatar.gif');
59 echo '<img class="avatar" src="http://www.gravatar.com/avatar.php?gravatar_id='.$md5.'&size='.$bfa_ata_avatar_size.'&default='.$default.' alt="'. __('Gravatar','atahualpa') .'" />';
60 }
61 }
62 }
63 }
64 ?>
65
66 <div class="comment-number"><a href="#comment-<?php comment_ID() ?>" title=""><?php echo $comment_number; ?></a></div>
67
68 <span class="authorname"><?php // Comment Author
69 comment_author_link() ?></span>
70
71 <?php // Awaiting Moderation Text
72 if ($comment->comment_approved == '0') :
73 _e('Your comment is awaiting moderation.','atahualpa');
74 endif; ?>
75
76 <br />
77
78 <span class="commentdate">
79 <?php // Comment Date and Time
80 printf(__('%1$s at %2$s'), get_comment_date(__('F jS, Y','atahualpa')), get_comment_time()) ?>
81 </span>
82
83 <?php // Comment Text
84 comment_text() ?>
85
86 <?php // Edit Comment Link
87 edit_comment_link(__('Edit','atahualpa'),'<span class="editcomment">','</span>'); ?>
88
89
90 </li>
91
92 <?php $oddcomment = ( $oddcomment == 'class="clearfix" ' ) ? 'class="alt clearfix" ' : 'class="clearfix" ';
93 if ($bfa_ata_comment_display_order == "Oldest on top") {
94 $comment_number ++;
95 } else {
96 $comment_number --;
97 }
98
99 }
100 endforeach;
101 // END of "Do this for every comment "
102 ?>
103
104 <!-- Do this for every trackback / pingpack -->
105 <?php
106 if ($bfa_ata_separate_trackbacks == "Yes") {
107 foreach ($all_comments as $comment) :
108 if ( get_comment_type() != 'comment') {
109 ?>
110
111 <li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
112
113 <div class="comment-number"><a href="#comment-<?php comment_ID() ?>" title=""><?php echo $comment_number; ?></a></div>
114
115 <?php // Comment Author
116 comment_author_link() ?>:
117
118 <br />
119
120 <?php // Comment Date and Time
121 printf(__('%1$s at %2$s'), get_comment_date(__('F jS, Y','atahualpa')), get_comment_time()) ?>
122
123 <?php // Edit Comment Link
124 edit_comment_link(__('Edit','atahualpa'),'&nbsp;&nbsp;',''); ?>
125
126 <?php // Comment Text
127 comment_text() ?>
128
129 </li>
130
131 <?php $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
132 if ($bfa_ata_comment_display_order == "Oldest on top") {
133 $comment_number ++;
134 } else {
135 $comment_number --;
136 }
137
138 }
139 endforeach;
140 }
141 // END of "Do this for every trackback / pingback "
142 ?>
143
144 </ol>
145 <!-- / Comment List -->
146
147<?php
148// END of "If there ARE any comments"
149else :
150// START of "If there are NO comments"
151?>
152
153 <?php
154 // If comments are open, but there are no comments:
155 if ('open' == $post->comment_status) :
156 ?>
157 <!-- .... -->
158
159 <?php
160 // END of "If comments are open, but there are no comments"
161 else :
162 // If comments are closed:
163 ?>
164 <p><?php _e('Comments are closed.','atahualpa'); ?></p>
165 <?php endif; ?>
166
167<?php
168// END of "If there are NO comments"
169endif;
170?>
171
172<?php // If comments are open
173if ('open' == $post->comment_status) : ?>
174
175 <h3 class="reply"><?php _e('Leave a Reply','atahualpa'); ?></h3>
176
177 <?php // If Login is required and User is not logged in
178 if ( get_option('comment_registration') && !$user_ID ) : ?>
179 <p><?php printf(__('You must be %slogged in</a> to post a comment.', 'atahualpa'), '<a href="' . get_option('siteurl') . '/wp-login.php?redirect_to=' . urlencode(get_permalink()) . '">')?></p>
180
181 <?php // If Login is not required, or User is logged in
182 else : ?>
183
184 <!-- Comment Form -->
185 <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
186
187 <?php // If User is logged in
188 if ( $user_ID ) : ?>
189 <p>
190 <?php printf(__('Logged in as %s.', 'atahualpa'), '<a href="' . get_option('siteurl') . '/wp-admin/profile.php">' . $user_identity . '</a>')?>
191 <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account','atahualpa'); ?>"><?php _e('Logout &raquo;','atahualpa'); ?></a>
192 </p>
193
194 <?php // If User is not logged in: Display the form fields "Name", "Email", "URL"
195 else : ?>
196 <p>
197 <input class="text author" type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="30" tabindex="1" />
198 <label for="<?php _e('author','atahualpa'); ?>"><?php _e('Name ','atahualpa'); if ($req) _e('(required)','atahualpa'); ?></label>
199 </p>
200 <p>
201 <input class="text email" type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="30" tabindex="2" />
202 <label for="<?php _e('email','atahualpa'); ?>"><?php _e('Mail (will not be published) ','atahualpa'); if ($req) _e('(required)','atahualpa'); ?></label>
203 </p>
204 <p>
205 <input class="text url" type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="30" tabindex="3" />
206 <label for="<?php _e('url','atahualpa'); ?>"><?php _e('Website','atahualpa'); ?></label>
207 </p>
208 <?php endif; ?>
209
210 <!-- Display Quicktags or allowed XHTML Tags -->
211 <?php if (function_exists('lmbbox_comment_quicktags_display')) { echo "<p>"; lmbbox_comment_quicktags_display(); echo "</p>"; }
212 else { if ($bfa_ata_show_xhtml_tags == "Yes") { ?>
213 <p class="thesetags clearfix"><?php printf(__('You can use %1$sthese HTML tags</a>','atahualpa'), '<a class="xhtmltags" href="#" onclick="return false;">'); ?></p>
214 <div class="xhtml-tags"><p><code><?php echo allowed_tags(); ?></code></p></div>
215 <?php } } ?>
216
217 <!-- Comment Textarea -->
218 <p><textarea name="comment" id="comment" rows="10" cols="10" tabindex="4"></textarea></p>
219 <?php do_action('comment_form', $post->ID); ?>
220
221 <!-- Submit -->
222 <p><input name="submit" type="submit" class="button" id="submit" tabindex="5" value="<?php _e('Submit Comment','atahualpa'); ?>" />
223 <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
224 </p>
225
226 </form>
227 </div><!-- / respond -->
228 <!-- / Comment Form -->
229
230 <?php endif; ?>
231 <!-- / If Login is not required, or User is logged in -->
232
233<?php endif; ?>
234<!-- If comments are open -->
Note: See TracBrowser for help on using the repository browser.