From 50e5276b0a1e32137609c661de23a6f0ccd0c4f2 Mon Sep 17 00:00:00 2001 From: saxmatt Date: Thu, 10 Jun 2004 08:40:58 +0000 Subject: [PATCH] More comments and comment template improvements. TODO: popup comment template git-svn-id: http://svn.automattic.com/wordpress/trunk@1400 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-comments-reply.php | 95 ---------------------- wp-comments.php | 93 ++++++++++----------- wp-includes/template-functions-comment.php | 22 ++++- 3 files changed, 64 insertions(+), 146 deletions(-) delete mode 100644 wp-comments-reply.php diff --git a/wp-comments-reply.php b/wp-comments-reply.php deleted file mode 100644 index 443ffd5fc..000000000 --- a/wp-comments-reply.php +++ /dev/null @@ -1,95 +0,0 @@ - - - - - <?php echo get_settings('blogname'); ?> » Comments on "<?php the_title() ?>" - - - - - - - -

- -

Replying to Comment:

-post_password)) { // if there's a password - if ($_COOKIE['wp-postpass_'.$cookiehash] != $post->post_password) { // and it doesn't match the cookie - echo("

Enter your password to view comments.

"); - return; - } - } - - $comment_author = (isset($_COOKIE['comment_author_'.$cookiehash])) ? trim($_COOKIE['comment_author_'.$cookiehash]) : ''; - $comment_author_email = (isset($_COOKIE['comment_author_email_'.$cookiehash])) ? trim($_COOKIE['comment_author_email_'.$cookiehash]) : ''; - $comment_author_url = (isset($_COOKIE['comment_author_url_'.$cookiehash])) ? trim($_COOKIE['comment_author_url_'.$cookiehash]) : ''; - $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$id' AND comment_approved = '1' AND comment_ID = '$comment_reply_ID' ORDER BY comment_date"); -?> - - - - - -

    - -
  1. - -

    by @

    -
  2. - - -
- -

No comments yet.

- -

Leave a Comment:

-comment_status) { ?> -

Line and paragraph breaks automatic, email address never displayed, HTML allowed:

- -
-

- - - - - -

- -

- - -

- -

- - -

- -

- -
- -

- -

- -

-
- -

Sorry, the comment form is closed at this time.

- - - diff --git a/wp-comments.php b/wp-comments.php index d4218ca4d..6dcfb140b 100644 --- a/wp-comments.php +++ b/wp-comments.php @@ -1,88 +1,81 @@ -post_password)) { // if there's a password - if ($_COOKIE['wp-postpass_'.$cookiehash] != $post->post_password) { // and it doesn't match the cookie -?> -

get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date"); +if ( !empty($post->post_password) && $_COOKIE['wp-postpass_'.$cookiehash] != $post->post_password) : +?> +

+

-comment_status) { ?> -">» - + + ">» +

-ping_status) { ?> -

URI to TrackBack this entry is:"); ?>

- - - - +
    - + +
  1. -

    @

    +

    @

  2. - + +
- -

- -

RSS feed for comments on this post.")); ?>

-

-comment_status) { ?> -

HTML allowed:"); ?>

+ + +

+ + +

RSS feed for comments on this post.')); ?> + + URI'); ?> + +

+ + +

+ +

HTML allowed:'); ?>

- - - " /> + + +

- +

- +

- +
- +

- " /> +

- -

- - + +

+ \ No newline at end of file diff --git a/wp-includes/template-functions-comment.php b/wp-includes/template-functions-comment.php index 9c3bbff83..f111ddd58 100644 --- a/wp-includes/template-functions-comment.php +++ b/wp-includes/template-functions-comment.php @@ -17,7 +17,15 @@ add_filter('comment_text', 'convert_smilies', 20); add_filter('comment_excerpt', 'convert_chars'); function comments_template() { - global $withcomments, $single, $post, $wpdb, $id, $comment; + global $withcomments, $single, $post, $wpdb, $id, $comment, $cookiehash; + + $req = get_settings('require_name_email'); + $comment_author = isset($_COOKIE['comment_author_'.$cookiehash]) ? trim($_COOKIE['comment_author_'.$cookiehash]) : ''; + $comment_author_email = isset($_COOKIE['comment_author_email_'.$cookiehash]) ? trim($_COOKIE['comment_author_email_'.$cookiehash]) : ''; + $comment_author_url = isset($_COOKIE['comment_author_url_'.$cookiehash]) ? trim($_COOKIE['comment_author_url_'.$cookiehash]) : ''; + + $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date"); + if ( $single || $withcomments ) include(ABSPATH . 'wp-comments.php'); } @@ -301,4 +309,16 @@ function trackback_rdf($timezone = 0) { } } +function comments_open() { + global $post; + if ('open' == $post->comment_status) return true; + else return false; +} + +function pings_open() { + global $post; + if ('open' == $post->ping_status) return true; + else return false; +} + ?> \ No newline at end of file