22
33// Template functions
44
5- function comments_template () {
6- global $ withcomments , $ post , $ wpdb , $ id , $ comment ;
5+ function comments_template ( $ show ) {
6+ global $ wp_query , $ withcomments , $ post , $ wpdb , $ id , $ comment ;
77
88 if ( is_single () || is_page () || $ withcomments ) :
99 $ req = get_settings ('require_name_email ' );
@@ -12,14 +12,10 @@ function comments_template() {
1212 $ comment_author_url = isset ($ _COOKIE ['comment_author_url_ ' .COOKIEHASH ]) ? trim (stripslashes ($ _COOKIE ['comment_author_url_ ' .COOKIEHASH ])) : '' ;
1313 $ comments = $ wpdb ->get_results ("SELECT * FROM $ wpdb ->comments WHERE comment_post_ID = ' $ post ->ID ' AND comment_approved = '1' ORDER BY comment_date " );
1414
15- $ template = get_template_directory ();
16- $ template .= "/comments.php " ;
17-
18- if (file_exists ($ template )) {
19- include ($ template );
20- } else {
21- include (ABSPATH . 'wp-comments.php ' );
22- }
15+ if ( file_exists ( TEMPLATEPATH . '/comments.php ' ) )
16+ require ( TEMPLATEPATH . '/comments.php ' );
17+ else
18+ require ( ABSPATH . 'wp-includes/wp-comments.php ' );
2319
2420 endif ;
2521}
@@ -72,12 +68,10 @@ function comments_popup_script($width=400, $height=400, $file='') {
7268 global $ wpcommentspopupfile , $ wptrackbackpopupfile , $ wppingbackpopupfile , $ wpcommentsjavascript ;
7369
7470 if (empty ($ file )) {
75- $ template = TEMPLATEPATH . '/comments-popup.php ' ;
76- if (file_exists ($ template )) {
77- $ wpcommentspopupfile = str_replace (ABSPATH , '' , $ template );
78- } else {
79- $ wpcommentspopupfile = 'wp-comments-popup.php ' ;
80- }
71+ if ( file_exists ( TEMPLATEPATH . '/comments-popup.php ' ) )
72+ require ( TEMPLATEPATH . '/comments-popup.php ' );
73+ else
74+ require ( ABSPATH . 'wp-includes/wp-comments-popup.php ' );
8175 } else {
8276 $ wpcommentspopupfile = $ file ;
8377 }
0 commit comments