Make WordPress Core

Changeset 160


Ignore:
Timestamp:
06/04/2003 06:50:21 PM (23 years ago)
Author:
saxmatt
Message:

Check if pings are allowed.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/b2comments.php

    r156 r160  
    1010        $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date");
    1111        $commentstatus = $wpdb->get_var("SELECT comment_status FROM $tableposts WHERE ID = $id");
     12        $pingstatus = $wpdb->get_var("SELECT ping_status FROM $tableposts WHERE ID = $id");
    1213?>
    1314
     
    1516
    1617<h2>Comments</h2>
     18
     19<?php if ('open' == $pingstatus) { ?>
    1720<p>The URL to TrackBack this entry is:</p>
    1821<p><em><?php trackback_url() ?></em></p>
     22<?php } ?>
    1923
    2024<ol id="comments">
  • trunk/b2trackback.php

    r96 r160  
    6666                trackback_response(1, 'Sorry, this weblog does not allow you to trackback its posts.');
    6767        }
     68        $pingstatus = $wpdb->get_var("SELECT ping_status FROM $tableposts WHERE ID = $tb_id");
    6869
    69         dbconnect();
     70        if ('closed' == $pingstatus)
     71                die('Sorry, trackbacks are closed for this item.');
    7072
    7173        $url = addslashes($url);
     
    7880
    7981        $comment = '<trackback />';
    80         $comment .= "<b>$title</b><br />$excerpt";
     82        $comment .= "<strong>$title</strong><br />$excerpt";
    8183
    8284        $author = addslashes($blog_name);
     
    101103
    102104        $query = "INSERT INTO $tablecomments VALUES ('0','$comment_post_ID','$author','$email','$url','$user_ip','$now','$comment','0')";
    103         $result = mysql_query($query);
     105        $result = $wpdb->query($query);
    104106        if (!$result) {
    105                 die ("There is an error with the database, it can't store your comment...<br>Contact the <a href=\"mailto:$admin_email\">webmaster</a>");
     107                die ("There is an error with the database, it can't store your comment...<br />Contact the <a href=\"mailto:$admin_email\">webmaster</a>");
    106108        } else {
    107109
     
    120122                        $subject = "trackback on post #$comment_post_ID \"".$postdata["Title"]."\"";
    121123
    122                         @mail($recipient, $subject, $notify_message, "From: b2@".$HTTP_SERVER_VARS['SERVER_NAME']."\r\n"."X-Mailer: b2 $b2_version - PHP/" . phpversion());
     124                        @mail($recipient, $subject, $notify_message, "From: wordpress@".$HTTP_SERVER_VARS['SERVER_NAME']."\r\n"."X-Mailer: WordPress $b2_version - PHP/" . phpversion());
    123125                       
    124126                }
Note: See TracChangeset for help on using the changeset viewer.