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

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 8.9 KB
Line 
1<?php // Do not delete these lines
2if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
3 die (__('Please do not load this page directly. Thanks!','atahualpa'));
4if ( post_password_required() ) {
5 _e('This post is password protected. Enter the password to view comments.','atahualpa');
6 return;
7}
8
9 /* This variable is for alternating comment background */
10 #$oddcomment = 'class="alt" ';
11
12global $options;
13foreach ($options as $value) {
14if (get_option( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_option( $value['id'] ); } }
15?>
16<!-- You can start editing below: -->
17
18<?php // If there are any comments
19if ( have_comments() ) : ?>
20
21 <h3 id="comments"><?php // Comment Area Title
22 comments_number(__('No comments yet to ', 'atahualpa'), __('1 comment to ', 'atahualpa'), __('% comments to ', 'atahualpa')); echo get_the_title();
23 ?>
24 </h3>
25
26
27 <?php
28?>
29
30
31 <?php // Next/Previous Comments Links
32 // in next_comments_link "next" means newer
33 // if navigation above comments is set
34 if ( strpos($bfa_ata_location_comments_next_prev,'Above')!==false ) {
35 // if any navigation links exist, paginated or next/previous:
36 if ( get_comment_pages_count() > 1 ) {
37 // Overall navigation container
38 echo '<div class="navigation-comments-above">';
39 // paginated links
40 if ($bfa_ata_next_prev_comments_pagination == "Yes") {
41 paginate_comments_links(array(
42 'prev_text' => bfa_escape($bfa_ata_comments_next_prev_older),
43 'next_text' => bfa_escape($bfa_ata_comments_next_prev_newer),
44 ));
45 // next/previous links
46 } else {
47 echo '<div class="older">';
48 $bfa_ata_next_prev_orientation == 'Older Left, Newer Right' ?
49 previous_comments_link(bfa_escape($bfa_ata_comments_next_prev_older)) :
50 next_comments_link(bfa_escape($bfa_ata_comments_next_prev_newer));
51 echo ' &nbsp;</div><div class="newer">&nbsp; ';
52 $bfa_ata_next_prev_orientation == 'Older Left, Newer Right' ?
53 next_comments_link(bfa_escape($bfa_ata_comments_next_prev_newer)) :
54 previous_comments_link(bfa_escape($bfa_ata_comments_next_prev_older));
55 echo '</div>
56 <div style="clear:both"></div>';
57 }
58 echo '</div>';
59 }
60 } ?>
61
62 <!-- Comment List -->
63 <ul class="commentlist">
64
65 <!-- Do this for every comment -->
66 <?php if ($bfa_ata_separate_trackbacks == "Yes") {
67 wp_list_comments(array(
68 'avatar_size'=>$bfa_ata_avatar_size,
69 'reply_text'=>__(' &middot; Reply','atahualpa'),
70 'login_text'=>__('Log in to Reply','atahualpa'),
71 'walker' => new Walker_Comment2,
72 'max_depth' => '',
73 'style' => 'ul',
74 'callback' => null,
75 'end-callback' => null,
76 'type' => 'comment',
77 'page' => '',
78 'per_page' => '',
79 'reverse_top_level' => null,
80 'reverse_children' => ''
81 ));
82 wp_list_comments(array(
83 'avatar_size'=>$bfa_ata_avatar_size,
84 'reply_text'=>__(' &middot; Reply','atahualpa'),
85 'login_text'=>__('Log in to Reply','atahualpa'),
86 'walker' => new Walker_Comment2,
87 'max_depth' => '',
88 'style' => 'ul',
89 'callback' => null,
90 'end-callback' => null,
91 'type' => 'pings',
92 'page' => '',
93 'per_page' => '',
94 'reverse_top_level' => null,
95 'reverse_children' => ''
96 ));
97 } else {
98 wp_list_comments(array(
99 'avatar_size'=>$bfa_ata_avatar_size,
100 'reply_text'=>__(' &middot; Reply','atahualpa'),
101 'login_text'=>__('Log in to Reply','atahualpa'),
102 'walker' => new Walker_Comment2,
103 'max_depth' => '',
104 'style' => 'ul',
105 'callback' => null,
106 'end-callback' => null,
107 'type' => 'all',
108 'page' => '',
109 'per_page' => '',
110 'reverse_top_level' => null,
111 'reverse_children' => ''
112 ));
113 }
114 ?>
115
116 </ul>
117 <!-- / Comment List -->
118
119
120 <?php // Next/Previous Comments Links
121 // in next_comments_link "next" means newer
122 // if navigation below comments is set
123 if ( strpos($bfa_ata_location_comments_next_prev,'Below')!==false ) {
124 // if any navigation links exist, paginated or next/previous:
125 if ( get_comment_pages_count() > 1 ) {
126 // Overall navigation container
127 echo '<div class="navigation-comments-below">';
128 // paginated links
129 if ($bfa_ata_next_prev_comments_pagination == "Yes") {
130 paginate_comments_links(array(
131 'prev_text' => bfa_escape($bfa_ata_comments_next_prev_older),
132 'next_text' => bfa_escape($bfa_ata_comments_next_prev_newer),
133 ));
134 // next/previous links
135 } else {
136 echo '<div class="older">';
137 $bfa_ata_next_prev_orientation == 'Older Left, Newer Right' ?
138 previous_comments_link(bfa_escape($bfa_ata_comments_next_prev_older)) :
139 next_comments_link(bfa_escape($bfa_ata_comments_next_prev_newer));
140 echo ' &nbsp;</div><div class="newer">&nbsp; ';
141 $bfa_ata_next_prev_orientation == 'Older Left, Newer Right' ?
142 next_comments_link(bfa_escape($bfa_ata_comments_next_prev_newer)) :
143 previous_comments_link(bfa_escape($bfa_ata_comments_next_prev_older));
144 echo '</div>
145 <div style="clear:both"></div>';
146 }
147 echo '</div>';
148 }
149 } ?>
150
151
152<?php
153// END of "If there ARE any comments"
154else :
155// START of "If there are NO comments"
156?>
157
158 <?php
159 // If comments are open, but there are no comments:
160 if ('open' == $post->comment_status) :
161 ?>
162 <!-- .... -->
163
164 <?php
165 // END of "If comments are open, but there are no comments"
166 else :
167 // If comments are closed:
168 ?>
169 <p><?php _e('Comments are closed.','atahualpa'); ?></p>
170 <?php endif; ?>
171
172<?php
173// END of "If there are NO comments"
174endif;
175?>
176
177<?php // If comments are open
178if ('open' == $post->comment_status) : ?>
179
180
181 <?php // If Login is required and User is not logged in
182 if ( get_option('comment_registration') && !$user_ID ) : ?>
183 <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>
184
185 <?php // If Login is not required, or User is logged in
186 else : ?>
187
188 <!-- Comment Form -->
189 <div id="respond">
190
191 <h3 class="reply"><?php comment_form_title( $noreplytext = __('Leave a Reply','atahualpa'), $replytext = __('Leave a Reply to %s','atahualpa'), $linktoparent = TRUE ); ?></h3>
192
193 <div id="cancel-comment-reply">
194 <?php cancel_comment_reply_link(__('Cancel','atahualpa')) ?>
195 </div>
196
197 <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
198
199 <?php // If User is logged in
200 if ( $user_ID ) : ?>
201 <p>
202 <?php printf(__('Logged in as %s.', 'atahualpa'), '<a href="' . get_option('siteurl') . '/wp-admin/profile.php">' . $user_identity . '</a>')?>
203 <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php _e('Log out of this account','atahualpa'); ?>"><?php _e('Logout &raquo;','atahualpa'); ?></a>
204 </p>
205
206 <?php // If User is not logged in: Display the form fields "Name", "Email", "URL"
207 else : ?>
208 <p>
209 <input class="text author" type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="30" tabindex="1" />&nbsp;
210 <label for="<?php _e('author','atahualpa'); ?>"> <strong><?php _e('Name ','atahualpa'); echo "</strong>"; if ($req) _e('(required)','atahualpa'); ?></label>
211 </p>
212 <p>
213 <input class="text email" type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="30" tabindex="2" />&nbsp;
214 <label for="<?php _e('email','atahualpa'); ?>"> <strong><?php _e('Mail</strong> (will not be published) ','atahualpa'); if ($req) _e('(required)','atahualpa'); ?></label>
215 </p>
216 <p>
217 <input class="text url" type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="30" tabindex="3" />&nbsp;
218 <label for="<?php _e('url','atahualpa'); ?>"> <?php _e('Website','atahualpa'); ?></label>
219 </p>
220 <?php endif; ?>
221
222 <!-- Display Quicktags or allowed XHTML Tags -->
223 <?php if (function_exists('lmbbox_comment_quicktags_display')) { echo "<p>"; lmbbox_comment_quicktags_display(); echo "</p>"; }
224 else { if ($bfa_ata_show_xhtml_tags == "Yes") { ?>
225 <p class="thesetags clearfix"><?php printf(__('You can use %1$sthese HTML tags</a>','atahualpa'), '<a class="xhtmltags" href="#" onclick="return false;">'); ?></p>
226 <div class="xhtml-tags"><p><code><?php echo allowed_tags(); ?></code></p></div>
227 <?php } } ?>
228
229 <!-- Comment Textarea -->
230 <p><textarea name="comment" id="comment" rows="10" cols="10" tabindex="4"></textarea></p>
231 <?php do_action('comment_form', $post->ID); ?>
232
233 <!-- Submit -->
234 <p><input name="submit" type="submit" class="button" id="submit" tabindex="5" value="<?php _e('Submit Comment','atahualpa'); ?>" />
235 <?php comment_id_fields(); ?>
236 </p>
237
238 </form>
239 </div><!-- / respond -->
240 <!-- / Comment Form -->
241
242 <?php endif; ?>
243 <!-- / If Login is not required, or User is logged in -->
244
245<?php endif; ?>
246<!-- If comments are open -->
Note: See TracBrowser for help on using the repository browser.