The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index Plugins Avatar Plugin patched for Identicon/Ycon

Creating and modifying plugins.
User avatar
mo
Regular
 
Posts: 40
Joined: Mon Jan 28, 2008 12:33 am

Postby mo » Mon Jan 28, 2008 12:55 am

As this is my first post I have to thank everyone in this community for S9Y! Especially the clean hook principle is brilliant... I don't want to go the route of patching core files just for language changes ever again (Wordpress...).

For my weblog, I have patched the avatar plugin to support so-called Identicons (which is also the basis for MonsterID, but I like the abstract icons better), more specifically a PHP implementation called "Ycon" by Ben Hendel-Doying.

Example Avatar:
Image

I am not sure about the policy of S9Y regarding patches. I especially don't want to ruin the great centralized update service. There are only a few things I've patched to add Ycon support (locally generated; basically copy/paste of MonsterID calls).

Modifications:
- a new switch case for 'identicon' in two places
- inserted fetchYcon() function right below fetchMonster()
- ycon directory with ycon library

You can download a patched version 1.39 of the plugin here: http://www.wiredwings.com/download/sere ... atched.zip

I did not modify the maximum number of slots and I don't think it is necessary as either MonsterID or Identicon will always work. I wasn't sure how to handle the version number, so I haven't changed anything there either; that way, auto-updates will probably overwrite the customizations. Can anyone tell me how to do it in a clean way? Rename the plugin, change version numbers?

Of course I'd be happy to contribute this to the official plugin.

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

Postby garvinhicking » Mon Jan 28, 2008 1:33 pm

Hi!

Many thanks for your praise. :)

I just committed your patch, this is the best way. If you ever change a plugin locally and want to preserver that, be sure to raise your version number to something really high, then your local changes will not be overwritten. However, this also disables the version check so you'll never get new updates.

Thus, the real best way is to keep the original version intact, and when a new plugin is announced in your plugin configuration, backup your old plugin, load the new plugin and then apply your changes. If you can, use CVS on your local server to track your own changes to the files. Or, like you did, submit your patches so we can make them official. :)

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/

User avatar
mo
Regular
 
Posts: 40
Joined: Mon Jan 28, 2008 12:33 am

Postby mo » Tue Jan 29, 2008 6:01 pm

Wow, thanks, that was fast. What we didn't update are the various descriptions...



Return to Plugins

Who is online

Users browsing this forum: No registered users and 2 guests