Horizontal centering images

I am facing a small CSS problem: I have a page with some blocks of content, of which I don’t know the contents on beforehand. Therefore all blocks — defined by div elements — have the same definition. If the block contains text, it has to be left aligned; if the block contains an image, it has to be horizontally centred.

In the good ol’ HTML era, I would simply add align=“center” to the img element, and I would be done. But with CSS, the only way to centre an image is with text-align: center; to the parent element of the image. But this is impossible, since I don’t know the contents on beforehand.

What I would want is to apply a certain style depending on the child element; something like: div < img {text-align:center}. Since this kind of instructions do not exist, I will probably have to use some kind of JavaScript hack to accomplish what I want — or does anybody know a better solution?

Templates restructured

I have restructured my templates for this site. The old ones used way too many <div>’s and <span>’s, which cluttered up the HTML — these elements are today’s equivalent of the tables in the 90’s. I decided to start from zero and only add those elements that I think are necessary. As a result, the new pages are smaller, which should make them faster for you.

To make things easier for me, I decided to use another Document Type Definition. This site is now XHTML 1.0 Strict, instead of XHTML 1.1. To me it feels a little bit like a loss, since I liked it that my site was on the forefront of web technology, but the hassle is simple too big. The biggest problem is that a lot of JavaScript won’t work, and my knowledge is not enough to fix these things myself.

I also took the opportunity to activate the TypeKey service for those people who want to use it. It is not required; I only see it as a means for showing to the readers that it was really you who wrote this comment. As an alternative you can still use OpenPGP to certify your comments.

There are still some things not going quite as I wanted to, and the quickly adjusted stylesheet makes this site look even worse than before in Internet Explorer, but I will be working on those. If you notice any strange behaviour or mistake, please let me know.

Windows 3.1

Last week when I entered my hotel room and switched on the light, the TV turned on and showed me a welcome message explaining how to use Pay TV. First I did not pay any attention to this screen, and I started unpacking my bags. When I passed the TV for about the fifth time, I suddenly saw something I did not notice before. On the top of the screen I could see a blue bar with some letters below it. I was amazed. The welcome message was simply a text file written in Write, and the whole system appeared to be running Windows 3.1!!!

It has been a long time ago since I last saw Windows 3.1 in use. I thought that everybody had already switched a long time ago to Windows 9x, but it seems that there are still some of these legacy systems around. Surely the system is running good enough, so why change it?

Cyprus

The next week I don’t expect to write many things.

This morning I will be leaving for Cyprus–I will be flying over Amsterdam!!!—where I will stay until Sunday. I will have meetings with four companies over there and am going to try to teach them as much as possible about our main programs.

Bye!

Comments disabled

I temporary disabled the comments on this site. The last days I have received too much comment spam.

Until two weeks ago, I could control comment spam by using the MT-Blacklist plug-in.

Unfortunately this plug-in does not work on the latest version of Movable Type, so I had to remove it. MT 3.0D has the option to require commenters to sign up first before posting a comment, but I have not yet been able to get the JavaScript to work on XHTML 1.1.

Until I fix this, I simply keep a close eye on my comments, and remove any suspicious comment immediately. But the coming week I will be on a trip, and thus can’t watch my comments.

Therefore I decided to disable the comments until I am back home again. If you have any comment, just use the Feedback form.

Snails

It was that famous weekend again: the Aplec del Caragol. I won’t go into details, but after two days of eating and drinking I feel tired, dirty, and have pain in my stomach.

The first days with MT 3.0D

Four days ago I upgraded the motor of this site to Movable Type version 3.0D — the D is for Developer edition. Unlike many others who installed this version, I was fully aware that this developer edition could have some problems with plug-ins. Here are my findings of the first days playing around.

Dashboard

The first screen of the MT interface clearly shows a new item: the Movable Type News box. This box syndicates news from the Movable Type web site. Since I prefer to read my news in my feed reader, I immediately removed this box.

