LnBlog 0.6.2, "No Need to delete"

I've uploaded release 0.6.2 of LnBlog. This is another bug-fix release. Thanks to R. Damon for reporting several of the issues. Here's the list of fixes:

  1. Fixes bug that broke support for PHP 5.
  2. Fixes warning messages about DOCUMENT_ROOT in initial setup.
  3. Fixes broken links in terminal theme.
  4. Fixes problem with deleting entries when history is disabled (which is the default since version 0.6.0).

You can get the new version here or from the download page. As usual, please mail me or leave a comment if you have any questions or find any bugs.

LnBlog 0.6.1 is up

I finally got around to uploading the first maintenance release for LnBlog 0.6. You can get it from the download page. My apologies for not getting it out there sooner, but I've been pretty busy lately and just haven't had time to work on this project.

This fixes several bugs in the 0.6.0 release. These bugs include:

  • Bad user profile links in comments.
  • Comments not being added when posting from pretty permalink page.
  • The "post a comment" link not showing up in tuxice theme.
  • The "remember me" feature for comments not working.

As usual, please e-mail me or leave a comment if you have any questions, feedback, or if you find any other bugs.

LnBlog 0.6.0 - No Need for passwd.php

LnBlog 0.6.0, "No Need for passwd.php," is now available. You can just grab the archive here or get it from the download page along with checksums and signature. The current documentation is available online or for download. The upgrade procedure is simply the usual process of uploading the new version and copying your existing userdata directory into it.

This release includes a number of new features as well as some file format changes. I'll start with the new features, since they're the point of interest for most people. For the full list of changes, please consult the change log.

The most obvious change is the addition of a native search plugin in the sidebar. The old search plugin (which is still included, but disabled by default) just ran your query through Google, which obviously didn't work if your site hadn't been indexed by Google. The new search utility will simply scan all blog entries for the strings in the search box. You can simply separate all your search terms by spaces and it will return a list of all entries that contain all the terms. Alternatively, you can search using a regular expression by enclosing the expression in slashes (e.g. /micro.*/ would find references to Microsoft.). Note that all searches are case-insensitive.

The next big user-visible change is that the JavaScript post editor has been reworked. First, the controls are smaller and look nicer, plus you can click the (+) and (-) links to hide them. Second, the dual text and attribute boxes for entering the markup are now gone. When you click an editor button, a JavaScript popup will prompt you for the text, just as in most other JavaScript editors. (Anybody who actually liked the text box approach can re-enable it by adding EDITOR_SHOW_INLINE_BOXES=1 in your userconfig.cfg file.) Also, if you select some text and then click an editor button, it will simply apply the markup to that text, e.g. select a word and click the bold button to apply bold tags. Last, you'll notice a section, hidden by default, which contains buttons that add HTML entities for various mathematical symbols. I added these because I wanted them, so feel free to ignore them. You can even turn them off by adding EDITOR_SHOW_SYMBOLS=0 in your userconfig.cfg file.

The last big new feature is the addition of user profiles. When you click on the name of a post owner, it will now take you to that person's user profile. This is just a page that displays the person's name, e-mail address, homepage, etc. You can also upload files to your profile and add custom HTML markup to the end of it. All this is done through the "Edit user information" page linked in the sidebar.

In addition to the basic profile information mentioned above, you also have the ability to add custom fields to be displayed in profiles. This is done by creating a profile.ini file, which has the format:
[profile fields]
fieldname=Description of the field
secondfield=Another field description

You can put this either in your userdata folder, in which case the custom fields will apply to all users, or in a single user profile directory, which will make them apply to only that user.

Note that the addition of user profiles also means a change in the files used to store user information. In other words, the LnBlog/userdata/passwd.php file is no longer needed. New account information will be stored under the user's profile directory. The password information will be in a passwd.php file and the other profile information in a user.ini file. Note that reading the old passwd.php file is still supported, so there is no need to run any kind of update utility. When you edit a user's profile, it will be automatically converted to the new format.

There is also another file format change. The blog data is now stored in a blogdata.ini file. This probably seems pretty pointless, but the general idea here is to try to gradually move away from the plethora of ad hoc file formats that I started with. As with the user information, reading the old blogdata.txt file is still supported, so there's no need to do anything special. The next time you edit your blog settings, the file will be automatically converted to the new format.

