Random Entries and Edit Link plugins

Creating and modifying plugins.
Post Reply
kidgoo
Regular
Posts: 71
Joined: Thu May 12, 2005 6:53 am

Random Entries and Edit Link plugins

Post by kidgoo »

Hi all.

After running into problems with installing a plugin and not knowning how to debug the plugin system, I decided to familiarize myself with the plugin API. Below are the two simple plugins I wrote to do this, but that others may find useful. As far as I know, these features aren't offered by other plugins, but even if they are, it was still a good learning experience ;)

Random Entries is a sidebar plugin that will display a configurable number of random entries with configurable min and max ages. It was inspired by the History plugin.

Edit Link is an event plugin that appends an Edit option to entries in extended view. It is based on the Delete Link plugin.

The plugins can be found at http://brett.narnarnar.com/s9y_devel/, with examples at my blog. To install, just download and unzip them inside your plugin/ dir, then configure them through the admin interface.

Let me know if they work for anyone besides me!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Random Entries and Edit Link plugins

Post by garvinhicking »

Would you like to get a CVS account to add your plugins to our repository?

The moodplugin looks well crafted!

About the other two: Would you care to implement your "Random Entries" functionality into the history plugin as another option?

And the "edit link" could be implemented as an option into the "delete link" plugin maybe?

This way we wouldn't swamp too many plugins, but still have the extra functionality?

I'd be very happy if you would allow us to integrate your efforts into our repository; if you wish to do so, please just create yourself a SourceForge.net useraccount and tell me your name, then I'll add you as a plugin developer with CVS karma. Are you familar with CVS? If not, it's really easy, I'll give you brief instructions.

One thing about your mood plugin: You use "`" characters to escape fieldnames, but this is not supported in SQLite or POstgreSQL. Your plugin should otherwise work fine with those systems, so if you just remove the `characters the plugin should run well there?

Many thanks for your help,
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/
kidgoo
Regular
Posts: 71
Joined: Thu May 12, 2005 6:53 am

Re: Random Entries and Edit Link plugins

Post by kidgoo »

garvinhicking wrote:Would you like to get a CVS account to add your plugins to our repository?

I'd be very happy if you would allow us to integrate your efforts into our repository; if you wish to do so, please just create yourself a SourceForge.net useraccount and tell me your name, then I'll add you as a plugin developer with CVS karma. Are you familar with CVS? If not, it's really easy, I'll give you brief instructions.
Sure! I already have an account there, and have actually filed a couple bugs for s9y ;) I'm rukasu.
garvinhicking wrote:The moodplugin looks well crafted!

About the other two: Would you care to implement your "Random Entries" functionality into the history plugin as another option?

And the "edit link" could be implemented as an option into the "delete link" plugin maybe?

This way we wouldn't swamp too many plugins, but still have the extra functionality?
I had considered just modifying the existing plugins, but wanted experience creating a new one. Now that I know the basics, I'll go ahead and combine my stuff with the other ones.

The mood plugin is still pretty rough...a result of a day long code fest once I got into using the plugin system. For example, the way I'm doing positioning is pretty horrible. I'd like to change it to use smarty templates, but don't really have any idea where to start, or if it's even possible...Suggestions?
garvinhicking wrote:One thing about your mood plugin: You use "`" characters to escape fieldnames, but this is not supported in SQLite or POstgreSQL. Your plugin should otherwise work fine with those systems, so if you just remove the `characters the plugin should run well there?
huh...I didn't know that. Thanks! I'll change it. Anything else you see that's off, don't hesitate to mention it.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Random Entries and Edit Link plugins

Post by garvinhicking »

Kidgoo,

great - I've just added you as a plugin dev. :)

Just take a go at updating the old plugins then. It seems you have a pretty solid knowledge of the most important plugin API specs now. :)

About implementing Smarty: This would be a very good idea. You can look at the "contactform" plugin, this makes use of its own Smarty templates. As you seem to got pretty well along looking at other plugins you will surely get the trick out of it. And if not, feel free to ask. I'm always glad to see new people getting around to play with our API. :)

I'll try to look at your code when I find some time, but nothing obvious came to my attention apart frmo the ` quote thing :)

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/
kidgoo
Regular
Posts: 71
Joined: Thu May 12, 2005 6:53 am

Re: Random Entries and Edit Link plugins

Post by kidgoo »

Alright! I've added mymood to the additional_plugins module...I assumed that's where you wanted it? If not, I'll move it...

I've updated the deletelink and history plugins, but I don't have the karma to commit to the history plugin. You can grab my changes here.

Thanks,
Brett
kidgoo
Regular
Posts: 71
Joined: Thu May 12, 2005 6:53 am

Re: Random Entries and Edit Link plugins

Post by kidgoo »

kidgoo wrote:Alright! I've added mymood to the additional_plugins module...I assumed that's where you wanted it? If not, I'll move it...

I've updated the deletelink and history plugins, but I don't have the karma to commit to the history plugin. You can grab my changes here.

Thanks,
Brett
Garvin,
I just realized that I changed that link not long after I posted it to keep people from using older versions of the mood plugin. My changes haven't been committed to CVS yet, so I assume you couldn't get the file...sorry about that!

You can grab it here now.

Thanks,
Brett
Post Reply