Sep 04

Decorative Caps Version 1.2

Just a minor tweak to Decorative Caps, but with Marco’s continued input, the options for Decorative Caps have been modified slightly, and version 1.2 is now available for download.

Version 1.1 offered a dropdown to specify using the caps on “Home Page and Individual Posts” or just “Individual Posts only”. As Marco pointed out, this didn’t allow for pages to use the plugin at all (in fact, I was hard-coding the plugin to skip pages entirely).

This has been changed to three checkboxes on the Options page now:

  1. Home Page
  2. Individual Posts
  3. Pages

Thanks again, Marco, for great input!

One thing to note with these options. I’m sure that it’s possible to figure this out, but for right now, I haven’t been able to do this. If you have used the option to have a static home page, WordPress doesn’t seem to recognize that with the is_home() function. If anyone has any thoughts on how to detect if a page is the static home page, I would appreciate it.

For now, if you have a specified page as the home page, the “home page” option in Decorative Caps really does nothing at all.

Sep 01

Decorative Caps Version 1.1 Released

I have replaced the download of the Decorative Caps plugin with version 1.1 so if you have an older version, you may want to download it again.

The following changes have been made:

  • An options page has been added to allow the user control over most facets of the image display
  • User can create a class in their own CSS stylesheet, if they wish, and specify that class name to be used for the image display. Note: If you specify a class name, all other CSS options (height, width, etc.) are ignored, so make sure you specify all of those options in the CSS class you have created.
  • An option exists now (thanks to Marco who commented on the original version of the plugin!) to specify whether the Decorative Caps should appear on both the home page and post pages, or just individual post pages.

For more information and to download the plugin, visit the plugin’s page.

Mar 29

AJAX Archives in Process

I’m currently working on developing an AJAX-ified display of archives for sidebar usage. I’m kind of surprised that I haven’t seen anything like this yet. The only AJAX archives that I’ve seen results in a multi-column display that is way too wide for sidebar usage.

What I’m interested in doing is something very similar to what the latest version of Blogger does. With that in mind, if anyone has any ideas on what they would like to see in that functionality, please leave a comment and let me know.

Or, if you already know of one similar, let me know, since I obviously haven’t found it yet.

And stay tuned for the release of this plugin just as soon as I get it finished!

Feb 01

Decorative Caps

You can see this plugin in action right here at the beginning of this post. Notice how the “Y” is a fancy image of a “Y”? This is a plugin that I call Decorative Caps and is now available for download.

Update September 1, 2007: Version 1.1 has been released. The major change in this version is that an options page has been created to allow the user control over the CSS styling of the image (height, width, padding, etc.), specify a CSS class if you want to use a class from your stylesheet instead of the plugin settings, and specifying whether you want to use the decorative cap only on the post pages or on the front page as well.

Update September 4, 2007: Version 1.2 has been released. A minor change in the options page allows for a bit more control over where the decorative caps appear on your blog (home page, individual posts, individual pages).

Installing and using is very easy:

  1. Download Decorative Caps
  2. Unzip the file into your wp-content/plugins folder (this will create a directory called “scs-decorative-caps” which contains the plugin PHP page and the folder with the image files in it)
  3. Activate the plugin and view the results on your site!
  4. (New in version 1.1) Use the “Decorative Caps” options page in your admin interface to control the CSS styling of the image and specify some other options as well.

The image files that I used are from Leo’s Icon Archive (click on “Decorative Caps” on the left-hand side when you get there), and are freely available. If you wish to use different image files, the only specifications to work with this plugin would be:

  1. Image must be square in dimension (equal width and height)
  2. Image width and height must be at least 35 pixels, to avoid any degradation of the image (if you use a smaller image, make sure that you specify the correct dimensions in the options)
  3. Image names must be single lower-case letters followed by “.gif” in all lower-case (i.e., “a.gif, b.gif, etc.”)

Simply replace the images in wp-content/plugins/scs-decorative-caps/images with your own image files and the result will be immediate.

Note: This plugin does some very rudimentary checking to make sure that the first character is really an alpha character. It’s by no means perfect, and I have observed the following behavior:

If the first element is the start of a tag (for example <p>), the code looks to the first character beyond that. However, if the first character is a space, or if the first character beyond the opening tag is another tag, the plugin stops trying to find an initial letter in that particular post.

I’m not precisely sure how best to figure in all the possibilites. But this should work fine for you if you generally start your post with text (or at best an opening paragraph tag). Any thoughts?

Feb 01

HTML Email for Comments, Trackbacks, etc.

I recently attempted my first plugin for WordPress. It’s nothing fancy, but it does something that I was unable to find elsewhere. On the recommendation (and with the tremendous help of) Otto42 on the WordPress support forums, I was able to accomplish my task!

When someone comments on my WordPress blog, WP sends me an email with the comment in it (typical of most blog systems). However, the emails were in plain text, so I didn’t see any formatting any of my commenters used. I also have a Scripturizer plugin installed that automatically converts Scripture references to links to BibleGateway’s site, and those couldn’t show up in the plaintext emails, either.

I looked quite a few times for something to convert those emails to HTML format, but to no avail. Finally, I posted on the support forums about it, and Otto42 told me that it could be accomplished by a plugin, and gave me the instructions on how to override pluggable functions in WP.

It only took a few hours to get the basic concept down, and after quite a bit of tweaking, I think I finally have it the way I want it.

Please bear in mind that this is my very first plugin ever, so there may be some things that need to be modified on it. There are absolutely no options to be set on this plugin yet, so it’s simply a plugin file to be installed and activated. Here are the instructions:

  1. Download the HTML Admin Email plugin here.
  2. Unzip the file (there is only one file in the zip archive) into your wp-content/plugins folder.
  3. Log in to your blog’s admin interface, click on Plugins, and activate the “HTML Admin Email” plugin.

That should be all there is to it. Next time someone leaves you a comment, trackback, or pingback, you should receive an HTML-formatted email with the formatting of the comment intact (provided that you already have your blog configured to email you comments, etc.).

This plugin is still very new, so I have labelled it as version 0.8. If I get some feedback on it, and end up making changes and creating an options page for it, I will make a 1.x version and make it really official. For now, though, please consider this as something of a beta. Any comments are quite welcome! :)

Update 2/4/07: I’m having very intermittent success (read: almost constant failure) with this plugin in version 2.1. I have no idea why, but it seems to be ignoring my plugin completely on all but 1 comment email. Hopefully I’ll be able to figure this out soon. Stay tuned!

Update 2/5/07: The problem actually was with Spam Karma 2, which also declares a function called wp_notify_postauthor to override the pluggable function. If you are running any kind of spam filter plugin, you may have a similar problem. You have two options, as I see it: 1) Delete the function from the spam plugin so that this one gets called, or 2) replace the function in the spam plugin with the one in my plugin. Either way can be tricky, and you will lose whatever functionality the other plugin wrote into that function.

Thanks!

steve :)