Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_weblogping
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20187/plugins/serendipity_event_weblogping
Modified Files:
serendipity_event_weblogping.php
Log Message:
allow manually definied pingback services
Index: serendipity_event_weblogping.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_weblogping/serendipity_event_weblogping.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- serendipity_event_weblogping.php 3 Apr 2004 17:36:18 -0000 1.4
+++ serendipity_event_weblogping.php 11 May 2004 19:39:44 -0000 1.5
@@ -7,6 +7,8 @@
@define('PLUGIN_EVENT_WEBLOGPING_TITLE', 'Einträge ankündigen');
@define('PLUGIN_EVENT_WEBLOGPING_DESC', '(via XML-RPC ping)');
@define('PLUGIN_EVENT_WEBLOGPING_SUPERSEDES', '(ersetzt %s)');
+ @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':
@@ -17,6 +19,8 @@
@define('PLUGIN_EVENT_WEBLOGPING_TITLE', 'Announce entries');
@define('PLUGIN_EVENT_WEBLOGPING_DESC', '(via XML-RPC ping)');
@define('PLUGIN_EVENT_WEBLOGPING_SUPERSEDES', '(supersedes %s)');
+ @define('PLUGIN_EVENT_WEBLOGPING_CUSTOM', 'Custom ping-services');
+ @define('PLUGIN_EVENT_WEBLOGPING_CUSTOM_BLAHBLA', 'One or more special ping services, seperated by ",". The entries need to be formatted like: "host.domain/path". If a "*" is entered at the beginning of the hostname, the extended XML-RPC options will be sent to that host (only if supported by the host).');
break;
}
@@ -85,19 +89,50 @@
)
);
+ $manual_services = explode(',', $this->get_config('manual_services'));
+ if (is_array($manual_services)) {
+ foreach($manual_services as $ms_index => $ms_name) {
+ if (!empty($ms_name)) {
+ $is_extended = ($ms_name{0} == '*' ? true : false);
+ $ms_name = trim($ms_name, '*');
+ $ms_parts = explode('/', $ms_name);
+ $ms_host = $ms_parts[0];
+ unset($ms_party[0]);
+
+ $this->services[] = array(
+ 'name' => $ms_name,
+ 'host' => $ms_host,
+ 'path' => implode('/', $ms_parts),
+ 'extended' => $is_extended
+ );
+ }
+ }
+ }
+
$conf_array = array();
foreach($this->services AS $key => $service) {
$conf_array[] = $service['name'];
}
+ $conf_array[] = 'manual_services';
+
$propbag->add('configuration', $conf_array);
}
function introspect_config_item($name, &$propbag)
{
- $propbag->add('type', 'boolean');
- $propbag->add('name', $name);
- $propbag->add('description', sprintf(PLUGIN_EVENT_WEBLOGPING_PING, $name));
+ switch($name) {
+ case 'manual_services':
+ $propbag->add('type', 'string');
+ $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);
+ $propbag->add('description', sprintf(PLUGIN_EVENT_WEBLOGPING_PING, $name));
+ }
return true;
}
|