Another thing changed in the main screen is the direct access to some weblog features. The 2.x versions had for each weblog links to create a new entry and to enter the entries list. Now you can also access the comments list, the templates list and the weblog configuration screen. The one thing I am missing here is the upload file feature, since I assume that bloggers will more often upload an image than tinker with their templates.

Edit Entry

Also the Entry Edit screen has some —minor— modifications. It is now possible to specify the entry date & time the moment you create a new entry. In the older versions you first had to save your entry to modify the publishing time. That leaves only one feature that cannot be modified in new entries: the multiple categories.

Another change is that the edit buttons now also work in Mozilla based browsers, but only for the entry body. If you use the extended entry field, you still have to enter the HTML code yourself.

Comments

The comments list is new and handy feature to manage your comments. You can see the details and the status of the last comments, and open them from that screen. You can filter comments on e-mail, name and IP address, but unfortunately not on status. I don’t receive many comments, but I assume that more popular sites would love to see only the comments that are pending for approval.

Trackback

In my definition, trackbacks are nothing more than comments on my entries left on other sites. I would like to treat trackbacks in exactly the same way as comments, but unfortunately trackbacks do not have status information.

Plug-ins

Of the 13 plug-ins I use for this site, I removed two after upgrading. MT-Blacklist is not compatible with MT3.0, so I am removing comment spammers by hand again.

The Optional-Redirect plug-in is not necessary anymore, since the same can be achieved in MT 3.0 by no_redirect=“1”.

All other plug-ins work the same way as before.

Individual Archive template

Most of my time went into trying to adjust the individual archive template. There have been many changes to this template to incorporate the TypeKey service, but I have not yet been able to get them to work when served as XHTML 1.1 with MIME type application/xhtml+xml. The smallest problem was to validate the template as XHTML 1.1. The new code uses some names, which I changed into ids, and I had to edit lib/MT/Template/Context.pm so it won’t use valign and border anymore – look at line 1476.

A bigger problem is the JavaScript. Things like document.comments_form.email.value is easy enough changed into document.getElementById(’email’).value, but I don’t know how to fix document.write so it works both on text/html as on application/xhtml+xml.

The last problem I have with my template is that it shows the wrong comment form; the one that is normally used when TypeKey authentication is obligatory. I still have to find out what is going wrong here.

Internet radar

The radar is a handy and necessary tool in the aviation business. A long time ago, when there was not much trafic, there was no need for a radar; for the people in the control towers it was enough to have visual contact with the airplane the moment it arrived. But as trafic increased more sophisticated systems were needed. Nowadays all incoming and outgoing planes appear on the radar screens, unless they fly too low.

Exactly the same is happening on the internet. Ten years ago, it was easy enough to surf the few interesting sites on a weekly basis. But as the internet grew and more sites started to publish more material, this became a kludge. I am interested in the content of about 100 sites, which I try to read on a regulary basis. Some of these sites publish daily news, some of them are only updated once a month. Four years ago I had my bookmarks ordered by update frequency: I had a folder called ‘daily’ which contained sites I tried to visit on daily basis, etc. But as the number of sites increased, it became undoable to keep on visiting all those sites.

So I started using the internet equivalent of the radar: feed readers. Most sites publish their content in several formats. Besides the usual HTML pages, many sites also publish their news in a short format as RSS or Atom. My feed reader fetches those so-called feeds every X minutes, and notifies me when a site has been updated. This saves me a lot of time! But there are still many sites flying under the radar. Sites that do not provide feeds, sites which I still have to visit manually, many times only to find out that nothing has changed. I found out that I am visiting these sites less and less. They are about to dissapear from my screen, I simply do not have the time to keep on visiting them.

And I am not the only one. Many people read the texts of this site through a feed reader, and even more use my feeds to see whether I updated my site. So webmasters: don’t fly under the radar, but give your readers the option to use feed readers!