Maybe some pinging fixes?
git-svn-id: http://svn.automattic.com/wordpress/trunk@1256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ee19b6c490
commit
d8ab98d7b8
|
@ -269,7 +269,6 @@ case 'editpost':
|
||||||
$post_ID = $_POST['post_ID'];
|
$post_ID = $_POST['post_ID'];
|
||||||
$post_categories = $_POST['post_category'];
|
$post_categories = $_POST['post_category'];
|
||||||
if (!$post_categories) $post_categories[] = 1;
|
if (!$post_categories) $post_categories[] = 1;
|
||||||
$post_autobr = intval($_POST['post_autobr']);
|
|
||||||
$content = balanceTags($_POST['content']);
|
$content = balanceTags($_POST['content']);
|
||||||
$content = format_to_post($content);
|
$content = format_to_post($content);
|
||||||
$excerpt = balanceTags($_POST['excerpt']);
|
$excerpt = balanceTags($_POST['excerpt']);
|
||||||
|
@ -285,6 +284,8 @@ case 'editpost':
|
||||||
} else {
|
} else {
|
||||||
$latlonaddition = " post_lat=null, post_lon=null, ";
|
$latlonaddition = " post_lat=null, post_lon=null, ";
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$latlonaddition = '';
|
||||||
}
|
}
|
||||||
$prev_status = $_POST['prev_status'];
|
$prev_status = $_POST['prev_status'];
|
||||||
$post_status = $_POST['post_status'];
|
$post_status = $_POST['post_status'];
|
||||||
|
@ -302,7 +303,7 @@ case 'editpost':
|
||||||
// Format trackbacks
|
// Format trackbacks
|
||||||
$trackback = preg_replace('|\s+|', '\n', $trackback);
|
$trackback = preg_replace('|\s+|', '\n', $trackback);
|
||||||
|
|
||||||
if ('' != $_POST['publish']) $post_status = 'publish';
|
if (isset($_POST['publish'])) $post_status = 'publish';
|
||||||
|
|
||||||
if (($user_level > 4) && (!empty($_POST['edit_date']))) {
|
if (($user_level > 4) && (!empty($_POST['edit_date']))) {
|
||||||
$aa = $_POST['aa'];
|
$aa = $_POST['aa'];
|
||||||
|
@ -364,7 +365,8 @@ $now_gmt = current_time('mysql', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// are we going from draft/private to published?
|
// are we going from draft/private to published?
|
||||||
if ((($prev_status == 'draft') || ($prev_status == 'private')) && ($post_status == 'publish')) {
|
if ($prev_status != 'publish' && $post_status == 'publish') {
|
||||||
|
generic_ping();
|
||||||
} // end if moving from draft/private to published
|
} // end if moving from draft/private to published
|
||||||
if ($post_status == 'publish') {
|
if ($post_status == 'publish') {
|
||||||
do_action('publish_post', $post_ID);
|
do_action('publish_post', $post_ID);
|
||||||
|
|
|
@ -493,44 +493,46 @@ function timer_stop($display=0,$precision=3) { //if called like timer_stop(1), w
|
||||||
}
|
}
|
||||||
|
|
||||||
function weblog_ping($server = '', $path = '') {
|
function weblog_ping($server = '', $path = '') {
|
||||||
include_once (ABSPATH . WPINC . '/class-xmlrpc.php');
|
$debug = false;
|
||||||
include_once (ABSPATH . WPINC . '/class-xmlrpcs.php');
|
include_once (ABSPATH . WPINC . '/class-xmlrpc.php');
|
||||||
|
include_once (ABSPATH . WPINC . '/class-xmlrpcs.php');
|
||||||
|
|
||||||
$f = new xmlrpcmsg('weblogUpdates.ping',
|
$f = new xmlrpcmsg('weblogUpdates.ping',
|
||||||
array(new xmlrpcval(get_settings('blogname'), 'string'),
|
array(new xmlrpcval(get_settings('blogname'), 'string'),
|
||||||
new xmlrpcval(get_settings('home') ,'string')));
|
new xmlrpcval(get_settings('home') ,'string')));
|
||||||
$c = new xmlrpc_client($path, $server, 80);
|
$c = new xmlrpc_client($path, $server, 80);
|
||||||
$r = $c->send($f);
|
$r = $c->send($f);
|
||||||
|
|
||||||
|
if ($debug) {
|
||||||
|
echo "<h3>Response Object Dump:</h3>
|
||||||
|
<pre>\n";
|
||||||
|
print_r($r);
|
||||||
|
echo "</pre>\n";
|
||||||
|
}
|
||||||
|
|
||||||
if ($debug) {
|
$v = @phpxmlrpc_decode($r->value());
|
||||||
print "<h3>Response Object Dump:</h3>\n";
|
if (!$r->faultCode()) {
|
||||||
print "<pre>\n";
|
$result['message'] = "<p class=\"rpcmsg\">";
|
||||||
print_r($r);
|
$result['message'] = $result['message'] . $v["message"] . "<br />\n";
|
||||||
print "</pre>\n";
|
$result['message'] = $result['message'] . "</p>";
|
||||||
}
|
} else {
|
||||||
|
$result['err'] = $r->faultCode();
|
||||||
|
$result['message'] = "<!--\n";
|
||||||
|
$result['message'] = $result['message'] . "Fault: ";
|
||||||
|
$result['message'] = $result['message'] . "Code: " . $r->faultCode();
|
||||||
|
$result['message'] = $result['message'] . " Reason '" .$r->faultString()."'<BR>";
|
||||||
|
$result['message'] = $result['message'] . "-->\n";
|
||||||
|
}
|
||||||
|
|
||||||
$v = @phpxmlrpc_decode($r->value());
|
if ($debug) print '<blockquote>' . $result['message'] . '</blockquote>';
|
||||||
if (!$r->faultCode()) {
|
|
||||||
$result['message'] = "<p class=\"rpcmsg\">";
|
|
||||||
$result['message'] = $result['message'] . $v["message"] . "<br />\n";
|
|
||||||
$result['message'] = $result['message'] . "</p>";
|
|
||||||
} else {
|
|
||||||
$result['err'] = $r->faultCode();
|
|
||||||
$result['message'] = "<!--\n";
|
|
||||||
$result['message'] = $result['message'] . "Fault: ";
|
|
||||||
$result['message'] = $result['message'] . "Code: " . $r->faultCode();
|
|
||||||
$result['message'] = $result['message'] . " Reason '" .$r->faultString()."'<BR>";
|
|
||||||
$result['message'] = $result['message'] . "-->\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($debug) print '<blockquote>' . $result['message'] . '</blockquote>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function generic_ping($post_id = 0) {
|
function generic_ping($post_id = 0) {
|
||||||
$services = get_settings('ping_sites');
|
$services = get_settings('ping_sites');
|
||||||
$services = preg_replace("|(\s)+|", '$1', $services); // Kill dupe lines
|
$services = preg_replace("|(\s)+|", '$1', $services); // Kill dupe lines
|
||||||
if ('' != trim($services)) {
|
$services = trim($services);
|
||||||
$services = explode("\n", trim($services));
|
if ('' != $services) {
|
||||||
|
$services = explode("\n", $services);
|
||||||
foreach ($services as $service) {
|
foreach ($services as $service) {
|
||||||
$uri = parse_url($service);
|
$uri = parse_url($service);
|
||||||
weblog_ping($uri['host'], $uri['path']);
|
weblog_ping($uri['host'], $uri['path']);
|
||||||
|
|
Loading…
Reference in New Issue