Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_weblogping
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10533/plugins/serendipity_event_weblogping
Modified Files:
serendipity_event_weblogping.php
Log Message:
better formatting for trackback verbose output
flushing weblogping event
Index: serendipity_event_weblogping.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_weblogping/serendipity_event_weblogping.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- serendipity_event_weblogping.php 11 Jun 2004 08:33:51 -0000 1.7
+++ serendipity_event_weblogping.php 21 Jun 2004 15:17:09 -0000 1.8
@@ -10,7 +10,7 @@
@define('PLUGIN_EVENT_WEBLOGPING_CUSTOM', 'Selbstdefinierte Ping-Services');
@define('PLUGIN_EVENT_WEBLOGPING_CUSTOM_BLAHBLA', 'Mehrere durch "," getrennte Ping-Services im Format: "host.domain/pfad". Falls am Anfang eines Hosts ein "*" eingefügt wird, werden an den Host die erweiterten XML-RPC Optionen gesendet; der Host muss diese Optionen unterstützen.');
break;
-
+
case 'en':
case 'es':
default:
@@ -31,7 +31,7 @@
function introspect(&$propbag)
{
global $serendipity;
-
+
$propbag->add('name', PLUGIN_EVENT_WEBLOGPING_TITLE);
$propbag->add('description', PLUGIN_EVENT_WEBLOGPING_DESC);
$propbag->add('event_hooks', array(
@@ -42,7 +42,7 @@
'backend_publish' => true,
'backend_draft' => true
));
-
+
$this->services = array(
array(
'name' => 'blo.gs',
@@ -50,19 +50,19 @@
'path' => '/',
'extended' => true
),
-
+
array(
'name' => 'blogrolling.com',
'host' => 'rpc.blogrolling.com',
'path' => '/pinger/'
),
-
+
array(
'name' => 'technorati.com',
'host' => 'rpc.technorati.com',
'path' => '/rpc/ping'
),
-
+
array(
'name' => 'weblogs.com',
'host' => 'rpc.weblogs.com',
@@ -110,9 +110,9 @@
foreach($this->services AS $key => $service) {
$conf_array[] = $service['name'];
}
-
+
$conf_array[] = 'manual_services';
-
+
$propbag->add('configuration', $conf_array);
}
@@ -124,7 +124,7 @@
$propbag->add('name', PLUGIN_EVENT_WEBLOGPING_CUSTOM);
$propbag->add('description', PLUGIN_EVENT_WEBLOGPING_CUSTOM_BLAHBLA);
break;
-
+
default:
$propbag->add('type', 'boolean');
$propbag->add('name', $name);
@@ -136,10 +136,10 @@
function generate_content(&$title) {
$title = PLUGIN_EVENT_WEBLOGPING_TITLE . ' ' . PLUGIN_EVENT_WEBLOGPING_DESC;
}
-
+
function event_hook($event, &$bag, &$eventData) {
global $serendipity;
-
+
$hooks = &$bag->get('event_hooks');
if (isset($hooks[$event])) {
switch($event) {
@@ -152,7 +152,7 @@
// Detect if the current checkbox needs to be saved. We use the field chk_timestamp to see,
// if the form has already been submitted and individual changes shall be preserved
$selected = (($serendipity['POST']['chk_timestamp'] && $serendipity['POST']['announce_entries_' . $service['name']]) || (!isset($serendipity['POST']['chk_timestamp']) && $this->get_config($service['name']) == 'true') ? 'checked="checked"' : '');
-
+
$onclick = '';
if (!empty($service['supersedes'])) {
$onclick = 'onclick="';
@@ -187,11 +187,12 @@
}
}
}
-
+
foreach ($this->services as $index => $service) {
if (isset($serendipity['POST']['announce_entries_' . $service['name']])) {
printf(PLUGIN_EVENT_WEBLOGPING_SENDINGPING . '...<br />', $service['host']);
-
+ flush();
+
# XXX append $serendipity['indexFile'] to baseURL?
$args = array(
new XML_RPC_Value(
@@ -203,39 +204,39 @@
'string'
)
);
-
+
if ($service['extended']) {
# the checkUrl: for when the main page is not really the main page
$args[] = new XML_RPC_Value(
'',
'string'
);
-
+
# the rssUrl
$args[] = new XML_RPC_Value(
$serendipity['baseURL'] . 'rss.php?version=2.0',
'string'
);
}
-
+
$message = new XML_RPC_Message(
$service['extended'] ? 'weblogUpdates.extendedPing' : 'weblogUpdates.ping',
$args
);
-
+
$client = new XML_RPC_Client(
$service['path'],
$service['host']
);
-
+
# 15 second timeout may not be long enough for weblogs.com
$result = $client->send($message, 15);
}
}
-
+
return true;
break;
-
+
case 'frontend_display':
case 'backend_insert':
case 'backend_update':
|