From 9c27e47bf43dcc4d61967e6aabc328d8d8ccf3a7 Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Wed, 4 Jun 2003 18:50:21 +0000 Subject: [PATCH] Check if pings are allowed. git-svn-id: https://develop.svn.wordpress.org/trunk@160 602fd350-edb4-49c9-b593-d223f7449a82 --- b2comments.php | 4 ++++ b2trackback.php | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/b2comments.php b/b2comments.php index 8f8c55589f..9c1f041e90 100644 --- a/b2comments.php +++ b/b2comments.php @@ -9,13 +9,17 @@ $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date"); $commentstatus = $wpdb->get_var("SELECT comment_status FROM $tableposts WHERE ID = $id"); + $pingstatus = $wpdb->get_var("SELECT ping_status FROM $tableposts WHERE ID = $id"); ?>

Comments

+ +

The URL to TrackBack this entry is:

+
    get_var("SELECT ping_status FROM $tableposts WHERE ID = $tb_id"); - dbconnect(); + if ('closed' == $pingstatus) + die('Sorry, trackbacks are closed for this item.'); $url = addslashes($url); $title = strip_tags($title); @@ -77,7 +79,7 @@ if ((strlen(''.$tb_id)) && (empty($HTTP_GET_VARS['__mode'])) && (strlen(''.$url) $blog_name = (strlen($blog_name) > 255) ? substr($blog_name, 0, 252).'...' : $blog_name; $comment = ''; - $comment .= "$title
    $excerpt"; + $comment .= "$title
    $excerpt"; $author = addslashes($blog_name); $email = ''; @@ -100,9 +102,9 @@ if ((strlen(''.$tb_id)) && (empty($HTTP_GET_VARS['__mode'])) && (strlen(''.$url) $author = addslashes($author); $query = "INSERT INTO $tablecomments VALUES ('0','$comment_post_ID','$author','$email','$url','$user_ip','$now','$comment','0')"; - $result = mysql_query($query); + $result = $wpdb->query($query); if (!$result) { - die ("There is an error with the database, it can't store your comment...
    Contact the webmaster"); + die ("There is an error with the database, it can't store your comment...
    Contact the webmaster"); } else { if ($comments_notify) { @@ -119,7 +121,7 @@ if ((strlen(''.$tb_id)) && (empty($HTTP_GET_VARS['__mode'])) && (strlen(''.$url) $recipient = $authordata["user_email"]; $subject = "trackback on post #$comment_post_ID \"".$postdata["Title"]."\""; - @mail($recipient, $subject, $notify_message, "From: b2@".$HTTP_SERVER_VARS['SERVER_NAME']."\r\n"."X-Mailer: b2 $b2_version - PHP/" . phpversion()); + @mail($recipient, $subject, $notify_message, "From: wordpress@".$HTTP_SERVER_VARS['SERVER_NAME']."\r\n"."X-Mailer: WordPress $b2_version - PHP/" . phpversion()); }