Before I forget, I should probably mention the other noticeable changes in this version. First, there's now a blog setting for the default markup mode (auto, LBCode, or HTML) to use for entries. Second, there are now separate options for turning off comments and trackbacks on individual entries. Third, the setting to turn on comments and trackbacks for articles now actually works. Forth, the articles sidebar plugin has a few new options, including the ability to add custom links. The edit link is in the articles section of the sidebar and it uses the same type of format as the sitemap, i.e. a list of hyperlinks separated by newlines.

I think that pretty much covers it for this release. If you have any questions, comments, or find any bugs, please feel free to e-mail me or leave a comment. On the off chance that anyone is interested, I also welcome contributions of code, themes, plugins, or pretty much anything else.

Notice the new search feature

Alert LnBlog uses who look at the sidebar may notice that the search section has changed. I've finally gotten around to writing a native search plugin. Yes, I finally got sick of waiting for Google to spider my site. It's pretty simple right now; it just searches for entries matching all search terms. It will also accept a regular expression if you enclose it in forward slashes. This will replace the Google search plugin as the standard search feature in the next release. The Google search plugin will still be included for anyone who wants it, but will be disabled in teh default configuration.

There is one interesting thing about the new plugin: it's the first plugin I've done that displays an entire page on its own. By that I mean that the sidebar panel and the search results page are both displayed by the plugin file, rather than using a separate page file for the search results. I still have a few bugs to work out of it, but if and when I get it sorted out, this plugin will provide a nice template for future self-contained plugins.

LnBlog 0.5.4 - "No Need for Testing"

This always happens to me - come out with a nice new release with lots of cool features and discover that it has a huge, glaring bug in it that makes it completely unusable for some people. Well, at least I found the bug and squashed it. At work, I occasionally have to fix bugs that have been lurking in software and messing up reports for years before anyone noticed them.

This is a critical bug fix release. This particular bug appears to have been introduced in version 0.5.1 and affects users who are running on web servers without the gettext extension enabled. Users who have gettext enabled (i.e. people who could actually use the software) are not affected by this issue and, hence, do not need to upgrade. Many thanks to Brandon for reporting this problem.

If you are affected by this bug and have PHP's error reporting turned on, you will see a message that says something like:
Fatal error: Call to undefined function: _() in /path/to/lnblog/blogconfig.php on line 133
This is due to an error in the blogconfig.php script. I mistakenly tried to mark a string for internationalization before loading the lib/i18n.php file, which contains the _() ad hoc internationalization function. Users with gettext enabled are not affected because LnBlog only uses the custom version of _() defined in lib/i18n.php if the gettext extension is not loaded. When it is present, the _() function is provided by gettext itself.

If you are affected by this bug, you can download the new release from the download page. Alternatively, you can get the same effect by downloading the fixed blogconfig.php file and apply it as described on this page.

Bug fix for 0.5.3

Oops! I messed up!

Apparently I introduced a bug into the last few releases for people who don't have the gettext extension enabled. I forgot to turn gettext support back off on one of my test systems, so I didn't catch this. My apologies to anyone affected.

Bascially, this bug causes an "undefined function _()" error in the blogconfig.php file. This is caused by an attempt to mark a string for translation before the ad hoc translation code is loaded. This only affects users running on servers without the gettext extension enabled. If gettext is enabled, then it will supply the _() function and there is no problem.

I will upload a new version and update the Freshmeat page later today or tomorrow. In the mean time, you can download the fix here. Just rename this file to "blogconfig.php" and copy it into the root of your LnBlog folder, overwriting the old one.

LnBlog 0.5.3 - "No Need for Spam"

It's release time again! LnBlog 0.5.3, also known as "No Need for Spam," is now available for download. You can get it from the download page as usual. You may also want to note that I've decided to join the 21st century and am now cryptographically signing the release archives with GnuPG. If you don't know what that means, don't worry about it. If you do know, then you can find my public key here.

This release adds a number of significant features. The biggest features are actually all implemented as standard plugins, meaning you can customize them and/or turn them off. The first of these is a plugin to blacklist IP addresses from submitting comments or trackbacks. This has several features. First, when you are logged in, it displays the IP address from which a comment or trackback was posted along with a link to ban it. If you are logged in as the administrator, there is also a "global ban" link. Basically, the idea is that you can ban apply a ban for just the current blog or globally for all blogs managed by LnBlog. The two files are merged when the plugin loads, so the blocking rules from both will be applied. If an IP address is found in one of those files, any comments or trackbacks it submits will just be discarded. And just as side note, if you want to make your regular account the administrator in order to make global banning more convenient, you can do that by creating a userconfig.cfg file in your LnBlog userdata directory and adding the following line to it:
ADMIN_USER = your_username_here
Note that this will make the administrator account into a regular user. Of course, that probably isn't a problem for most people.

