From 6728151fd240898cd3a19d4b8a77d65778718bb3 Mon Sep 17 00:00:00 2001 From: saxmatt Date: Thu, 10 Jun 2004 07:42:48 +0000 Subject: [PATCH] Move comments include into function. git-svn-id: http://svn.automattic.com/wordpress/trunk@1398 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- index.php | 5 +++-- wp-comments.php | 5 +++-- wp-includes/template-functions-comment.php | 6 ++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index cdd8337ac5..495394785c 100644 --- a/index.php +++ b/index.php @@ -37,7 +37,7 @@ require('./wp-blog-header.php');

-
@
+
@
@@ -52,9 +52,10 @@ require('./wp-blog-header.php'); --> -
+ +

diff --git a/wp-comments.php b/wp-comments.php index 3881518bb0..d4218ca4da 100644 --- a/wp-comments.php +++ b/wp-comments.php @@ -17,7 +17,7 @@ $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' ORDER BY comment_date"); + $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date"); ?> @@ -32,7 +32,8 @@ - + +
  1. diff --git a/wp-includes/template-functions-comment.php b/wp-includes/template-functions-comment.php index ed241eeb0b..9c3bbff834 100644 --- a/wp-includes/template-functions-comment.php +++ b/wp-includes/template-functions-comment.php @@ -16,6 +16,12 @@ add_filter('comment_text', 'convert_smilies', 20); add_filter('comment_excerpt', 'convert_chars'); +function comments_template() { + global $withcomments, $single, $post, $wpdb, $id, $comment; + if ( $single || $withcomments ) + include(ABSPATH . 'wp-comments.php'); +} + function clean_url($url) { if ('' == $url) return $url; $url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $url);