How to modify the archives plugin?

Creating and modifying plugins.
Post Reply
martina
Posts: 1
Joined: Thu May 05, 2005 10:07 am

How to modify the archives plugin?

Post by martina »

Hi everybody,
I hope this hasn't been answered already somewhere ;-)

My question: How can I modify the archives plugin? I've looked for the script, I think I even know where it is hidden, but I can't find a way modifying it (not knowing lots of php ;-)).

For example, I would like to change the wording (in German).
Then, I would like to display not a fixed number of months, but exactly those months which contain any entries of the current year. Then, maybe the last year and so on (not right now, as there aren't any entries, but I'm trying to think in advance ;-)).

Is there a way I can do this?

Thanks + regards
Martina
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: How to modify the archives plugin?

Post by garvinhicking »

The archives plugin can be found in the include/plugins_internal.inc.php file as serendipity_archives_plugin class.

But without PHP knowledge you won't be able to change it's features or appearance or wording.

Well, you can change the german wording by editing the lang/serendipity_lang_de.inc.php file and there modifying the language constants. But be sure to note which constants you edit, as when you upgrade Serendipity this file will be overwritten again.

To change only the months which contain entries you'd have to do several database lookups, which would cost a lot of performance, and which is the reason we didn't do it.

The amount of months can be changed in the plugin configuration of the plugin (you can choose X days/weeks/months).

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/
Post Reply