As for the IP ban lists themselves, they are actually a list of regular expressions, one per line. When you click one of the ban links, the actual IP address is added to the appropriate ban file. However, you can edit the file from a sidebar link and actually change those lines to use PREG (Perl-compatible regular expression) syntax. So, for example, if you're getting spammed by the whole range of IP addresses between 123.45.67.89 and 123.45.67.98, you could block that entire subnet by simply adding 123.45.67.* to the ban file. If you're a real regular expression wizard, you could get really fancy, but this should be sufficient for most people.

The next spam-related feature in this release is another plugin, this time to just turn off comment and/or trackback posting for your whole blog. This plugin has settings that allow you to turn off trackbacks and to turn off comments either for everybody or just for people who are not logged in. This is for those who would rather just not deal with comment or trackback spam at all.

The third semi-spam-related feature is a plugin to notify you by e-mail when a trackback ping is received by an entry. Basically, this is exactly the same as the comment notification plugin, except for trackbacks. This way, you'll actually know when you get trackback spam.

The last spam-related feature is just the ability to handle trackback pings. You can now delete received trackbacks and turning off comments for an entry will also turn off trackbacks. Note that currently, the confirmation for trackback deletion is only in JavaScript, so if you have JavaScript disabled, clicking the delete link will delete the trackback ping immediately. Just an FYI.

One more option on the plugin front, it is now possible to add your own custom links to the articles section of the sidebar. When you log in, you will now see a link for that at the bottom of the articles section. The file format and interface is the same as for modifying the sitemap.

The last big feature is pretty permalinks for entries. Rather than the date and time, the last component of permalinks will now be a sanitized version of the subject line. Of course, the old-style permalinks will still work, even for new entries, so there is no need to convert anything. I've just added some code to create a wrapper PHP script with a nice name whenever an entry is added or modified. The other nice thing about this is that if you change the subject of an entry, the link with the old subject will still work.

That about covers the major changes for this release. I also made the plugin configuration page a little easier to use, added JavaScript confirmation for comment deletion, added a redirect to prevent duplicating comments, and fixed several bugs, such as tags being lost during post previews. Check the change log for details.

As always, leave a comment or e-mail me if you have any problems, questions, or comments. Enjoy!

One problem down

Well, it looks like the new IP blacklisting plugin has solved my trackback spam problem. All the spam was coming from two or three subnets, so I just banned the entire subnet and I haven't had anything since.

In other news, I implemented a couple of fixes and features today. First, I fixed a problem with links to uploaded files being broken by the new pretty link feature. Second, I fixed that annoying problem where tags weren't preserved in the edit box when previewing an entry.

On the feature front, I added the ability to turn off trackbacks. For now, there's no seperate setting for it - it just follows the setting for comments. I also added a plugin that allows you to turn off trackbacks or comments for an entire blog. That should be nice for people like me who never actually get any legitimate trackbacks.

Anyway, I want to do some testing, but I think I'm pretty much done with this version in terms of features. Look for a new release before the end of the week.

Gack! More trackback spam!

Well, it looks like testing out the IP banning plugin for a few days was a good idea, because it didn't work quite as well as I'd have hoped. In other words, I'm still getting trackback spam.

I took an hour or so to rework the plugin. This time I decided to keep it nice and simple. I made sure to remove all extraneous whitespace, separate the per-blog and global IP lists, and did the check with a simple preg_match() call. This has the added benefit that I can now use the same code to ban an entire subnet just by including a star in the IP.

I think I should also include a setting to turn off trackbacks and/or comments altogether. I'll bet there are a lot of people who just don't feel like trying to keep up with the spammers. And at this point, I really can't say I blame them. My site isn't even that popular, and I've gotten nearly 50 trackback spams just since I implemented e-mail notification the other day.

Yay! Spam handling!

Well, now my spam problem is (partially) taken care of. Today I added trackbacks to the IP blacklisting plugin, added a plugin to send e-mail notifications for new trackback pings, and added an interface to delete trackback pings. After I burn them in for a few days, I'll put up a new release.

I would have liked to just release the plugins, but it turns out that isn't possible. You see, I haven't actually touched the trackback code since I first added it. As a result, the trackback class wasn't raising any events for plugins to hook into. In fact, the class didn't even have a delete method. So I had to add all of that. The good news is that now it's taken care of, so hopefully in the future I can just release plugins.