Structured Blogging

Creating and modifying plugins.
Post Reply
sir17
Regular
Posts: 8
Joined: Tue Feb 28, 2006 2:55 pm
Contact:

Structured Blogging

Post by sir17 »

Hi all,
I love Serendipity and am running my blog as well as several other projects on it.
I was introduced to structured blogging / microformats recently, and might spend time on helping with the standards. I'm convinced this is gonna take off soon. See http://www.structuredblogging.org/.
So there are plugins for Wordpress and MT so far and I thought it would be great to have this for Serendipity too. I'm not the greatest developer and don't have much spare time at the moment, so I was wondering how hard it would be to take these open source scripts and integrate them into Serendipity. Just wanted to put it out there and see if other people are sharing my thoughts and if someone might be interested in taking this on.

Cheers,
Chris
azel
Regular
Posts: 265
Joined: Thu Apr 21, 2005 4:28 am
Contact:

Post by azel »

I think it sounds pretty neat. Maybe some of the code gurus around here will tackle it. :D
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Yes, we've had this some time ago:

http://www.s9y.org/forums/viewtopic.php ... d+blogging

Since then I have not yet looked again at the WP code, but at that time it was a nightmare I was refusing to adapt.

Basically, s9y is all ready for it, and plugins should be portable to s9y and work there easier than in WP. I'm willing to help any developer on this who wants to have a go at it, and will answer any question regarding that and try to help as good as possible. But I can't do it myself, my time schedule is too loaded right now.

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/
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Let's get to work

Post by mattsches »

I've also been thinking about adding some microformats functionality - especially hReview - to my blog, but I'm still uncertain how to approach this. Maybe with an optional popup window where I can enter the review info? I would appreciate any input on this.

For a start, I decided to add basic hcard and/or XFN features to my link list/blogroll which turned out to be really simple. I changed two lines in serendipity_plugin_linklist.php and extended the XML that is fed to the plugin with two custom attributes. Now my links look something like this (in reality, I haven't met Garvin; this is just an example; and it's not yet in my live blog):

Code: Select all

<li class="menuitem vcard">
<a class="link url fn" rel="friend met" href="http://www.supergarv.de/"  target="_self" title="Garvin Hicking">Garvin Hicking</a>
</li>
So, if anyone is interested in this ...?

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

Re: Let's get to work

Post by garvinhicking »

Hi!

I personally would not favour a popup solution, but more "collapsing" field in the "Extended Properties" section when creating an entry?

Basically, much like the freetag-plugin, only with more fields?
So, if anyone is interested in this ...?
Definitely! Pleas send patches/code :)

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/
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Re: Let's get to work

Post by mattsches »

garvinhicking wrote:I personally would not favour a popup solution, but more "collapsing" field in the "Extended Properties" section when creating an entry?

Basically, much like the freetag-plugin, only with more fields?
Sounds reasonable ... I will experiment with your approach.

One more idea is that I'd like to put editable templates for several microformats into the plugin folder. That's because I initially used the hReview Creator for my first steps but wasn't satisfied with the generated code. So if we use templates with placeholders, users would have a greater degree of freedom.

I'll keep you updated with my progress, and also will be glad to send you patches as soon as I'm happy with my changes...:wink:

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

Re: Let's get to work

Post by garvinhicking »

Hi!

That sounds great, keep it coming :)

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/
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

hCard patch and usage

Post by mattsches »

So, as I said I made a simple patch for adding basic hcard data to s9y_event_linklist. This method only works with the two CSS-based link lists, though. DTree is not yet supported: We could ask the dtree maintainers to add hCard support, but OTOH I'm not sure if it makes sense anyway because the JS won't get parsed by search engines or applications, right?

Here's the patch for serendipity_event_linklist.php:

Code: Select all

