WordPress character set fixes

Written at evening time in English • Tags: , , ,

PHP (or possibly Apache itself) inserts a default charset= field in the Content-Type: header. This can cause problems with the syndication feeds, if you are not using the exact same character set on your blog. In my case the character set I use on this site is iso-8859-15 while the default that shows up is iso-8859-1.

I modified wp-rss2.php to return the character set specified in the WordPress options, and then went through other files to apply the same change. You can download the full patch that should apply cleanly to WordPress 1.2.

More style?

Written late at night in English • Tags:

I have wanted to experiment with different layouts and fonts on my site. I have a “beta” site on my LAN for experimenting, but it doesn’t have all the different parts of the site available. I had already heard of alternate style sheets, and since all this experimenting was mainly within the CSS code, that’s what I added.

Firefox (and Mozilla) allow selecting the style, but I was surprised to discover that they would not remember the selection from page to page. Reading the spec I realize this is considered “correct” behaviour (as far as the spec is concerned). But just how long is anyone going to keep re-selecting the style over and over? Not me…

A quick Google search on alternate style sheets provided a link to A List Apart with the solution. Working With Alternate Style Sheets is an excellent article complete with the necessary JavaScript code.

Now you can click on the Sans-Serif and Serif links at the bottom of the page to select a different font-set for viewing these pages, and the selection will be remembered throughout the site.

Easier publishing

Written late in the evening in English • Tags: ,

Writing HTML is not exactly easy — all those angle brackets require lots of shift key pressing, and reformatting text from inside one set of tags to outside means working around these or those tags constantly. On the other hand, writing regular plain text email is rather easy. Ascii enhancements to highlight text have been around for ages, and with almost 20 years of writing messages they are practically automatic to my fingers.

With WordPress and other blog tools I’ve looked into different markup systems. I’ve really taken a liking to Markdown, as it is very close to how I write in email. As an added bonus, I can basically take any email and put it on my web server, and it turns into an HTML document almost without any work. And I can still email it as plain text!

Since the framework of this site is written in PHP I installed a PHP version of Markdown. Then I hunted around for a PHP version of SmartyPants for a couple of minutes before realizing I should just look at the WordPress code right under my nose… (Look in the functions-formatting.php file in the distribution.)

To tie it all together, I enhanced my page wrapper to handle .txt files in addition to the .html files it was already processing to add the “look-and-feel” of the site.

»
I got introduced to phpBB forum software yesterday, so I decided to look into it a bit more. Some of the web sites hosted here have been asking for message boards at times, so now I have forum.gw.com up and running.

Getting Wikier

Written at evening time in English • Tags: ,

I just became a WikkiTikkiTavi developer today! I’ve been eyeing Tavi for a while now, and got it installed at work. I wanted to be able to play with it without keeping people from being productive so I decided to power www.suominen.org by it.

My PHP installation was too secure for running Tavi, although I didn’t know that right away. I was just getting blank pages (just like with phpWebSite), but I was determined to find out why. After some code reading and referencing of www.php.net I figured the problem was the register_globals=off setting in my php.ini file.

Obviously the right fix was not changing php.ini so I contributed my first generally useful patch to Tavi. I’m hoping there will more in the future — plans will be forming on my personal page on Tavi.

The Wiki Way

Written early in the evening in English • Tags: ,

I’ve been running UseModWiki on www.tcsh.org and some other sites since April, 2001. I just collected the most useful tweaks and patches I’ve made to it. Links to all that are now available on my personal page on UseModWiki.