Make WordPress Core

Changeset 3644


Ignore:
Timestamp:
03/17/2006 01:16:22 AM (19 years ago)
Author:
ryan
Message:

Comment feed fixes from David House. fixes #2570

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-commentsrss2.php

    r3543 r3644  
    3232            comment_author_url, comment_date, comment_date_gmt, comment_content, comment_post_ID,
    3333            $wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments
    34             LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE comment_post_ID = '$id'
     34            LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE comment_post_ID = '" . get_the_ID() . "'
    3535            AND $wpdb->comments.comment_approved = '1' AND $wpdb->posts.post_status = 'publish'
    3636            AND post_date_gmt < '" . gmdate("Y-m-d H:i:59") . "'
     
    4747        if ($comments) {
    4848            foreach ($comments as $comment) {
     49                $GLOBALS['comment'] =& $comment;
    4950                // Some plugins may need to know the metadata
    5051                // associated with this comment's post:
     
    7879    </item>
    7980<?php
    80             }
     81            } 
    8182        }
    8283    }
  • trunk/wp-includes/functions.php

    r3639 r3644  
    20162016function load_template($file) {
    20172017    global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query,
    2018         $wp_rewrite, $wpdb, $wp_version, $wp;
     2018        $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment;
    20192019
    20202020    extract($wp_query->query_vars);
     
    22212221
    22222222    $for_comments = false;
    2223     if ( is_single() || ($withcomments == 1) ) {
     2223    if ( is_single() || (get_query_var('withcomments') == 1) ) {
    22242224        $feed = 'rss2';
    22252225        $for_comments = true;   
     
    22392239
    22402240function do_feed_rss2($for_comments) {
    2241     if ( $for_comments )
     2241    if ( $for_comments ) {
    22422242        load_template(ABSPATH . 'wp-commentsrss2.php');
    2243     else
     2243    } else {
    22442244        load_template(ABSPATH . 'wp-rss2.php');
     2245    }
    22452246}
    22462247
  • trunk/wp-includes/template-functions-post.php

    r3595 r3644  
    1616}
    1717
     18function get_the_ID() {
     19    global $id;
     20    return $id;
     21}
    1822
    1923function the_title($before = '', $after = '', $echo = true) {
Note: See TracChangeset for help on using the changeset viewer.