Thursday, March 12th, 2009, 15:03:25

… the magical, floating, multi-color space-orb just disappeared and I was able to go on with my so-called life.

Anyways, I was working on ZagrebDox for the whole month of February and it kind of took all of my time and energy, but ended up being a really nice project because I’ve, once again, learned a lot of new things about WordPress.

I’ve also learned a few new things about MySQL and how to crash your hosting provider’s shared server.

What happened:

  • the site has over 300 pages (each with at least 3 attachments)  and I’ve used a permalink structure which started with %category% – this combination produced waaay too many rewrite rules
  • there was a 20MB database size limit
  • for some reason, the wp_options->rewrite_rules field got duplicated ~10 times, and the database had grown to 50MB in no time
  • combine that with the 20MB limit and what you get is a bunch of neverending transactions
  • s0 the server went kabang! and the site was promptly moved to another one

To solve the problem, I’ve changed the permalink structure to begin with %year%, disabled creation of rewrite rules for attachments (thanks to Johan Eenfeldt – his code has made my number of queries per page drop from ~3900 to ~90), set the number of post revisions to 2, and then repaired and optimized the database which now stands happily still at 5.7MB.

I don’t know how rewrite_rules field got duplicated, I haven’t used any plugins that would mess with it, so I’m still in the dark about that. What I do know is: you can’t host over 700 sites on one single server and expect everything to go smoothly until the end of days. Not to mention that the only available transport protocol is fsockopen which made the admin area a bit slow until I’ve blocked all the others…

There’s been some other stuff I’ve worked on, but I’ll put that in another post.

It’s lunch time. And I miss Ma.gnolia

 
Thursday, May 8th, 2008, 01:05:19

I’ve been working on some interesting projects for the past few weeks.

The first one is the website for the Society of architects of Split (Društvo arhitekata Splita – DAS). My job was to code the layout and choose a CMS. I decided to go with WordPress because the site’s structure isn’t too complex and, except for two categories, it’s mostly just static pages.

I did encounter a few difficulties along the way, but nothing that wasn’t fixable. Most of the pain was caused by the ever popular “/category/” feature of WordPress, which inserts /category/ in the URL if the the page is a category index. While you can access those pages without the /category/ in URL if you’re using a custom permalink structure (such as “/%category%/%post_id%/%postname%/”, for example), the problem starts when your post count per page exceeds 10 (or whatever custom number of posts per page you choose) and you need to go to page 2 of that category – it returns a 404 error. I fixed this problem with a handy plugin called “Redirection“, which made it possible to rewrite “/category/category_name/page/number/” to “/category_name/page/number/”. I tried placing the rewrite rules directly in the .htaccess file, but, for some reason, that didn’t work.

Second problem was adding custom metadata to posts in a way that would make sense to a site editor. For that purpose, I used the rc:custom_field_gui plugin which was a breeze to use :)

Third one, that gave me two days worth of headaches, was how to display only posts with certain metadata on a category index page. First I used the officially recommended way, which consisted of using PHP’s continue statement to filter out the unwanted posts. That produced a empty page 1, and a populated page 2, because WordPress post count occurs before the continue statement. There’s also no way to do it with WP_Query, so I ended up writing a custom query. Again, problem with pages. I used the WP-PageNavi plugin, so I looked at its code and figured out what variables it needs to work properly and I gave them the values they needed.

I can only say that I’ve learned a lot about how WordPress works :) And while it does have its quirks, if you know some PHP, anything is doable.

Second website is for a well known Croatian bottled water, Studena. Again, Blackduke was the one who produced the website and I was asked to compose some background music and a few sound effects. The first version of the music was initially accepted, but then it was agreed that something that currently plays on the site would work better. You can hear and download the first version from below :)

  1. No flash Studena music – 01:42
    Download: MP3 (1,602 KB)

In other news: wish me luck because I’ve got three exams next week. And that’s it. If I pass all three, I get to start working on my master’s thesis.

Future awaits :)

 
Wednesday, February 6th, 2008, 17:02:05

Better Nate than lever, here are three projects that I’ve worked on in the past 3 years, but somehow forgot to mention. Khm. I’ll create a "Work" section soon and put them together with my other actual works. Enjoy!

Polaris+ (January 2008)

Music and sound effects for website intro

Link: Polaris+

W&GA (November 2006)

Music and sound effects for website intro

Link: Wine and gastro academy Zagreb

T-com (March 2005)

Music and sound effects for a T-com promo CD

Link: T-com cd @ Blackduke.com

Ultra big thanks goes to Blackduke for giving me the opportunity to work on these projects :)