Changeset 4953 for trunk/wp-includes/query.php
- Timestamp:
- 02/27/2007 03:24:54 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r4940 r4953 201 201 global $wp_query; 202 202 203 return $wp_query->is_singular; 203 return $wp_query->is_singular; 204 204 } 205 205 … … 286 286 var $in_the_loop = false; 287 287 var $post; 288 288 289 289 var $comments; 290 290 var $comment_count = 0; … … 361 361 $this->parse_query(''); 362 362 } 363 363 364 364 function fill_query_vars($array) { 365 365 $keys = array( … … 396 396 $array[$key] = ''; 397 397 } 398 398 399 399 return $array; 400 400 } … … 411 411 $this->query_vars = $qv; 412 412 } 413 413 414 414 $qv = $this->fill_query_vars($qv); 415 415 416 416 if ( ! empty($qv['robots']) ) { 417 417 $this->is_robots = true; … … 610 610 // Shorthand. 611 611 $q = &$this->query_vars; 612 612 613 613 $q = $this->fill_query_vars($q); 614 614 … … 1002 1002 } 1003 1003 } 1004 1004 1005 1005 // Comments feeds 1006 1006 if ( $this->is_comment_feed && ( $this->is_archive || $this->is_search || !$this->is_singular ) ) { … … 1014 1014 $cgroupby = ''; 1015 1015 } 1016 1016 1017 1017 $cjoin = apply_filters('comment_feed_join', $cjoin); 1018 1018 $cwhere = apply_filters('comment_feed_where', $cwhere); 1019 1019 $cgroupby = apply_filters('comment_feed_groupby', $cgroupby); 1020 1020 1021 1021 $this->comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby ORDER BY comment_date_gmt DESC LIMIT " . get_settings('posts_per_rss')); 1022 1022 $this->comment_count = count($this->comments); 1023 1023 1024 1024 $post_ids = array(); 1025 1025 1026 1026 foreach ($this->comments as $comment) 1027 1027 $post_ids[] = (int) $comment->comment_post_ID; 1028 1028 1029 1029 $post_ids = join(',', $post_ids); 1030 1030 $join = ''; … … 1062 1062 $this->comment_count = count($this->comments); 1063 1063 } 1064 1064 1065 1065 if ( !empty($limits) ) { 1066 1066 $found_posts_query = apply_filters( 'found_posts_query', 'SELECT FOUND_ROWS()' ); … … 1069 1069 $this->max_num_pages = ceil($this->found_posts / $q['posts_per_page']); 1070 1070 } 1071 1071 1072 1072 // Check post status to determine if post should be displayed. 1073 1073 if ( !empty($this->posts) && ($this->is_single || $this->is_page) ) { … … 1149 1149 } 1150 1150 } 1151 1151 1152 1152 function next_comment() { 1153 1153 $this->current_comment++; 1154 1154 1155 1155 $this->comment = $this->comments[$this->current_comment]; 1156 1156 return $this->comment; 1157 1157 } 1158 1158 1159 1159 function the_comment() { 1160 1160 global $comment; 1161 1161 1162 1162 $comment = $this->next_comment(); 1163 1163 1164 1164 if ($this->current_comment == 0) { 1165 1165 do_action('comment_loop_start'); 1166 1166 } 1167 1167 } 1168 1168 1169 1169 function have_comments() { 1170 1170 if ($this->current_comment + 1 < $this->comment_count) { … … 1173 1173 $this->rewind_comments(); 1174 1174 } 1175 1175 1176 1176 return false; 1177 1177 } 1178 1178 1179 1179 function rewind_comments() { 1180 1180 $this->current_comment = -1;
Note: See TracChangeset
for help on using the changeset viewer.