Changeset 2040 for trunk/wp-content/themes/default/comments.php
- Timestamp:
- 01/04/2005 05:20:06 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/default/comments.php
r2032 r2040 1 <?php if ( !empty($post->post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?>2 <p><?php _e('Enter your password to view comments.'); ?></p> 3 <?php return; endif; ?> 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 4 5 <h2 id="comments"><?php comments_number(__('No Comments'), __('1 Comment'), __('% Comments')); ?> 6 <?php if ( comments_open() ) : ?> 7 <a href="#postcomment" title="<?php _e("Leave a comment"); ?>">»</a> 8 <?php endif; ?> 9 </h2> 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 9 <p class="nocomments"><?php _e("This post is password protected. Enter the password to view comments."); ?><p> 10 11 <?php 12 return; 13 } 14 } 10 15 11 <?php if ( $comments ) : ?> 12 <ol id="commentlist"> 16 /* This variable is for alternating comment background */ 17 $oddcomment = 'graybox'; 18 ?> 13 19 14 <?php foreach ($comments as $comment) : ?> 15 <li id="comment-<?php comment_ID() ?>"> 16 <?php comment_text() ?> 17 <p><cite><?php comment_type(__('Comment'), __('Trackback'), __('Pingback')); ?> <?php _e('by'); ?> <?php comment_author_link() ?> — <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite> <?php edit_comment_link(__("Edit This"), ' |'); ?></p> 18 </li> 20 <!-- You can start editing here. --> 19 21 20 <?php endforeach; ?> 22 <?php if ($comments) : ?> 23 <h3 id="comments"><?php comments_number('No Responses','One Response','% Responses' );?> to '<?php the_title(); ?>'</h3> 21 24 22 </ol>25 <ol class="commentlist"> 23 26 24 <?php else : // If there are no comments yet ?> 25 <p><?php _e('No comments yet.'); ?></p> 27 <?php foreach ($comments as $comment) : ?> 28 29 <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>"> 30 <cite><?php comment_author_link() ?></cite> Says:<br /> 31 <!--<small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title="<?php comment_date('l, F jS, Y') ?> at <?php comment_time() ?>"><?php /* $entry_datetime = abs(strtotime($post->post_date)); $comment_datetime = abs(strtotime($comment->comment_date)); echo time_since($entry_datetime, $comment_datetime) */ ?></a> after publication. <?php edit_comment_link('e','',''); ?></small>--> 32 <small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('e','',''); ?></small> 33 34 <?php comment_text() ?> 35 36 </li> 37 38 <?php /* Changes every other comment to a different class */ 39 if('graybox' == $oddcomment) {$oddcomment="";} 40 else { $oddcomment = "graybox"; } 41 ?> 42 43 <?php endforeach; /* end for each comment */ ?> 44 45 </ol> 46 47 <?php else : // this is displayed if there are no comments so far ?> 48 49 <?php if ('open' == $post-> comment_status) : ?> 50 <!-- If comments are open, but there are no comments. --> 51 52 <?php else : // comments are closed ?> 53 <!-- If comments are closed. --> 54 <p class="nocomments">Comments are closed.</p> 55 56 <?php endif; ?> 26 57 <?php endif; ?> 27 58 28 <p><?php comments_rss_link(__('<abbr title="Really Simple Syndication">RSS</abbr> feed for comments on this post.')); ?>29 <?php if ( pings_open() ) : ?>30 <a href="<?php trackback_url() ?>" rel="trackback"><?php _e('TrackBack <abbr title="Uniform Resource Identifier">URI</abbr>'); ?></a>31 <?php endif; ?>32 </p>33 59 34 <?php if ( comments_open() ) : ?> 35 <h2 id="postcomment"><?php _e('Leave a comment'); ?></h2> 60 <?php if ('open' == $post-> comment_status) : ?> 36 61 37 <p><?php _e("Line and paragraph breaks automatic, e-mail address never displayed, <acronym title=\"Hypertext Markup Language\">HTML</acronym> allowed:"); ?> <code><?php echo allowed_tags(); ?></code></p> 62 <h3 id="respond">Leave a Reply</h3> 63 <form action="<?php echo get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> 38 64 39 <form action="<?php echo get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> 40 <p> 41 <input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" /> 42 <label for="author"><?php _e('Name'); ?></label> <?php if ($req) _e('(required)'); ?> 43 <input type="hidden" name="comment_post_ID" value="<?php echo $post->ID; ?>" /> 44 <input type="hidden" name="redirect_to" value="<?php echo wp_specialchars($_SERVER['REQUEST_URI']); ?>" /> 45 </p> 65 <p><input type="text" name="author" id="author" class="styled" value="<?php echo $comment_author; ?>" size="22" tabindex="1" /> 66 <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> 67 <label for="author"><small>Name</small></label></p> 46 68 47 <p> 48 <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="28" tabindex="2" /> 49 <label for="email"><?php _e('E-mail'); ?></label> <?php if ($req) _e('(required)'); ?> 50 </p> 69 <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" /> 70 <label for="email"><small>Mail (will not be published)</small></label></p> 51 71 52 <p> 53 <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="28" tabindex="3" /> 54 <label for="url"><?php _e('<acronym title="Uniform Resource Identifier">URI</acronym>'); ?></label> 55 </p> 72 <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /> 73 <label for="url"><small>Website</small></label></p> 56 74 57 <p> 58 <label for="comment"><?php _e('Your Comment'); ?></label> 59 <br /> 60 <textarea name="comment" id="comment" cols="60" rows="4" tabindex="4"></textarea> 61 </p> 75 <!--<p><small><strong>XHTML:</strong> You can use these tags: <?php echo allowed_tags(); ?></small></p>--> 62 76 63 <p> 64 <input name="submit" id="submit" type="submit" tabindex="5" value="<?php _e('Say It!'); ?>" /> 65 </p> 66 <?php do_action('comment_form', $post->ID); ?> 77 <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p> 78 79 <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /></p> 80 81 67 82 </form> 68 83 69 <?php else : // Comments are closed ?> 70 <p><?php _e('Sorry, the comment form is closed at this time.'); ?></p> 71 <?php endif; ?> 84 <?php endif; // if you delete this the sky will fall on your head ?>
Note: See TracChangeset
for help on using the changeset viewer.