87,88c87,88
<                     $propbag->add('default', '<dir name="PHP">'."\n".'  <dir name="Official PHP Sites">'."\n".'    <link name="PHP" link="http://php.net/" />'."\n".'    <link name="Zend" link="http://zend.com/" />'."\n".'  </dir>'."\n".'  <link name="Serendipity" link="http://s9y.org/" />'."\n".'</dir>'."\n\n".'<dir name="Friends">'."\n".'  <link name="Garvin Hicking" link="http://www.supergarv.de/" />'."\n\n".' <link name="Matthew Groeninger" link="http://www.theledge.net/" />'."\n\n".'</dir>'."\n\n".'<link name="OXYGEN Web Solutions" link="http://oxygenws.com/" />');
<                     $propbag->add('lang_direction', 'ltr'); 
---
>                     $propbag->add('default', '<dir name="PHP">'."\n".'  <dir name="Official PHP Sites">'."\n".'    <link name="PHP" link="http://php.net/" />'."\n".'    <link name="Zend" link="http://zend.com/" />'."\n".'  </dir>'."\n".'  <link name="Serendipity" link="http://s9y.org/" />'."\n".'</dir>'."\n\n".'<dir name="Friends">'."\n".'  <link name="Garvin Hicking" link="http://www.supergarv.de/" hcard="fn" rel="friend" />'."\n\n".' <link name="Matthew Groeninger" link="http://www.theledge.net/" hcard="fn" rel="friend" />'."\n\n".'</dir>'."\n\n".'<link name="OXYGEN Web Solutions" link="http://oxygenws.com/" />');
>                     $propbag->add('lang_direction', 'ltr');
387c387
<                         $basic_array = array('linkloc'=>$this->decode($struct[$i]['attributes']['LINK']),'name'=>$this->decode($struct[$i]['attributes']['NAME']),'descr'=>$this->decode($struct[$i]['attributes']['DESCR']),'level'=>$level_pass,'dirname'=>$dirname);
---
>                         $basic_array = array('linkloc'=>$this->decode($struct[$i]['attributes']['LINK']),'name'=>$this->decode($struct[$i]['attributes']['NAME']),'descr'=>$this->decode($struct[$i]['attributes']['DESCR']),'level'=>$level_pass,'dirname'=>$dirname,'hcard'=>$this->decode($struct[$i]['attributes']['HCARD']),'rel'=>$this->decode($struct[$i]['attributes']['REL']));
538,539c538,539
<             $strtemp .= '<li class="menuitem">';
<             $strtemp .= $image_string.$page_icon.'<a class="link" href="'.$link['linkloc'].'" '.$target_string.' title="'.$link['name'].'">'.$link['name'].'</a></li>'."\n";
---
>             $strtemp .= '<li class="menuitem'.(($link['hcard'])?' vcard':'').'">';
>             $strtemp .= $image_string.$page_icon.'<a class="link'.(($link['hcard'])?' url '.$link['hcard']:'').'" '.(($link['rel'])?'rel="'.$link['rel'].'"':'').' href="'.$link['linkloc'].'" '.$target_string.' title="'.$link['name'].'">'.$link['name'].'</a></li>'."\n";
Usage is simple, in the linklist options, just extend the entries like this:

Code: Select all

<link name="Garvin Hicking" hcard="fn" rel="friend" link="http://www.supergarv.de/" />
I hope I didn't forget anything ...
- Mattsches
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: hCard patch and usage

Post by garvinhicking »

Hi!

Applying this patch fails; could you make a unified diff ("-u") and store the patch on http://nopaste.php-q.net ?

Thanks a lot,
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/
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

I just pasted the whole file to here, so will have to make the diff yourself, sorry. I don't have an adequate diff command right here on my Win box :(
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Thanks, committed.

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/
mattsches
Regular
Posts: 440
Joined: Sat Nov 05, 2005 9:35 pm
Location: Wiesbaden, Germany
Contact:

Post by mattsches »

There's now a microformats plugin that partially supports the standards set up by the structured blogging initiative. If you're interested in this, please follow this thread.
Post Reply