git-svn-id: http://svn.automattic.com/wordpress/trunk@2060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2005-01-06 23:10:28 +00:00
parent 99df7e3a03
commit 6584b204a6
4 changed files with 23 additions and 38 deletions

View File

@ -382,13 +382,13 @@ foreach ($posts as $post) { if ('' != trim($post)) {
$comment_content = addslashes(trim($ping));
$comment_content = str_replace('-----', '', $comment_content);
$comment_content = "<trackback /><strong>$ping_title</strong>\n$comment_content";
$comment_content = "<strong>$ping_title</strong>\n\n$comment_content";
// Check if it's already there
if (!$wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_date = '$comment_date' AND comment_content = '$comment_content'")) {
$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)
$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)
VALUES
($post_id, '$comment_author', '$comment_email', '$comment_url', '$comment_ip', '$comment_date', '$comment_content', '1')");
($post_id, '$comment_author', '$comment_email', '$comment_url', '$comment_ip', '$comment_date', '$comment_content', '1', 'trackback')");
echo " Comment added.";
}

View File

@ -2,8 +2,9 @@
/*
Plugin Name: Hello Dolly
Plugin URI: http://wordpress.org/#
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.
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.
Author: Matt Mullenweg
Version: 1.0
Author URI: http://photomatt.net/
*/

View File

@ -237,9 +237,7 @@ function comment_author_IP() {
function get_comment_text() {
global $comment;
$comment_text = str_replace('<trackback />', '', $comment->comment_content);
$comment_text = str_replace('<pingback />', '', $comment_text);
return apply_filters('get_comment_text', $comment_text);
return apply_filters('get_comment_text', $comment->comment_content);
}
function comment_text() {
@ -254,9 +252,7 @@ function comment_text_rss() {
function get_comment_excerpt() {
global $comment;
$comment_text = str_replace('<trackback />', '', $comment->comment_content);
$comment_text = str_replace('<pingback />', '', $comment_text);
$comment_text = strip_tags($comment_text);
$comment_text = strip_tags($comment->comment_content);
$blah = explode(' ', $comment_text);
if (count($blah) > 20) {
$k = 20;
@ -396,8 +392,8 @@ function get_lastcommentmodified($timezone = 'server') {
return $lastcommentmodified;
}
function get_commentdata($comment_ID,$no_cache=0,$include_unapproved=false) { // less flexible, but saves DB queries
global $postc,$id,$commentdata, $wpdb;
function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) { // less flexible, but saves DB queries
global $postc, $id, $commentdata, $wpdb;
if ($no_cache) {
$query = "SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_ID'";
if (false == $include_unapproved) {
@ -405,23 +401,17 @@ function get_commentdata($comment_ID,$no_cache=0,$include_unapproved=false) { //
}
$myrow = $wpdb->get_row($query, ARRAY_A);
} else {
$myrow['comment_ID']=$postc->comment_ID;
$myrow['comment_post_ID']=$postc->comment_post_ID;
$myrow['comment_author']=$postc->comment_author;
$myrow['comment_author_email']=$postc->comment_author_email;
$myrow['comment_author_url']=$postc->comment_author_url;
$myrow['comment_author_IP']=$postc->comment_author_IP;
$myrow['comment_date']=$postc->comment_date;
$myrow['comment_content']=$postc->comment_content;
$myrow['comment_karma']=$postc->comment_karma;
$myrow['comment_approved']=$postc->comment_approved;
if (strstr($myrow['comment_content'], '<trackback />')) {
$myrow['comment_type'] = 'trackback';
} elseif (strstr($myrow['comment_content'], '<pingback />')) {
$myrow['comment_type'] = 'pingback';
} else {
$myrow['comment_type'] = 'comment';
}
$myrow['comment_ID'] = $postc->comment_ID;
$myrow['comment_post_ID'] = $postc->comment_post_ID;
$myrow['comment_author'] = $postc->comment_author;
$myrow['comment_author_email'] = $postc->comment_author_email;
$myrow['comment_author_url'] = $postc->comment_author_url;
$myrow['comment_author_IP'] = $postc->comment_author_IP;
$myrow['comment_date'] = $postc->comment_date;
$myrow['comment_content'] = $postc->comment_content;
$myrow['comment_karma'] = $postc->comment_karma;
$myrow['comment_approved'] = $postc->comment_approved;
$myrow['comment_type'] = $postc->comment_type;
}
return $myrow;
}

View File

@ -1020,12 +1020,8 @@ class wp_xmlrpc_server extends IXR_Server {
$trackback_pings = array();
foreach($comments as $comment) {
if ((strpos($comment->comment_content, '<trackback />') === 0)
|| ('trackback' == $comment->comment_type)) {
// FIXME: would be nicer to have a comment_title field?
// FIXME: assumption: here we make the assumption that trackback
// titles are stored as <strong>title</strong>
$content = str_replace('<trackback />', '', $comment->comment_content);
if ( 'trackback' == $comment->comment_type ) {
$content = $comment->comment_content;
$title = substr($content, 8, (strpos($content, '</strong>') - 8));
$trackback_pings[] = array(
'pingTitle' => $title,
@ -1269,10 +1265,8 @@ class wp_xmlrpc_server extends IXR_Server {
$pingbacks = array();
foreach($comments as $comment) {
if ((strpos($comment->comment_content, '<pingback />') === 0)
|| ('pingback' == $comment->comment_type)) {
if ( 'pingback' == $comment->comment_type )
$pingbacks[] = $comment->comment_author_url;
}
}
return $pingbacks;