Make WordPress Core


Ignore:
Timestamp:
12/16/2005 03:04:33 AM (20 years ago)
Author:
ryan
Message:

New asyncronous ping method. fixes #2048

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r3303 r3317  
    861861    $tb_url = addslashes( $tb_url );
    862862    $wpdb->query("UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', '$tb_url') WHERE ID = '$ID'");
    863     return $wpdb->query("UPDATE $wpdb->posts SET to_ping = REPLACE(to_ping, '$tb_url', '') WHERE ID = '$ID'");
     863    return $wpdb->query("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, '$tb_url', '')) WHERE ID = '$ID'");
    864864}
    865865
     
    938938}
    939939
    940 function check_for_pings() {
     940function spawn_pinger() {
    941941    global $wpdb;
    942942    $doping = false;
     
    947947        $doping = true;
    948948
    949     if ( $doping )
    950         echo '<iframe id="pingcheck" src="' . get_settings('siteurl') .'/wp-admin/execute-pings.php?time=' . time() . '" style="border:none;width:1px;height:1px;"></iframe>';
     949    if ( $doping ) {
     950        $ping_url = get_settings('siteurl') .'/wp-admin/execute-pings.php';
     951        $parts = parse_url($ping_url);
     952        $argyle = @ fsockopen($parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01);
     953        if ( $argyle )
     954            fputs($argyle, "GET {$parts['path']}?time=".time()." HTTP/1.0\r\nHost: {$_SERVER['HTTP_HOST']}\r\n\r\n");
     955       }
    951956}
    952957
Note: See TracChangeset for help on using the changeset viewer.