# Tag Archives: site

Anything related to the website

# Source highlighting and listing

Apologies for the source code not getting formatted as it should as well as missing highlighting. Should be fixed over the weekend.

Update 2007-06-02 00:05: Installed wp-syntax and it looks good. I now need to fix my CSS to use monospace, my first attempts didn’t seem to result in the correct display.

Update 2007-06-02 00:12:  So my CSS is working, it was just that Firefox decided on some weird monospace font, which wasn’t monospaced at all.

# Reworking CSS

OK, one problem with the current site is that the sidebar might get pushed below the content section if the width of the browser is not sufficient.

Suggested fixes are more than welcome. :)

# WordPress, MySQL, UTF-8 or why some links might temporarily not work

So I found out that MySQL had defaulted to latin1_swedish_ci when I first started this weblog database. Sily me for expecting a saner default like UTF-8.

I spent the past two days converting data. The majority of the tables were no problem, but wp_posts.post_name is tied with something which causes a key error to be displayed. I worked around this problem by writing both a PHP and Python script that took the current data from the table’s column, escape as needed, URL decode it as necessary, store it, alter the table to utf8_unicode_t, and pump back the data.

The reason I first had a Python version was that I did not even think of using Python. I guess I was looking to intently at the WordPress sources and got stuck in thinking ‘PHP’. After many hours of frustrating around with PHP’s APIs I went to Python and wrote a resulting script in a fraction of the time.

When I stared to verify the data in my mysql console output I was wondering what I was missing since I saw with a SELECT post_name FROM wp_posts; only ???? instead of kanji. The question marks are normally replacement characters used when conversion went ok but with small issues. Silly me for forgetting I had not done a SET NAMES utf8;.

Now I am walking all links to see if they’re actually clickable. Seems after you edit them and save them it corrects some database entries.

Of course, it seems my slugs vary wildly. Older entries use some weird underscore based scheme, I wonder if that was a left-over from my Drupal import that I never noticed. It goes against a lot of persistent URL guidelines, but for the sake of consistency I am updating every single post just to be on the safe side. The search engines will correct over time, I just hope I won’t break too many referrers.

# Fixing up the layout

As might be evident from the non-matching colours and all that, I am currently reworking the design to really become what I had in mind a while ago.

During all this I encountered a lovely problem with Internet Explorer and its support for PNG, namely that it is mucking around with the gamma setting, regardless of what the PNG specifies. (A even more detailed background is available in the form of Henri Sivonen’s excellent article on the matter.)

So right now I am stripping the gamma (gAMA) header from my PNGs in order to have it working across most browsers (it seems Safari 1.3 has issues with PNGs on a lot of fronts).
So in short: no matter what the Internet Explorer team fixes, they seem to screw up in other magnificent ways and this is what sets them so apart from, say, the Opera team. Instead of not taking blame the Opera team actively ask people to report problems back so that they can see if it is a real problem with their product.

# How long until XHTML 1.1?

It’s too bad that support for XHTML 1.1 is so sketchy since Ruby support is only available as an XHTML module. Using Ruby definitely makes learning hanzi and kanji way easier (one of the reasons manga is littered with them).

# Under construction

As you might have noticed I am actively restructuring the site layout. If some things break or stop validating, well, you know whom to blame. :)

# New layout

In the coming days I will overhaul the design of the site, so bear with me while adjusting. ;)

# Moved to WordPress 2.0 from Drupal 4.6

Drupal is a nice system if you need an advanced CMS-like environment. Which I didn’t.

Hence I moved to WordPress, since I need a well-maintained piece of weblog software. The only downside at the moment is that it is written in PHP.

Conversion was not too hard. I followed directions as posted on http://spindrop.us/2006/05/19/migrating-from-drupal-47-to-wordpress and only had to change some things.

I want to keep the category ‘Uncategorized’ in order to have a sane default. So you can perhaps just leave out the ‘delete from wp_categories;’ step. Furthermore I had to use this SQL statement in order to move the posts over, since I was running Drupal 4.6:
[sql]INSERT INTO wp_posts (id, post_date, post_content, post_title, post_excerpt, post_name, post_modified)
SELECT DISTINCT n.nid FROM_UNIXTIME(created), body, n.title, teaser, REPLACE(REPLACE(REPLACE(REPLACE(LOWER(n.title), ‘ ‘, ‘-‘), ‘.’, ‘_’), ‘,’, ‘_’), ‘+’, ‘_’), FROM_UNIXTIME(changed)
FROM drupal.node n
WHERE type=’blog’ OR type=’page';
[/sql]

# Finally…

Finally have a working PHP again after the PHP folks totally screwed over PHP 4.4.1’s apache2handler. Thankfully the FreeBSD port reverted this piece of code.

And I will migrate my PHP stuff to Django and such frameworks in the future. PHP’s braindead decisions by its developers has annoyed me a bit too much by now.