Changeset 2060

Show
Ignore:
Timestamp:
01/06/05 23:10:28 (4 years ago)
Author:
saxmatt
Message:

Some cleanup patches from Scott: http://www.coffee2code.com/archives/2005/01/06/walking-with-15/

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/import-mt.php

    r1578 r2060  
    383383            $comment_content = str_replace('-----', '', $comment_content); 
    384384             
    385             $comment_content = "<trackback /><strong>$ping_title</strong>\n$comment_content"; 
     385            $comment_content = "<strong>$ping_title</strong>\n\n$comment_content"; 
    386386       
    387387            // Check if it's already there 
    388388            if (!$wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_date = '$comment_date' AND comment_content = '$comment_content'")) { 
    389                 $wpdb->query("INSERT INTO $wpdb->comments (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_content, comment_approved
     389                $wpdb->query("INSERT INTO $wpdb->comments (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_content, comment_approved, comment_type
    390390                VALUES 
    391                 ($post_id, '$comment_author', '$comment_email', '$comment_url', '$comment_ip', '$comment_date', '$comment_content', '1')"); 
     391                ($post_id, '$comment_author', '$comment_email', '$comment_url', '$comment_ip', '$comment_date', '$comment_content', '1', 'trackback')"); 
    392392                echo " Comment added."; 
    393393            } 
  • trunk/wp-content/plugins/hello.php

    r1340 r2060  
    33Plugin Name: Hello Dolly 
    44Plugin URI: http://wordpress.org/# 
    5 Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong. Hello, Dolly. This is, by the way, the world's first official WordPress plugin. When enabled you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page but the plugins page
     5Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong. Hello, Dolly. This is, by the way, the world's first official WordPress plugin. When enabled you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page
    66Author: Matt Mullenweg 
     7Version: 1.0 
    78Author URI: http://photomatt.net/ 
    89*/  
  • trunk/wp-includes/comment-functions.php

    r2054 r2060  
    238238function get_comment_text() { 
    239239    global $comment; 
    240     $comment_text = str_replace('<trackback />', '', $comment->comment_content); 
    241     $comment_text = str_replace('<pingback />', '', $comment_text); 
    242     return apply_filters('get_comment_text', $comment_text); 
     240    return apply_filters('get_comment_text', $comment->comment_content); 
    243241} 
    244242 
     
    255253function get_comment_excerpt() { 
    256254    global $comment; 
    257     $comment_text = str_replace('<trackback />', '', $comment->comment_content); 
    258     $comment_text = str_replace('<pingback />', '', $comment_text); 
    259     $comment_text = strip_tags($comment_text); 
     255    $comment_text = strip_tags($comment->comment_content); 
    260256    $blah = explode(' ', $comment_text); 
    261257    if (count($blah) > 20) { 
     
    397393} 
    398394 
    399 function get_commentdata($comment_ID,$no_cache=0,$include_unapproved=false) { // less flexible, but saves DB queries 
    400     global $postc,$id,$commentdata, $wpdb; 
     395function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) { // less flexible, but saves DB queries 
     396    global $postc, $id, $commentdata, $wpdb; 
    401397    if ($no_cache) { 
    402398        $query = "SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_ID'"; 
     
    406402            $myrow = $wpdb->get_row($query, ARRAY_A); 
    407403    } else { 
    408         $myrow['comment_ID']=$postc->comment_ID; 
    409         $myrow['comment_post_ID']=$postc->comment_post_ID; 
    410         $myrow['comment_author']=$postc->comment_author; 
    411         $myrow['comment_author_email']=$postc->comment_author_email; 
    412         $myrow['comment_author_url']=$postc->comment_author_url; 
    413         $myrow['comment_author_IP']=$postc->comment_author_IP; 
    414         $myrow['comment_date']=$postc->comment_date; 
    415         $myrow['comment_content']=$postc->comment_content; 
    416         $myrow['comment_karma']=$postc->comment_karma; 
    417         $myrow['comment_approved']=$postc->comment_approved; 
    418         if (strstr($myrow['comment_content'], '<trackback />')) { 
    419             $myrow['comment_type'] = 'trackback'; 
    420         } elseif (strstr($myrow['comment_content'], '<pingback />')) { 
    421             $myrow['comment_type'] = 'pingback'; 
    422         } else { 
    423             $myrow['comment_type'] = 'comment'; 
    424         } 
     404        $myrow['comment_ID'] = $postc->comment_ID; 
     405        $myrow['comment_post_ID'] = $postc->comment_post_ID; 
     406        $myrow['comment_author'] = $postc->comment_author; 
     407        $myrow['comment_author_email'] = $postc->comment_author_email; 
     408        $myrow['comment_author_url'] = $postc->comment_author_url; 
     409        $myrow['comment_author_IP'] = $postc->comment_author_IP; 
     410        $myrow['comment_date'] = $postc->comment_date; 
     411        $myrow['comment_content'] = $postc->comment_content; 
     412        $myrow['comment_karma'] = $postc->comment_karma; 
     413        $myrow['comment_approved'] = $postc->comment_approved; 
     414        $myrow['comment_type'] = $postc->comment_type; 
    425415    } 
    426416    return $myrow; 
  • trunk/xmlrpc.php

    r2059 r2060  
    10211021      $trackback_pings = array(); 
    10221022      foreach($comments as $comment) { 
    1023         if ((strpos($comment->comment_content, '<trackback />') === 0) 
    1024             || ('trackback' == $comment->comment_type)) { 
    1025           // FIXME: would be nicer to have a comment_title field? 
    1026           // FIXME: assumption: here we make the assumption that trackback 
    1027           //        titles are stored as <strong>title</strong> 
    1028           $content = str_replace('<trackback />', '', $comment->comment_content); 
     1023        if ( 'trackback' == $comment->comment_type ) { 
     1024          $content = $comment->comment_content; 
    10291025          $title = substr($content, 8, (strpos($content, '</strong>') - 8)); 
    10301026          $trackback_pings[] = array( 
     
    12701266        $pingbacks = array(); 
    12711267        foreach($comments as $comment) { 
    1272             if ((strpos($comment->comment_content, '<pingback />') === 0) 
    1273                 || ('pingback' == $comment->comment_type)) { 
     1268            if ( 'pingback' == $comment->comment_type ) 
    12741269                $pingbacks[] = $comment->comment_author_url; 
    1275             } 
    12761270        } 
    12771271