WordPress.org

Make WordPress Core

Changeset 3663


Ignore:
Timestamp:
03/30/2006 07:36:54 AM (14 years ago)
Author:
ryan
Message:

Future post pinging and cron fixups from masquerade. fixes #2469

Location:
trunk
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-footer.php

    r3492 r3663  
    1010<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
    1111
    12 <?php
    13 if ( (substr(php_sapi_name(), 0, 3) == 'cgi') && spawn_pinger() ) {
    14     echo '<iframe id="pingcheck" src="' . get_settings('siteurl') .'/wp-admin/execute-pings.php?time=' . time() . '" style="border:none;width:1px;height:1px;"></iframe>';
    15 }
    16 ?>
    17 
    1812</body>
    1913</html>
  • trunk/wp-includes/default-filters.php

    r3638 r3663  
    9393add_action('do_feed_rss2', 'do_feed_rss2', 10, 1);
    9494add_action('do_feed_atom', 'do_feed_atom', 10, 1);
     95add_action('do_pings', 'do_all_pings', 10, 1);
    9596?>
  • trunk/wp-includes/functions-post.php

    r3634 r3663  
    200200                VALUES ('$post_ID','_encloseme','1')
    201201            ");
    202             spawn_pinger();
     202            wp_schedule_single_event(time(), 'do_pings');
    203203        }
    204204    } else if ($post_type == 'page') {
     
    10031003}
    10041004
     1005function do_all_pings() {
     1006    global $wpdb;
     1007
     1008    // Do pingbacks
     1009    while ($ping = $wpdb->get_row("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_pingme' LIMIT 1")) {
     1010        $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$ping->ID} AND meta_key = '_pingme';");
     1011        pingback($ping->post_content, $ping->ID);
     1012    }
     1013   
     1014    // Do Enclosures
     1015    while ($enclosure = $wpdb->get_row("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme' LIMIT 1")) {
     1016        $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$enclosure->ID} AND meta_key = '_encloseme';");
     1017        do_enclose($enclosure->post_content, $enclosure->ID);
     1018    }
     1019
     1020    // Do Trackbacks
     1021    $trackbacks = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE CHAR_LENGTH(TRIM(to_ping)) > 7 AND post_status = 'publish'");
     1022    if ( is_array($trackbacks) ) {
     1023        foreach ( $trackbacks as $trackback ) {
     1024            do_trackbacks($trackback->ID);
     1025        }
     1026    }
     1027
     1028    //Do Update Services/Generic Pings
     1029    generic_ping();
     1030}
    10051031?>
  • trunk/wp-includes/functions.php

    r3659 r3663  
    11201120}
    11211121
    1122 function spawn_pinger() {
    1123     global $wpdb;
    1124     $doping = false;
    1125     if ( $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE TRIM(to_ping) != '' LIMIT 1") )
    1126         $doping = true;
    1127 
    1128     if ( $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_pingme' OR meta_key = '_encloseme' LIMIT 1") )
    1129         $doping = true;
    1130 
    1131     if ( substr(php_sapi_name(), 0, 3) == 'cgi' )
    1132         return $doping;
    1133 
    1134     if ( $doping ) {
    1135         $ping_url = get_settings('siteurl') .'/wp-admin/execute-pings.php';
    1136         $parts = parse_url($ping_url);
    1137         $argyle = @ fsockopen($parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01);
    1138         if ( $argyle )
    1139             fputs($argyle, "GET {$parts['path']}?time=".time()." HTTP/1.0\r\nHost: {$_SERVER['HTTP_HOST']}\r\n\r\n");
    1140        }
    1141 }
    1142 
    11431122function do_enclose( $content, $post_ID ) {
    11441123    global $wp_version, $wpdb;
Note: See TracChangeset for help on using the changeset viewer.