In a previous post I talked about how to integrate ZenPhoto into Wordpress. After I had done that for my own site I still wasn’t happy. I didn’t like the fact that I had to use seperate logins for Wordpress and ZenPhoto, I wanted this to be as integrated as possible. So I figured out a way to make ZenPhoto ask Wordpress for authentication credentials. In other words, if you’re logged into Wordpress, you’re also logged into ZenPhoto. This makes the user/password in the ZenPhoto config file meaningless. Here’s what you have to do to get this working: (more…)
ZenPhoto is a great image gallery written in php that I use on another page I have. It has a great admin interface and themes that are simple to use. I wanted to integrate it into a Wordpress blog so I looked around on the net and found a great article about it by a guy named Steffen Rusitschka. It explains how you can get your ZenPhoto gallery to look like your blog by including some Wordpress pages in your ZenPhoto theme. The article is at http://www.ruzee.com/blog/2006/06/integrating-zenphoto-into-wordpress/.
His method works great but there were a few things that bugged me about it. (more…)
On my old site I used to have a random quote feature. When I moved to Wordpress I missed it so I found a plugin that displayed random quotes. It was called Yet Another Random Quote (yarq for short) and lives at http://openmonday.org/2006/07/31/yet-another-random-quote/. It’s a good plugin and works well, but it could only add and delete quotes, not edit existing ones. So I changed it a bit, added editing functionality and moved the quote text fields above the quote list, which I thought was better when you had a lot of quotes. After I’d changed it I emailed the author twice to ask him if he wanted to use my changes in his next version but never heard back from him. So I´m gonna distribute my version here:
You can use Options->YARQ to change the display format, and Manage->Quotes to add, edit and delete the quotes. If my changes ever make it to the trunk I’ll stop distributing it here and just link to the main version. If Frank van der Brink ever reads this, get in contact with me at tech [at] einaregilsson.com and I’ll send you the patch for my changes.
I use Wordpress for this site as well as my personal blog. It works very well with icelandic letters for the most part but there was one problem. When you create a new post and give it a title, the post slug is generated from the title. For example, the title of this post is ‘Icelandic letters in Wordpress permalinks’ and it’s automatically changed to ‘icelandic-letters-in-wordpress-permalinks’ in the url. When you have a post with special characters in the title they are either removed or changed to some ASCII equivalent. For instance, Á becomes A, Í becomes I, ö becomes o and so on. This worked well for all icelandic letters except three, they are þ, æ, ð. When I made a post with the title ‘Þátturinn’ the post-slug would become ‘þatturinn’ and when I tried to enter that address in my address bar it changed to ‘%c3%beatturinn’ and I got a ‘page not found’ error from Wordpress.
Now, you can manually enter the post-slug when you write a post, but I don’t wanna have to do that every time I post, so I dug around the Wordpress code and found the replacement function. It’s called remove_accents and is in the file wp-includes/formatting.php. There, right before the line ‘// Decompositions for Latin Extended-A’ I added the following code:
chr(195).chr(144) => 'D', chr(195).chr(176) => 'd',
chr(195).chr(158) => 'TH',chr(195).chr(190) => 'th',
chr(195).chr(134) => 'AE',chr(195).chr(166) => 'ae',
Now the characters are replaced automatically like this: Ð => D, ð => d, Þ => TH, þ => th, Æ => AE, æ => ae. I don’t know if everyone has this problem, or if it just has to do with the character set settings on my webhost but this works great for me. No more manually fixing page slugs! I’m gonna create a bug report with Wordpress and hopefully this will be accepted into the next version.
Few words in icelandic to help people find this post
: Íslenskir stafir í wordpress linkum post slug permalink permalinks
Update 02.08.2007: Just found out that there’s already a plugin that does the same thing, and it doesn’t require you to mess with your Wordpress files. You can get it at http://wordpress.is/saekja/ibaetur/iceslugs.tar .
Update 13.08.2007: I made a patch for this and submitted it to Wordpress. The changes should come in WP 2.3. The patch is on ticket #4739 .