serendipity_event_weblogping/ serendipity_event_xmlrpc

Found a bug? Tell us!!
Post Reply
tom
Regular
Posts: 5
Joined: Fri Sep 30, 2005 6:19 pm
Contact:

serendipity_event_weblogping/ serendipity_event_xmlrpc

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: serendipity_event_weblogping/ serendipity_event_xmlrpc

Post by garvinhicking »

Hi!

Thanks for telling this, I fixed and committed your change to the SVN!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
tom
Regular
Posts: 5
Joined: Fri Sep 30, 2005 6:19 pm
Contact:

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
tom
Regular
Posts: 5
Joined: Fri Sep 30, 2005 6:19 pm
Contact:

Post by tom »

Aahhh perfect,
I had a look for some constant like this but didn't find it, why ever... ;)

Thanks a lot,
tom
Post Reply