Page 1 of 1
serendipity_event_weblogping/ serendipity_event_xmlrpc
Posted: Mon Mar 13, 2006 2:46 am
by tom
to use
serendipity_event_xmlrpc with installed
serendipity_event_weblogping you have to change the following lines in
serendipity_event_weblogping.php
From:
Code: Select all
case 'backend_publish':
include_once(S9Y_PEAR_PATH . "XML/RPC.php");
To:
Code: Select all
case 'backend_publish':
if (!class_exists('XML_RPC_Base')) {
include_once(S9Y_PEAR_PATH . "XML/RPC.php");
}
Regards,
Tom
Re: serendipity_event_weblogping/ serendipity_event_xmlrpc
Posted: Mon Mar 13, 2006 11:34 am
by garvinhicking
Hi!
Thanks for telling this, I fixed and committed your change to the SVN!
Regards,
Garvin
Posted: Mon Mar 13, 2006 11:08 pm
by tom
btw this patch just prevents the weblogping-plugin to run into an error when publishing a entry by xmlrpc-plugin
Anyway the weblogping-plugin won't announce any new entries sent by xmlrpc-plugin.
This is because of the way this plugin verifies which services should be informed.
Code: Select all
if (isset($serendipity['POST']['announce_entries_' . $service['name']])) { …
It verifies POST-Values of the checkboxes used in the backend interface.
Not sure how to solve this best.
Here just a quick hack which should work. At least it seems to work for me
Code: Select all
if (isset($serendipity['POST']['announce_entries_' . $service['name']]) ||
($this->get_config($service['name']) == 'true' && !isset($serendipity['POST']))) { …
Any suggestions how to solve this in a good manner?
Regards,
Tom
Posted: Tue Mar 14, 2006 12:24 pm
by garvinhicking
The "cleanest way" would be to use the "SERENDIPITY_IS_XMLRPC" constant that the xmlrpc plugin defines.
When that constant is defined, the weblogping plugin knows that it is in "XMLRPC" mode, and then it can send the ping to all configured services.
I just committed that to SVN trunk:
Code: Select all
if (isset($serendipity['POST']['announce_entries_' . $service['name']]) || (defined('SERENDIPITY_IS_XMLRPC') && serendipity_db_bool($this->get_config($service['name']))) {
I also changed the bottom part to:
Code: Select all
if ($xmlrpc_result->faultCode()) {
$out = sprintf(PLUGIN_EVENT_WEBLOGPING_SEND_FAILURE . "<br />", htmlspecialchars($xmlrpc_result->faultString()));
} else {
$out = PLUGIN_EVENT_WEBLOGPING_SEND_SUCCESS . "<br />";
}
if (!defined('SERENDIPITY_IS_XMLRPC')) {
echo $out;
}
So that in XMLRPC mode no HTML is emitted.
HTH,
Garvin
Posted: Tue Mar 14, 2006 1:05 pm
by tom
Aahhh perfect,
I had a look for some constant like this but didn't find it, why ever...
Thanks a lot,
tom