I know dozens of people have probably already done this, but I’m quite happy with myself for having figured it out in ~5 minutes.
Ever since I migrated my blog over to WordPress, I’ve had a little dropdown box in the right column that contained a list of my post categories. Well, that box never actually did anything. There was no form associated with it and no javascript.
Well, I finally buckled under and figured out the javascript. The code in question to make the category box automatically jump to the desired category search is something like this:
<?php
dropdown_cats( 1, "All", "name", "asc", 0, 0, 1 );
?>
<script lang='javascript'><!--
var dropdown = document.getElementById( "cat" );
function onCatChange() {
location.href = "/blog/category/"+dropdown.options[dropdown.selectedIndex].innerHTML+"/";
}
dropdown.onchange = onCatChange;
--></script>
Of course, if your url scheme is different, you might need to specify something slightly different for the destination. But the point is, this works so far as I’ve tested it, and it was pretty painless to drop into place.
A friend of mine, Peter Harkins, is the maintainer of Sociable, a WordPress plugin that adds magical little links to social bookmarking services at the bottom of every blog post. Well, Sociable 2.0 is in a very stable beta release now, and because I’ve recently upgraded my WordPress install to 2.1, AND because I’ve absolutely never gotten around to installing the plugin… I tested it.
The install took <5 minutes. It was 100% painless.
- Download the plugin
- Unzip into WP plugins dir
- Open WP admin console -> Plugins
- Click ‘Activate’ next to Sociable in the list
- Go to Options -> Sociable
- Set desired preferences
- View your blog with cool links at the bottom of posts
Go. Get it now. You know you want to. Your blog will love you for it.
Yeesh. They just don’t know when to quit.
Last night, despite my best efforts to hack this package to prevent comment posting, they still managed to find some URL to allow them to do so… I got hit with 92 more spam comments.
In desperation, I started digging through the database schema and discovered that each post has a flag that determines what level of comments to allow. I edited the table to disable comments on all existing posts, changed the default value for new db entries, and found the line in the admin interface where I type new posts that was setting comments to ‘open’ by default and overriding the prefs stored in the db.
This time had better work
Blah! Well… apparently my little hack earlier this week didn’t work, I got strafed by spam bots again. So, we’ve examined more code and edited two more files in an attempt to prevent this in the future… sigh.
Sigh. I’ve been hit by spam-bots every few weeks since bringing this new site online, but was vaguely content with my previous hack of not displaying comment information/links on the main page. I’d forgotten about permalink pages.
Yesterday, I got strafed – every single entry in the blog got spammed. Thus, I got to hack a bit more code to remove comments from those pages as well. It was surprisingly painless. I’m actually sincerely surprised at how simple it was.
Now, I just get to remove the offending entries from the database because I’m picky like that.
I have officially completed work on this site for now. We have numerous photo albums up (I scanned in about 30 new pics and downloaded some from our camera), a lot of the old ’static’ content has been migrated across, and the appearance of the site has been unified.
I am particularly proud of the static page. It is completely dynamically generated using happy fresh PHP 5. None of this sissy PHP 4 garbage, only the best for my little blotch of egotism. Anyhow, I throw a stack of files at a great big little directory and the thing generates the index, detects file types, and displays things appropriately.
There is also a rather interesting glitch in the CSS on the site that I am taking advantage of. Well, it’s not really a glitch so much as an unexpected bonus.
I had written my footer file to simply display a horizontal bar and a link to my email address. Things show up after all content on the site and it is good. But… if I remove the final closing </div> tag, the footer magically renders inside of my content panel and looks really pretty cool (in both IE and Firefox).
Oh yeah, that’s another feature of which I am proud. The site doesn’t really look all that differently when viewed in IE. Very nice bonus there.