Changeset 1400
- Timestamp:
- 06/10/2004 08:40:58 AM (21 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-comments.php
r1398 r1400 1 <?php // Do not delete these lines 2 if ('wp-comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) 3 die ('Please do not load this page directly. Thanks!'); 4 $req = get_settings('require_name_email'); 5 if (($withcomments) or ($single)) { 1 <?php 6 2 7 if (!empty($post->post_password)) { // if there's a password 8 if ($_COOKIE['wp-postpass_'.$cookiehash] != $post->post_password) { // and it doesn't match the cookie 3 if ('wp-comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) 4 die ('Please do not load this page directly. Thanks!'); 5 6 if ( !empty($post->post_password) && $_COOKIE['wp-postpass_'.$cookiehash] != $post->post_password) : 9 7 ?> 10 <p><?php _e( "Enter your password to view comments."); ?><p>8 <p><?php _e('Enter your password to view comments.'); ?><p> 11 9 <?php 12 return; 13 } 14 } 15 16 $comment_author = (isset($_COOKIE['comment_author_'.$cookiehash])) ? trim($_COOKIE['comment_author_'.$cookiehash]) : ''; 17 $comment_author_email = (isset($_COOKIE['comment_author_email_'.$cookiehash])) ? trim($_COOKIE['comment_author_email_'.$cookiehash]) : ''; 18 $comment_author_url = (isset($_COOKIE['comment_author_url_'.$cookiehash])) ? trim($_COOKIE['comment_author_url_'.$cookiehash]) : ''; 19 20 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date"); 10 return; 11 endif; 21 12 ?> 22 13 … … 24 15 25 16 <h2 id="comments"><?php comments_number(__("Comments"), __("1 Comment"), __("% Comments")); ?> 26 <?php if ( 'open' == $post->comment_status) {?>27 <a href="#postcomment" title="<?php _e("Leave a comment"); ?>">»</a>28 <?php }?>17 <?php if ( comments_open() ) : ?> 18 <a href="#postcomment" title="<?php _e("Leave a comment"); ?>">»</a> 19 <?php endif; ?> 29 20 </h2> 30 <?php if ('open' == $post->ping_status) { ?>31 <p><?php _e("The <acronym title=\"Uniform Resource Identifier\">URI</acronym> to TrackBack this entry is:"); ?> <em><?php trackback_url() ?></em></p>32 <?php } ?>33 21 22 <?php if ( $comments ) : ?> 23 <ol id="commentlist"> 34 24 35 <?php if ($comments) { ;?> 36 37 <ol id="commentlist"> 38 <?php foreach ($comments as $comment) { ?> 25 <?php foreach ($comments as $comment) : ?> 39 26 <li id="comment-<?php comment_ID() ?>"> 40 27 <?php comment_text() ?> 41 <p><cite><?php comment_type(); ?> <?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>28 <p><cite><?php comment_type(); ?> <?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> 42 29 </li> 43 30 44 <?php } // end for each comment ?> 31 <?php endforeach; ?> 32 45 33 </ol> 46 <?php } else { // this is displayed if there are no comments so far ?> 47 <p><?php _e("No comments yet."); ?></p> 48 <?php } ?> 49 <p><?php comments_rss_link(__("<abbr title=\"Really Simple Syndication\">RSS</abbr> feed for comments on this post.")); ?></p> 50 <h2 id="postcomment"><?php _e("Leave a comment"); ?></h2> 51 <?php if ('open' == $post->comment_status) { ?> 52 <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> 34 35 <?php else : ?> 36 <p><?php _e('No comments yet.'); ?></p> 37 <?php endif; ?> 38 39 <p><?php comments_rss_link(__('<abbr title="Really Simple Syndication">RSS</abbr> feed for comments on this post.')); ?> 40 <?php if ( pings_open() ) : ?> 41 <a href="<?php trackback_url() ?>"><?php _e('TrackBack <abbr title="Uniform Resource Identifier">URI</abbr>'); ?></a> 42 <?php endif; ?> 43 </p> 44 45 <?php if ( comments_open() ) : ?> 46 <h2 id="postcomment"><?php _e('Leave a comment'); ?></h2> 47 48 <p><?php _e('Line and paragraph breaks automatic. E-mail address never displayed. <abbr title="HyperText Markup Language">HTML</abbr> allowed:'); ?> <code><?php echo allowed_tags(); ?></code></p> 53 49 54 50 <form action="<?php echo get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> 55 51 <p> 56 52 <input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" /> 57 <label for="author"><?php _e( "Name"); ?></label> <?php if ($req) _e('(required)'); ?>58 <input type="hidden" name="comment_post_ID" value="<?php echo $ id; ?>" />59 <input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($_SERVER[ "REQUEST_URI"]); ?>" />53 <label for="author"><?php _e('Name'); ?></label> <?php if ($req) _e('(required)'); ?> 54 <input type="hidden" name="comment_post_ID" value="<?php echo $post->ID; ?>" /> 55 <input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" /> 60 56 </p> 61 57 62 58 <p> 63 59 <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="28" tabindex="2" /> 64 <label for="email"><?php _e( "E-mail"); ?></label> <?php if ($req) _e('(required)'); ?>60 <label for="email"><?php _e('E-mail'); ?></label> <?php if ($req) _e('(required)'); ?> 65 61 </p> 66 62 67 63 <p> 68 64 <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="28" tabindex="3" /> 69 <label for="url"><?php _e( "<acronym title=\"Uniform Resource Identifier\">URI</acronym>"); ?></label>65 <label for="url"><?php _e('<acronym title="Uniform Resource Identifier">URI</acronym>'); ?></label> 70 66 </p> 71 67 72 68 <p> 73 <label for="comment"><?php _e( "Your Comment"); ?></label>69 <label for="comment"><?php _e('Your Comment'); ?></label> 74 70 <br /> 75 <textarea name="comment" id="comment" cols=" 70" rows="4" tabindex="4"></textarea>71 <textarea name="comment" id="comment" cols="60" rows="4" tabindex="4"></textarea> 76 72 </p> 77 73 78 74 <p> 79 <input name="submit" type="submit" tabindex="5" value="<?php _e("Say It!"); ?>" />75 <input name="submit" id="submit" type="submit" tabindex="5" value="<?php _e('Say It!'); ?>" /> 80 76 </p> 81 77 </form> 82 <?php } else { // comments are closed ?>83 <p><?php _e("Sorry, the comment form is closed at this time."); ?></p>84 <?php } ?>85 78 86 <?php // if you delete this the sky will fall on your head87 } 88 ?>79 <?php else : // Comments are closed ?> 80 <p><?php _e('Sorry, the comment form is closed at this time.'); ?></p> 81 <?php endif; ?> -
trunk/wp-includes/template-functions-comment.php
r1398 r1400 18 18 19 19 function comments_template() { 20 global $withcomments, $single, $post, $wpdb, $id, $comment; 20 global $withcomments, $single, $post, $wpdb, $id, $comment, $cookiehash; 21 22 $req = get_settings('require_name_email'); 23 $comment_author = isset($_COOKIE['comment_author_'.$cookiehash]) ? trim($_COOKIE['comment_author_'.$cookiehash]) : ''; 24 $comment_author_email = isset($_COOKIE['comment_author_email_'.$cookiehash]) ? trim($_COOKIE['comment_author_email_'.$cookiehash]) : ''; 25 $comment_author_url = isset($_COOKIE['comment_author_url_'.$cookiehash]) ? trim($_COOKIE['comment_author_url_'.$cookiehash]) : ''; 26 27 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date"); 28 21 29 if ( $single || $withcomments ) 22 30 include(ABSPATH . 'wp-comments.php'); … … 302 310 } 303 311 312 function comments_open() { 313 global $post; 314 if ('open' == $post->comment_status) return true; 315 else return false; 316 } 317 318 function pings_open() { 319 global $post; 320 if ('open' == $post->ping_status) return true; 321 else return false; 322 } 323 304 324 ?>
Note: See TracChangeset
for help on using the changeset viewer.