And here I was worried about comment spam

Sigh.... And here I had just finished an IP banning plugin for comment spam and I discover that I'm now getting trackback spam. Pornographic trackback spam, no less. And I didn't even bother to implement an interface for deleting trackbacks, much less blocking them. I guess I'll be doing that tomorrow. My apologies for the oversight.

So it looks like I've got another couple of plugins to implement before the next release. For one, I'll want e-mail notifications of trackbacks, so that I'll actually know when I get trackback spam. Second, I'll have to extend the comment banning to trackbacks. Third, I guess I'll have to start working on that keyword banning idea I was thinking of for comment spam.

Pretty URLs

LnBlog grew a new feature this week: pretty URLs. And it's about time, too. I never really worried too much about the URLs being largely numeric, but after a year of looking at my logs and my own links, trying to figure out what an entry was about, I've now changed my tune.

I think the solution I came up with is fairly simple. When an entry is created or edited, a PHP wrapper script will be created in the same directory as the entry. All the script will do is change to the entry directory and call the index.php file there. It will be named using the entry subject with all non-word characters (everything but numbers and letters) converted into underscores and a PHP suffix tacked onto the end. If this file exists, it will be used as the permalink for the entry. So, for example, the permalink for this entry will be http://www.skepticats.com/lnblog/entries/2006/01/Pretty_URLs.php. I'll probably make this configurable so that people can still use the old-style URLs (in part because I'm not sure how I should handle non-Latin subject text), but the new ones will be the default.

There are a two main benefits to doing it this way:

  1. There is no need for conversion. All the old URLs will continue to work.
  2. Permalinks will not break if you edit an entry's subject. A new script will be created using the correct subject text, and will be used as the permalink in the future, but the old one will continue to point to the same location.

I suppose I'll probably release the next version soon. I want to add a few other changes, including some more hooks into the way entries are displayed to make plugins easier to write. One thing I'd like to include in the next few releases is a comment spam plugin, although I haven't really needed one so far. I just need to lay the groundwork first.

LnBlog 0.5.2 is out

As promised, version 0.5.2 is now available. You can get it from the download page.

As I mentioned in the last post, new features include support for tags and an interface for configuring which plugins are loaded and in what order. You will have to log in to the administration pages and run an update on each blog for this.

In addition, I've added a bunch of options to various plugins. For instance, the title text for each sidebar section is now configurable and the title will be suppressed completely if you set it to the empty string. I also fixed up the "smooth" theme to the point where people might actually consider using it. It's a fixed-width layout with rounded corners that uses the same color scheme as the default theme. There were also a few other changes, including a bug fix for comment deletion. You can check the change log for details.

As usual, report any bugs, feature requests, or other questions by e-mailing me or leaving a comment. Merry X-mas!

Coming features

If you're exceptionally alert, you might have noticed that LnBlog has acquired a new feature: tags. Yes, you can now categorize your posts by topic. I've even added a sidebar plugin to allow readers to pull up all posts with a given tag. You can also view them as a single page, kind of like a sub-blog.

For anyone not familiar with the term "tag," tags are one of the hot things in "social software." They're basically just free-form categories. Rather than have some pre-defined list or hierarchy of categories, you just pick your category on the fly. If it's never been used before and is never used again, that's not a problem. If several categories seem appropriate, that's no problem either - just tag your item with all of them. It's a great way to communicate associations that might not fit any strict organizational model, but which could still be interesting to others.

However, that's not the reason I chose to add tags to LnBlog. The reason is that it was simply easy to implement. I figured it would be nice to have some sort of categorization system, but I didn't feel like writing an interface to add new categories. So I decided to just implement tags instead and do everything on the fly.

Working with tags in LnBlog is quite simple. When you create or edit an entry, there will be a text box to enter tags. You can enter anything you like in this box. If you want to tag the entry with multiple terms, just separate them with a comma. (Note: This can be changed with the TAG_SEPARATOR configuration constant.) So, for example, putting in "Linux,KDE,FreeDesktop.org" would tag an entry as being related to Linux, to KDE, and to FreeDesktop.org. When you search for any one of those tags, that post will show up. In addition, the blog itself will keep track of any tags you use and expose that list of tags for use by plugins. That's how the sidebar topics plugin works.

I'll probably have the next version with this feature up some time before Christmas. But first, I want to add another feature: a plugin loading configuration page. Basically, this will allow you to configure which plugins are loaded and set certain plugins to load first without having to mess around with moving or renaming the files. Currently, the interface for it isn't too pretty, but it's better than nothing. I'll polish it up in a future release.

