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 » Sat May 13, 2006 5:48 pm

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

User avatar
azel
Regular
Posts: 265
Joined: Thu Apr 21, 2005 4:28 am
Contact:

Post by azel » Sun May 14, 2006 12:10 am

I think it sounds pretty neat. Maybe some of the code gurus around here will tackle it. :D

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking » Sun May 14, 2006 2:56 pm

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 » Tue Jul 11, 2006 12:46 pm

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

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Let's get to work

Post by garvinhicking » Tue Jul 11, 2006 12:51 pm

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 » Tue Jul 11, 2006 2:22 pm

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

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Let's get to work

Post by garvinhicking » Tue Jul 11, 2006 2:46 pm

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 » Mon Jul 17, 2006 12:28 pm

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

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: hCard patch and usage

Post by garvinhicking » Mon Jul 17, 2006 2:23 pm

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 » Mon Jul 17, 2006 2:33 pm

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 :(

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking » Mon Jul 17, 2006 4:34 pm

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 » Mon Sep 04, 2006 11:28 pm

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