Monthly Archive: August 2009

Now running on WordPress MU

I’ve just moved the blog over to a WordPress MU installation; it used to be running on Lyceum, but as John Joseph Bachir himself acknowledges, it’s a bit hard to keep up with WPMU, which the WordPress team participates in. There’s a difference in the database structure that doesn’t really concern me, I’m more interested in being up to date.

I’m not 100% sure that everything is going to have moved over smoothly. But we’ll see.

For the record, I did this: Exported each Lyceum site to a file, then imported it back into WPMU. I had to re-enter all the links and link categories by hand. Plus, I did what might have been a dumb thing and set up the WPMU install at a temporary URL, then tried to switch it back over by changing the Apache config file to point the /blog directory to the WPMU install. Of course, 404s were everywhere. I hand-edited wp-config.php to get /blog in there, and then from the default blog deactivated each of the two blogs and reactivated them. I also switched the theme away from the one I wanted to use and then back. Most of this seemed to repair the damage, probably due to something having been cached.

Addendum: Actually, another thing that did not go smoothly is moving all of the uploads. Lyceum had stored everything in links that looked like /blog/wp-content/blogs/2/uploads/xxx.yyy, but WPMU stores things in /blog/blogname/files/xxx.yyy. I had to manually copy everything over and then go through the posts and replace the URLs within the text. Fortunately, I didn’t have a lot (though if you find a broken link, please let me know). I also told WPMU to not use month-based directories for the files, but to just throw them all together, since that’s how I had the previous blog set up.

Getting Ecto to work with WordPress MU

Here’s another “tech” post, not really directly about Linguistics.

I am using WordPress MU as my CMS for courses. I used it last Spring, but there have been some updates since then, so I moved to v. 2.8.4a. There is a longstanding problem with the XML-RPC code (or, rather, I think there is a problem in the API) and Ecto doesn’t know what to make of the things that WPMU sends it. The result is that if I add a specific course’s blog as an XML-RPC endpoint, I get back all the blogs that the user has access to, yet only the posts/pages come back from the first blog. (By the way, Ecto can handle WPMU pages, which is a big win over the other options).

In order to rectify this, I intentionally crippled getUsersBlogs to ignore the multiblog setup and return only the blog whose XML-RPC endpoint I’m actually using. The relevant change was in the xmlrpc.php file, in the top level of the WPMU installation. For 2.8.4a, it is in lines 439 and 441. All I did is comment out those lines. The lines contain a conditional that checks to see if this is a WPMU install, and if it is not, it uses the getUsersBlogs from the Blogger API. By commenting out the conditional, I force it to use the Blogger version of getUsersBlogs regardless of the fact that it is actually a WPMU install. The four lines of xmlrpc.php look like this once I’m done.

//PH if( !function_exists( 'is_site_admin' ) ) {
array_unshift( $args, 1 );
return $this->blogger_getUsersBlogs( $args );
//PH }