From 6ef403f52cb9d755a32535482ae0bedf793cfb5d Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 16 Sep 2005 10:58:22 +0000 Subject: WP Merge git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@335 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-inst/wp-admin/admin-functions.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'wp-inst/wp-admin/admin-functions.php') diff --git a/wp-inst/wp-admin/admin-functions.php b/wp-inst/wp-admin/admin-functions.php index 8a7b6a7..5db2579 100644 --- a/wp-inst/wp-admin/admin-functions.php +++ b/wp-inst/wp-admin/admin-functions.php @@ -480,7 +480,6 @@ function wp_delete_user($id, $reassign = 'novalue') { return true; } - function post_exists($title, $content = '', $post_date = '') { global $wpdb; @@ -495,6 +494,13 @@ function post_exists($title, $content = '', $post_date = '') { return 0; } +function comment_exists($comment_author, $comment_date) { + global $wpdb; + + return $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments + WHERE comment_author = '$comment_author' AND comment_date = '$comment_date'"); +} + function url_shorten ($url) { $short_url = str_replace('http://', '', stripslashes($url)); $short_url = str_replace('www.', '', $short_url); @@ -959,9 +965,9 @@ function insert_with_markers($filename, $marker, $insertion) { if ($markerdata) { $state = true; foreach($markerdata as $markerline) { - if (strstr($markerline, "# BEGIN {$marker}\n")) $state = false; + if (strstr($markerline, "# BEGIN {$marker}")) $state = false; if ($state) fwrite($f, "{$markerline}\n"); - if (strstr($markerline, "# END {$marker}\n")) { + if (strstr($markerline, "# END {$marker}")) { fwrite($f, "# BEGIN {$marker}\n"); if(is_array($insertion)) foreach($insertion as $insertline) fwrite($f, "{$insertline}\n"); fwrite($f, "# END {$marker}\n"); -- cgit