Archive for Friday, May 9th, 2008

 

Word of the day II

Friday, May 9th, 2008 in Word of the day

Relating to some university officials a term came up at our lunch table, which is used far too rarely in my opinion:

Flitzpiepe: (German) someone you can’t take seriuosly

Multiple blogs with a single WordPress installation

Thursday, May 8th, 2008 in Online, PHP

When I started setting up the blogs some days ago, I began to create subdomains and subdirectories on the server where I could install WordPress. Soon I discovered, how complicated and prone to errors this procedure can be and started to think about alternatives allowing me to run several separate blogs while administrating and maintaining only a single software installation. You can find some more or less complex hacks for this floating around the net. In addition there exists a special multi user/multi blog version of WordPress called WordPress µ, but it seems it is turned mostly towards very large projects and uses a number of modifications of the original variant for this purpose. On the other hand there is an approach by Strider which is called Virtual Multiblog and looks quite feasible. However this looks a bit intricately at first glance because it seems to require an additional WordPress plugin.

Finally I discovered a very elegant way by myself: Because WordPress stores all settings of a blog – including articles, comments and users – in the MySQL tables defined in the file wp-config.php, it would be sufficient to use different configuration files depending on the used subdomain. So I modified the wp-config.php to simply evaluate the used subdomain and load a configuration based on the result. Which looks like this:

<?php
if ($_SERVER['SERVER_NAME'] == 'blog1.example.com')
{
require('wp-config.blog1.php');
}
else if ($_SERVER['SERVER_NAME'] == 'blog2.example.com')
{
require('wp-config.blog2.php');
}
?>

The files wp-config.blog1.php and wp-config.blog2.php are just standard WordPress configuration scripts without a single line of extra code. Using different prefixes for the MySQL tables it even would be sufficient to have a single database to store all blogs. As simple as it is, as low-maintenance it is too, because WordPress updates don’t overwrite the new wp-config.php or the newly created configuration files. At the same time all blogs benefit from the update, of course.

[Update: It just caught my eye, that you might run into difficulties if you are running multiple blogs with the same plugin. If an upgrade of that plugin requires an update of the plugin's database table, you have to pay attention to update all of those tables (for every blog using the plugin)!]

Word of the day I

Wednesday, May 7th, 2008 in Word of the day

Every now and then you stumble across notably charming or annoying words and expressions. I’ll be presenting some of them here once in a while, starting with a term Adrian invented not so long ago:

(to) outgoogle: to find a result at Google faster than someone else

“Damn, you outgoogled me again with that milk prices!”

Multilingual blogging using WordPress

Tuesday, May 6th, 2008 in Online, PHP

As said before, I wanted to blog bilingual in English and German for quite some time. Translating my posts into Swedish as well is a bit too much effort compared to the number of potential readers, I guess. Even though it’d be a good training of my language skills. Nevertheless I would like to have the possibility to do so and therefore the new blog system should not only support bilingual, but also multilingual posts. After searching around a bit, I found the Language Switcher WordPress Plugin which allows users to create multilingual posts, categories, blogroll links, comments (!) and even more by adding some simple tags.

The installation is quite easy as well, if you follow the given instructions. A bit more of a hassle was the internationalization of the WordPress Theme Dust 3.17 I use. Every language needs to have a separate file translating all the text shown. PHP functions inside the code of themes or plugins replace this text with the translated text in a language the reader can choose. In case you have to add these functions by yourself, the Language Switcher plugin page provides instructions for this task, which allowed me to internationalize the Quotes Collection plugin you can see to the right. In a few days I’m gonna send the changed to code to the plugin’s author Srini who I already contacted last week, so he can publish an internationalized version of his great plugin.

Let’s start!

Monday, May 5th, 2008 in Online, Private

Welcome to my new blog!

After being silent since last October, I think it’s time to start blogging again. I’m taking this time gap as an opportunity to start over, which suits my life as well because I finished my diploma thesis in the meantime and so I’m not a student any longer, but in search for a job.

Creating this blog I’m putting a long planned project into pratice. The blog I used until the end of the last year was based on a system that was developed and implemented by myself. Now I’m using WordPress as a weblog publishing system. This is basically because of all the development and maintenance efforts such a system requires, if you’re trying to keep up on all fronts. The old blog lacked any search engine optimization (SEO) and to implement the multilingual support I always wanted to have, I would have had to rewrite most of the code anyway. Because all my attempts to attract some co-authors have failed, I was the only one writing for the blog and the decision to start over wasn’t too hard. So I pulled myself together after I handed in my diploma thesis and installed a bunch of blogs for the family domain I ordered back in June last year.

But now: Have some fun with it!