Migration

Thu, 7 Aug 2008

If you’re seeing this post, my blog is now on a new server — a virtualized server of my own, in fact. In spite of a server switch and a WordPress upgrade, I think I’ve been able to bring everything over correctly. Let me know if not…

Due to the way I migrated (servers and WordPress versions at the same time), I couldn’t take my WordPress database whole-hog. So some things might be a little funny, like post #6 is right after post #689. I did manage to bring over users from the original database, so let me know if they don’t work.

Having our own server is going to be interesting; we will be able to do things that we couldn’t otherwise (such as setting up our own IRC server). I’m looking forward to it. Wish us luck!

Structured Blogging

Mon, 3 Oct 2005

This morning I gave Structured Blogging a spin and decided to put it back on the shelf until it has matured a bit. The basic premise is fun: different layout and metadata for different kinds of posts, for example arts reviews. I occasionally review books and movies, so I thought I’d see what structured blogging could do for me.

At the moment Structured Blogging is only available as a WordPress plugin, which is perfect for me since that’s what I’m using. Installation was easy, and so was turning one of my past reviews into a structured post.

However, some features didn’t work so well; for example, the script was unable to locate a screenshot URL for the book. The plugin includes some default styles, but those didn’t show up in my post, probably because I’ve tweaked my templates so much. This is not a big deal, all things considered, but I decided I didn’t want to bother with it right now. So I disabled the plugin.

At this point I discovered that the plugin doesn’t just add a couple of extra fields to the post database; it inserts extra code, including some Javascript, into the body of the post. Excuse me?! That stuff shouldn’t be hard-coded into my entry, not least because disabling the plugin should disable every trace of that plugin. If their formatting is hard-coded, it doesn’t disappear when the plugin does.

Oh, and they try to autoparagraph my posts, which just makes me mad. Don’t mess with my valid markup.

I like the idea of structured blogging, but I think the current implementation (which is several months old and rather alpha) is flawed. Too many things are hard-coded. I already talked about removing the plugin, but what if I want to add a different kind of post? I would have to modify the PHP code just for that. Instead, why not use XSLT and allow people to modify or add their own structures, sort of like WordPress templates? Use WordPress custom fields for the extra data, and there you go.

I don’t know how feasible that is, at least without modifying the core WordPress files, but that’s my idea. One way or another, the plugin needs to be more flexible and especially not to bork anything when it’s disabled.

New toy: Currently reading

Thu, 22 Sep 2005

About midway down on the main-page sidebar, there's now a Currently reading section displaying the last three books I've picked up to read. I thought this would be rather fun.

Clicking on the cover image there will take you to another page on my site with comments about the book. Clicking on the cover image on that page will take you to Amazon, where you can buy the book if you want.

If you buy a book through this link, I will get a little kickback. However, that's not the real reason I'm linking to Amazon. I'm using Amazon for the cover images, and bandwidth isn't free, you know. They're scratching my back, so I'm scratching theirs a little too.

WordPress user accounts

Tue, 13 Sep 2005

FYI to my regular readers: There’s a little link on the left sidebar where you can create a user account. You don’t have to, of course, but you can if you want. The main advantage of this is that you won’t have to enter your information every time you leave a comment.

The other advantage is that if you register, and I recognize you as a friend, I will promote your user level by a notch. Then you’ll be able to see posts that I don’t want to share with the entire world. There’s only one of those so far, and it’s fairly discreet as these things go. (It wouldn’t rate a mention next to some of Dorothea’s rants.) Still, there might be juicier tidbits on offer in the future.

posts_nav_link()

Tue, 6 Sep 2005

I must be a troublemaker. I have run into roughly the same problem with posts_nav_link() as I did with the_content().

Unfortunately, my hackery didn’t work quite as well this time. My markup validates now, but I’ve got a bogus next-link that doesn’t belong there (when there actually isn’t a next page to go to). I will have to do substantially more poking at the WordPress code to fix it, since a cursory glance wasn’t enough for me to understand what’s going on.

