owen

MicroWiki is not a plugin.

It seems like I’ve been working on MicroWiki forever. There are many complex and nuanced emotions for me surrounding MicroWiki. I use it for nearly everything that I don’t do with WordPress, so you can imagine how that might affect my feelings toward it.

At the same time, I’ve bashed the code to death. “Spindle” and “mutilate” are the words I would use to best describe the things I do routinely with MicroWiki after I get it installed somewhere. And every time I think “Hey, this is nearly ready for packaging!” I think of something else that it really should be doing better than it does, and I end up merging code from four different sites to get a revision with everything I’ve added.

In fact, I’ll lay it out for you right here and now: You will not understand this code, even though it runs.

That said, if you want a wiki, maybe this is for you, and maybe it isn’t.

MicroWiki 2.0 is not MicroWiki 1.3

I think that should be obvious, but I wanted to make clear right from the start that this incarnation of MicroWiki is not the same as the last one. There are a few significant differences.

For one, it doesn’t use EzStatic to integrate with WordPress. For another, some of the wiki syntax is a bit different. (Yeah, I know, “Eek.”) And it’s a bit more flexible than last time.

There are a few cool things about MicroWiki. Let me list a few things that MicroWiki does for me that will probably cause me no end of support questions like, “Why can’t I get MicroWiki to do what you said it would on your blog?”

MicroWiki integrates with WordPress. In this most recent pass, I switched around my philosophy as to how this would be done. “Integration” for our purposes means this: MicroWiki uses WordPress’ database connection and user authentication, and has access to any functions that are usually defined when accessing a WordPress page.

So when you install MicroWiki and choose the “WordPress” User Registration option, it’ll create its tables in your WordPress database, and it will allow only the users with “wiki_edit” capabilities to edit your wiki. And if you do something crazy like include a PHP file into one of your wiki pages, it will have access to all of the WordPress functions. Depending how you look at it, this could be easier than building a whole plugin to create a page.

MicroWiki has new rewriter functionality. Taking a cue from how WordPress manages rewriting (but not using WordPress’ WP_Rewrite class), rewriting is handled internally when a URL is passed to it from a generic rewrite rule. Also having some more experience with mod_rewrite by this time, a sample .htaccess file comes along with the installer. Friendly URLs are now much easier to implement.

MicroWiki has no templates. This concept is a hard one to get across at first. Most wikis load a template file from disk, then take the content that you submitted to the database and insert it into that template. How do you edit the template? Well, you open up a text editor (outside the wiki) and edit the template. That’s… um, convenient. Not.

MicroWiki uses a formatting tag to insert page content into a template that is stored in the database. You can edit the template inside the wiki. So if you don’t like the way that the template is constructed, you can edit it inside the wiki without opening a text editor or downloading/uploading template file changes.

MicroWiki supports a content-type tag, too, so your CSS files aren’t in some file on the server, either. They’re in the wiki. You can edit them in the wiki.

You can specify a different “format” (that’s what they’re called in MicroWiki) for any page, just by including a macro, like {{format:myformat}}. Instead of displaying the page content of that page in the default format, MicroWiki will use the “Format:myformat” page as the page layout, inserting the content on that page wherever it finds the {{Special:pagecontent}} tag in the format page.

Yes, it’s all very confusing, but if you’re following along, I think you’ll say, “Whoa, cool!” Either that or, “You’re insane!”

MicroWiki has an image gallery built in. Wait. What? I’ll say that again… MicroWiki has an image gallery built in. It’s a sucky image gallery, and mostly it sucks because nobody ever knew it was there to give feedback for it. But it is. So what’s the deal?

Well, the default editing page (have I mentioned that the editing page format can be edited, too?) has a frame at the bottom that lets you upload new image files. When you upload a file, it automatically inserts the macro tag necessary to display the uploaded image. You can choose some properties for the tag, like the alignment and whether you would like a thumbnail instead of the full-sized image. The image automatically links to a unique wiki page for that image, to which you can add new content.

In the frame, there is an option for selecting a gallery for the image. You can create new galleries via FTP simply by creating a new directory in the wiki’s “images” directory, and then uploading a bunch of images.

How do you display a gallery? You add a macro that specifies the gallery name. MicroWiki displays thumbnails of all of the gallery images, and adds some fancy-ish (ok, it’s not that fancy) that displays the image a little bigger when you click on a thumbnail. If you then click on the bigger image, you go directly to the dedicated image page.

That’s assuming any of that actually works.

MicroWiki can include stuff. It might be difficult to convince you of the utility of this, but I’ll give it a shot.

If the wiki configuration allows it, you can use a macro to include a php script’s output at some point in the wiki page output. One handy example of what you can do with this is include a file that fetches and displays RSS news. If you put that in your wiki’s sidebar, you can extend the functionality of the wiki significantly.

Moreover, because the wiki has already created all of the objects needed for database access and authentication, you don’t have to code any of that stuff into your scripts. All you need to do is create the script with the functionality you want, save it near the wiki, then create a new wiki page that includes that file. Instant object access!

So where is this monstrosity? Hmm… Well, it’s only 136kb, so it’s a really small monster. But yeah.

Before you go off in an excited rush to get the thing, let me come clean a little (as if you couldn’t tell):

This thing isn't tested for regular people to use.

What I mean is, it should install simply. It should run ok. I don’t have any trouble with it. But I am not you. And seeing that I’ve had zero feedback on this version so far, that’s hopefully where you can help out.

I’ve set up a forum for MicroWiki over at RedAlt. If you’ve got issues, drop them in the forum and I’ll check them out. I’m not guaranteeing instantaneous (heck, any) response, but at least they’ll be catalogged for when I get a moment to look. And if someone else has a working solution for your problem, that’s the most likely place to find it.

So run along now.

Blicki might also interest you, if you’re looking for post versioning and wiki-like linking within WordPress.