From: garvinhicking Date: Thu, 16 Mar 2006 16:26:01 +0000 (+0000) Subject: allow external calling X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=fffd6a31495686f60b816a0c24d464e446567566;p=s9y.git allow external calling --- diff --git a/plugins/serendipity_event_weblogping/serendipity_event_weblogping.php b/plugins/serendipity_event_weblogping/serendipity_event_weblogping.php index b6926e0..2c66bc8 100644 --- a/plugins/serendipity_event_weblogping/serendipity_event_weblogping.php +++ b/plugins/serendipity_event_weblogping/serendipity_event_weblogping.php @@ -22,7 +22,7 @@ class serendipity_event_weblogping extends serendipity_event $propbag->add('description', PLUGIN_EVENT_WEBLOGPING_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Serendipity Team'); - $propbag->add('version', '1.03'); + $propbag->add('version', '1.05'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', @@ -34,7 +34,8 @@ class serendipity_event_weblogping extends serendipity_event 'backend_insert' => true, 'backend_update' => true, 'backend_publish' => true, - 'backend_draft' => true + 'backend_draft' => true, + 'external_plugin' => true )); $propbag->add('groups', array('BACKEND_EDITOR')); @@ -157,7 +158,9 @@ class serendipity_event_weblogping extends serendipity_event } foreach ($this->services as $index => $service) { if (isset($serendipity['POST']['announce_entries_' . $service['name']]) || (defined('SERENDIPITY_IS_XMLRPC') && serendipity_db_bool($this->get_config($service['name'])))) { - printf(PLUGIN_EVENT_WEBLOGPING_SENDINGPING . '...', $service['host']); + if (!defined('SERENDIPITY_IS_XMLRPC') || defined('SERENDIPITY_XMLRPC_VERBOSE')) { + printf(PLUGIN_EVENT_WEBLOGPING_SENDINGPING . '...', $service['host']); + } flush(); # XXX append $serendipity['indexFile'] to baseURL? @@ -217,8 +220,8 @@ class serendipity_event_weblogping extends serendipity_event } else { $out = PLUGIN_EVENT_WEBLOGPING_SEND_SUCCESS . "
"; } - - if (!defined('SERENDIPITY_IS_XMLRPC')) { + + if (!defined('SERENDIPITY_IS_XMLRPC') || defined('SERENDIPITY_XMLRPC_VERBOSE')) { echo $out; } } @@ -227,6 +230,16 @@ class serendipity_event_weblogping extends serendipity_event return true; break; + case 'external_plugin': + if ($eventData == 'xmlrpc_ping') { + echo "XMLRPC START\n"; + @define('SERENDIPITY_IS_XMLRPC', true); + @define('SERENDIPITY_XMLRPC_VERBOSE', true); + $this->event_hook('backend_publish', $bag, $eventData); + echo "XMLRPC DONE\n"; + } + return true; + case 'frontend_display': case 'backend_insert': case 'backend_update':