Blogging using XMLRPC plugin

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
el10t
Regular
Posts: 14
Joined: Tue Jun 20, 2006 8:01 pm

Blogging using XMLRPC plugin

Post by el10t »

Hello again everyone

I have an S9Y installation to which I sometimes blog using Flickr and the xmlrpc plugin. However, blog entries made in this way do not allow comments to be added. Is there any way to make such entries automatically allow comments?

Many thanks,
Rich
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Blogging using XMLRPC plugin

Post by garvinhicking »

Hi!

Which version of the xmlrpc plugin are you using? If I remember correctly this had been a bug in the past, but should've been fixed in recent versions.

I think it honours your personal preference in the s9y panel where you can enter the Default setting for allowing comments to new entries.

Best 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/
el10t
Regular
Posts: 14
Joined: Tue Jun 20, 2006 8:01 pm

Post by el10t »

Hi Garvin
It's version 1.23
My personal settings are set to allow comments by default.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I just checked the code; serendipity sets the "allow_comments" to either what is in $serendipity['allowCommentsDefault'] (which is retrieved from your personal settings) or if your XMLRPC client submits it via the "mt_allow_comments" flag. Can you check if your client has such a flag to indicate how to submit this key?

Best 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/
el10t
Regular
Posts: 14
Joined: Tue Jun 20, 2006 8:01 pm

Post by el10t »

Thanks Garvin,

Unfortunately within Flickr there appears to be no way to set the mt_allow_comments flag. Is this something I can simply hard-wire into the code in the module?

Cheers,
Rich
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Yes, you should be able to easily edit that in code. Just open your serendipity_xmlrpc.inc.php file of the plugin directory and search for

Code: Select all

    if (isset($post_array['mt_allow_comments'])) {
        $entry['allow_comments'] = $post_array['mt_allow_comments'];
    } else {
        $entry['allow_comments'] = $serendipity['allowCommentsDefault'];
    }
replace that to:

Code: Select all

        $entry['allow_comments'] = true;
And search for

Code: Select all

$entry['allow_comments'] = $post_array['mt_allow_comments']? true : false;
and replace that to:

Code: Select all

$entry['allow_comments'] = true;
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/
el10t
Regular
Posts: 14
Joined: Tue Jun 20, 2006 8:01 pm

Post by el10t »

Thanks Garvin!

I have to say I'm amazed at the excellent and quick support you provide for this product. Well done!

:D
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

You're welcome :)) Have fun!

Best 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/
kris
Regular
Posts: 14
Joined: Mon Aug 14, 2006 10:01 am
Contact:

Post by kris »

Hi Garvin
I followed the instructions you gave to be able to see the comments from flickr photos. Now I have another problem:
in flickr you can alter the title of a photo before one sends the blog post - but in my blog the altered title will not show instead the blog shows original title....

is that a bug from flickr or from our serendipity_xmlrpc.inc.php-file?

thanks for a tip

kris
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Sadly this issue is with Flickr - it sends the wrong XML data to the plugin, so it submits/uses the wrong picture title/data. But tell the guys, I'm sure they can be of help to fix that!

Best 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/
koltregaskes
Regular
Posts: 59
Joined: Tue Jan 30, 2007 8:31 am
Location: Thatcham, Berkshire, UK
Contact:

Post by koltregaskes »

Hi there,

I'm also after the comments from flickr pages. below is the code for my serendipity_xmlrpc script, what do I need to do for it to allow flickr comments?

Code: Select all

<?php # $Id: serendipity_xmlrpc.php 386 2005-08-11 09:28:54Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved.  See LICENSE file for licensing details

require_once 'serendipity_config.inc.php';

$data = array();
serendipity_plugin_api::hook_event('frontend_xmlrpc', $data);

if (count($data) == 0) {
    die(XMLRPC_NO_LONGER_BUNDLED);
}
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

You're looking at the wrong file, you need to check the PLUGIN file plugins/serendipity_event_xmlrpc/serendipity_xmlrpc.inc.php :)

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/
koltregaskes
Regular
Posts: 59
Joined: Tue Jan 30, 2007 8:31 am
Location: Thatcham, Berkshire, UK
Contact:

Post by koltregaskes »

Aahh, thank you. As mentioned above thanks for the quick replies, it's really appreciated, especially from a 'free' product. Some paid-for product vendors should take note.

Thanks again, don't know what I've done but my newspaper template seems screwy (this is before I changed this file) but that's for another thread perhaps.

Kol
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi Kol!

You're welcome! :) Have fun, and thanks for the nice words

Best 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/
koltregaskes
Regular
Posts: 59
Joined: Tue Jan 30, 2007 8:31 am
Location: Thatcham, Berkshire, UK
Contact:

Post by koltregaskes »

Hi again,

OK, not sure what I done (yes again), now I cannot blog anything from Flickr. I've deleted my settings on Flickr and tried to set it up again, I've used the following as API endpoint (which is exactly what I used previously that used to work):

http://www.squashyfrog.com/blog/serendipity_xmlrpc.php

The error I get is that the end point is not correct.

Any ideas?

Kol
Post Reply