WordPress.org

Make WordPress Core

Changeset 1398


Ignore:
Timestamp:
06/10/04 07:42:48 (10 years ago)
Author:
saxmatt
Message:

Move comments include into function.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r1390 r1398  
    3838<div class="post"> 
    3939     <h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h3> 
    40     <div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> &#8212; <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div> 
     40    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> &#8212; <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div> 
    4141     
    4242    <div class="storycontent"> 
     
    5353    --> 
    5454 
    55 <?php include(ABSPATH . 'wp-comments.php'); ?> 
    5655</div> 
     56 
     57<?php comments_template(); // Get wp-comments.php template ?> 
    5758 
    5859<?php endforeach; else: ?> 
  • trunk/wp-comments.php

    r1355 r1398  
    1818        $comment_author_url = (isset($_COOKIE['comment_author_url_'.$cookiehash])) ? trim($_COOKIE['comment_author_url_'.$cookiehash]) : ''; 
    1919 
    20         $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$id' AND comment_approved = '1' ORDER BY comment_date"); 
     20        $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date"); 
    2121?> 
    2222 
     
    3333 
    3434 
    35 <?php if ($comments) { ?> 
     35<?php if ($comments) { ;?> 
     36 
    3637<ol id="commentlist"> 
    3738<?php foreach ($comments as $comment) { ?> 
  • trunk/wp-includes/template-functions-comment.php

    r1355 r1398  
    1616 
    1717add_filter('comment_excerpt', 'convert_chars'); 
     18 
     19function comments_template() { 
     20    global $withcomments, $single, $post, $wpdb, $id, $comment; 
     21    if ( $single || $withcomments ) 
     22        include(ABSPATH . 'wp-comments.php'); 
     23} 
    1824 
    1925function clean_url($url) { 
Note: See TracChangeset for help on using the changeset viewer.