You know, I hate that I’m solving these problems by adding more parameters to tags. I think that in terms of overall design, WordPress should lean more towards simple tags that return a simple, un-marked-up string (in this case, a URL and let the markup be customized outside the tag. It would make life so much simpler for me, and the code would be simpler too.

Then again, maybe I’m just missing something completely obvious.

the_content (more_link_text)

Mon, 5 Sep 2005

Warning: WordPress rant coming.

How in the bloody effing heck am I supposed to generate valid code with the more_text_link argument to the the_content template tag?

What I had been doing was this:


the_content ('<div class="morelink"><p>Continue reading ' . the_title ('<q>', '</q>', FALSE) . '</p></div>');

However, that gave me output HTML like this:


<a href="http://blog.niceperson.org/2005/09/04/heather-park-revisited/#more-441">
<div class="morelink"><p> Continue reading <q>Heather Park revisited</q> </p></div> </a>

That’s well-formed code, but it’s certainly not valid, and I didn’t intend to let that go for long. Unfortunately, there’s no way to enter before or after text in the the_content template tag, and any way I tried to insert block elements around the more-link just screwed it up worse. You see, just inserting the block-level elements in the entry doesn’t work, because you also have to close the blocks after the more-link, and everything after the link is chopped off. You see? There’s no way around it.

I can only imagine one way to generate valid markup with that tag, and that’s to use the WordPress feature of closing open tags in order to make markup validate. I refuse to use that feature because I want full control over my own markup. I hate programs that think they’re smarter than I am. (The exception to that, of course, is if I wrote the software myself and know the end cases where it falls down. In that case it’s my own fault.)

So what did I do? I hacked WordPress and tacked before and after arguments onto the_content. If you’re interested, here’s a patch. It works for me on WordPress 1.5.2, and it probably has a fair likelihood of working on other versions too (depending on how much the the_content function has or will be modified), but I make no guarantees. Make a backup of the original template-functions-post.php file before you apply my patch. If you have no idea what I’m talking about with patches and the like, you’re probably better off not modifying your code.

I’ll also see what I can do about raising this issue with the WordPress developers and possibly getting my changes, or something like them, folded into the main WordPress code.

Being a geek

Fri, 2 Sep 2005

There’s a saying that a sysadmin is someone who will write two hundred lines of code to avoid typing twenty characters. This was not quite true of me today, but it’s close enough.

You see, my father is coming to visit this weekend, and while he’s here he wants to spend a little time writing. His requirements are simple: A word processor and a USB port for his flash drive. No sweat; I have those on my laptop, and I even know I’ve got the kernel modules and software I need (because my camera works, and as far as Linux is concerned a camera is merely a glorified flash drive).

But what if I want to use my computer at the same time? Jeff and I each have a computer, so we’re not used to sharing. Luckily we have a third computer, an old box that was intended as a development system but can be pressed into service. No trouble running X and a light window manager (Openbox is my current favorite), but OpenOffice.org is a bit of a stretch. So I spent a few minutes installing X and a couple of hours figuring out why I couldn’t open remote X apps.

I did get it working, though only if X is started via startx rather than xdm. It was a webpage that gave me the crucial information yesterday, and it mentioned at least two configuration files to change (/etc/X11/xinit/xserverrc and another for /etc/X11/xdm/Xservers), but I can’t find it again to see if there’s anything I missed.

Situations like this are why I feel I both am and am not a geek. On the one hand I administer my own Debian system, compile kernels, and custom-compile packages. Yesterday I hacked a WordPress plugin (WP-DB Backup) and one of the core WordPress files and created patch files so that my changes would be more easily re-integrated into new versions. At the same time, it can take me ages to figure out something that should be easy.

Jeff thinks I’m a geek, and he loves it. Apparently he’s not alone in thinking female geeks are very attractive.

I am teh 133test

Wed, 31 Aug 2005

As I said in my last post on Movable Type:

I am moving my blog to WordPress and to http://blog.niceperson.org/. I haven’t quite figured out how to do the redirects automagically yet, but I’ll figure something out. In the meantime, please update your links and bookmarks.

I’m not completely sure what I’m going to do with the main site, but I have some ideas.

Problem A (automagic redirection) has now been solved with the careful application of RewriteRules. Unfortunately it’s not spot-on for the single-post pages, because Movable Type and WordPress use different algorithms for creating slugs, but that only means you’ll get the daily archive (which probably only contains one post anyway). It’s a quick, painless solution that requires no rebuilding of archives whatsoever. I’m pretty happy.

I have not deleted my Movable Type page hierarchy yet, merely moved it from archive/ to .archive/ (just in case there’s anything I haven’t anticipated). We’ll see how many 404′s I get from locations I’ve forgotten to redirect.

RIP Movable Type

Thu, 13 May 2004

It looks like I won’t be upgrading to MT 3.0. Six Apart is trying to put a happy face on it, but their pricing scheme is frankly absurd, and Shelley is right that there’s no guarantee of a free version past 3.0. It’s really too bad, and I think (hope) that Ben and Mena will be unhappily surprised by the disappearance of their user base.

Some people are planning to migrate as soon as possible, others (like Shelley) are glad they beat the rush, and still others never used it in the first place. Me, I’m planning to stick with 2.65 for a while. I don’t currently need an upgrade, because I’ve already got all the features I need. In the meantime, I’ll investigate my options more thoroughly before staking my course. Maybe I’ll go with WordPress or Textpattern, or maybe I’ll just grow my own.