www.BrettDaniel.com

Untitled

Prompted by the fourth bullet in the previous post, I finally rebuilt the inner workings of this weblog. About time! I kept the design intact but completely overhauled the backend code to accomodate the database-driven architecture I should have had from the beginning. This opened up the possibility for loads of new functionality. For one thing, it makes it far easier for me to post and edit entries. No more flat files! I just open up my password-protected form, type in my entry, and click "Post". Browsing the archives is now a whole lot easier. I added "Older" and "Newer" links at the bottom of the page, and each entry has absolutely beautiful permalinks. Just click the timestamp at the end of this post to see what I mean. Similarly, pictures have nice URLs and are easier to browse, too. Each picture displays above the thumbnails of other pictures in its directory. Finally, and best of all: commenting! You can now contribute your insights and opinions like on all the cool kids' websites.

The most difficult problem with this migration was getting the entries out of the old monthly flat files and into the database. I think right around late 2002 was when the archives became unwieldy. Fortunately, I used relatively clean markup (thank you, style sheets!), so I was able to write a quick extract-and-insert program that regex'd out all the entries and loaded them into the database. I had to modify a few of the odd cases by hand, but overall, the process went quickly.

The second most difficult problem was getting the nice URLs to work consistently across the site. I used Mod_Rewrite, Apache's URL manipulation module, to give the illusion of a directory structure in both the archive and picture links. In reality, everything after "archives/" or "gallery/?path=pictures/oldweblog/" is mapped to a query string that the code uses to create the pages. For example, this link is exactly the same as this link only more elegant. Again, I used regular expressions to search and replace the links in the text of archived entries.

The moral of the previous two paragraphs is this: if you see something garbled, missing, or broken, it was probably an unruly regex match. Please leave a comment under the offending entry, and I will go fix the problem.

I hope you enjoy this new streamlined version of Weblog.BrettDaniel.com.

No Comments

Comments are closed.