]> git.mjollnir.org Git - s9y.git/commitdiff
check xmlrpc existence
authorgarvinhicking <garvinhicking>
Tue, 14 Mar 2006 11:21:09 +0000 (11:21 +0000)
committergarvinhicking <garvinhicking>
Tue, 14 Mar 2006 11:21:09 +0000 (11:21 +0000)
plugins/serendipity_event_weblogping/serendipity_event_weblogping.php

index b5958b64672405ad70830ce05c9011e681b67533..73dc47803fe8918a64f2cf3aff00cf31011af56e 100644 (file)
@@ -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.02');
+        $propbag->add('version',       '1.03');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -156,7 +156,7 @@ class serendipity_event_weblogping extends serendipity_event
                         }
                     }
                     foreach ($this->services as $index => $service) {
-                        if (isset($serendipity['POST']['announce_entries_' . $service['name']])) {
+                        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']);
                             flush();
 
@@ -213,9 +213,13 @@ class serendipity_event_weblogping extends serendipity_event
                             $http_response = $req->getResponseBody();
                             $xmlrpc_result = $message->parseResponse($http_response);
                             if ($xmlrpc_result->faultCode()) {
-                                echo sprintf(PLUGIN_EVENT_WEBLOGPING_SEND_FAILURE . "<br />", htmlspecialchars($xmlrpc_result->faultString()));
+                                $out = sprintf(PLUGIN_EVENT_WEBLOGPING_SEND_FAILURE . "<br />", htmlspecialchars($xmlrpc_result->faultString()));
                             } else {
-                                echo PLUGIN_EVENT_WEBLOGPING_SEND_SUCCESS . "<br />";
+                                $out = PLUGIN_EVENT_WEBLOGPING_SEND_SUCCESS . "<br />";
+                            }
+                            
+                            if (!defined('SERENDIPITY_IS_XMLRPC')) {
+                                echo $out;
                             }
                         }
                     }