LnBlog 0.5.1 released

I've just uploaded version 0.5.1 of LnBlog. You can get it from the download page. This release is mostly bug fixes, bug includes quite a few user-visible changes as well. See the change log for the details. Please note that this release adds a wrapper script, so you will have to log in to the admin pages and upgrade your blogs to the current version.

The first thing you'll notice is a change to the sidebar. I changed the login link to not blend in and look like a heading quite so much. I also changed the administration section of the sidebar that shows up after you log in so that it's now on top.

The second, and biggest, feature of this release is the addition of a basic plugin configuration page (which is why blogs need to be upgraded). Like most preferences in LnBlog, you can configure plugins globally (from the LnBlog admin pages) or for a particular blog. The configuration interface is still in the early stages, i.e. not very pretty, but it will allow you to set options for various plugins. These options will be stored in a plugins.ini file in either the blog root or the LnBlog userdata folder. Please note that all loaded plugins are displayed, but not all of them have configurable options. For the ones that don't, you'll just see a name, version, and short description.

Third, I modified some of the plugins to actually give them configurable options. For instance, the loginlink plugin can switch between displaying a link to the login page and displaying an actual login form, while the metadata plugin now lets you set keywords for a meta tag. There are a few other plugins with configurable options, but you get the idea.

Lastly, I've simplified the initial setup. This obviously won't help current users, but new users should like it. The file writing setup page now tries to autodetect the FTP root, so all you have to enter is a username and password. I've also removed most of the text, which, after looking closer at it, was kind of confusing. Since the file writing setup now has sensible error messages, I figured it was no longer needed. I think LnBlog can now claim to beat the WordPress 5 minute setup.

That's pretty much it for this version. As usual, if you have any questions, comments, or problems, please feel free to e-mail me or leave a comment on this post.

Javascript editor bug

Oops! I just discovered an error with the Javascript LBCode editor - it doesn't work! Apparently, I changed the form element names in the templates and scripts, but forgot to change the linked Javascript file. I hardly ever use the editor myself, so I guess I didn't notice.

Anyway, I'll probably put up a maintenance release before too long. In the mean time, you can download a fixed version of the script here. To install, just copy it into your LnBlog/themes/default/scripts/ directory, over-writing the old file.

LnBlog 0.5.0 released

OK, so I lied: this release is 0.5.0, not 0.4.1. Given the sheer volume of code changes, along with the addition of a major feature like internationalization, I figured a minor version number increment was more appropriate. It just didn't feel like a 0.4.1 anymore. As for all those times I mentioned version 0.5.0, just mentally change that to 0.6.0.

You can check the last two posts for more details regarding the changes. However, I'll summarize below anyway, if for no other reason than to justify changing my mind on the version numbering. For the gory details, refer to the ChangeLog.

  1. Internationalization support. We've got both gettext support and a home-brewed fallback system that uses the same interface.
  2. A sidebar calendar plugin to replace the archive month list.
  3. Some added navigation links and features for the archive pages
  4. A new userconfig.cfg text file to override default configuration constants.
  5. Lots of developer documentation with Natural Docs.
  6. Started migrating user documentation to Natural Docs.
  7. Cleaned up redundant templates.
  8. Improved file writing setup. The setup script will now attempt to guess the FTP root if one is not entered.
  9. Made logins stick between blogs.
  10. Lots of bug fixes. Once again, thanks to WGM for the all bug reports and feedback on i18n issues.

As usual, you can get the latest release from the download page. You can also download the new documentation from that page or view it here. If you have any problems, questions, or comments, feel free to e-mail me or leave a comment on this post.

Behold, a working calendar

You may notice that now the sidebar calendar actually works. It even looks fairly decent, if I do say so myself. In fact, it has now taken the place of the old archives section because, let's face it, the old one wasn't that attrcative or useful.

One thing which, I think, makes the calendar a bit more useful than the old archives section is that it's actually smart. I added auto-detection of the month and year of the current post, if any, so it'll actually show you the month you're looking at. It also has lots of links to the archive pages. In addition to the main archive and entry list links at the bottom, the month and year in the heading are also links to the corresponding archive pages. All in all, I think it's a pretty nice setup, mixing a clean appearance with lots of information. But, then again, I'm not exactly an unbiased observer, am I? ;)