aaron@traas.org

The home of Aaron Traas — man of faith, science, and very bad humor

Aaron's blog, page 6

Traas.org 3.0

Traas.org has actually been completely re-written using an open-source MVC framework called CodeIgniter. This has enabled me to further separate my presentation layer from my database, resulting in cleaner, more manageable code. It also takes a lot of the pain away from building/validating forms, uploading files, and clean URLs. In the clean URLs department, for example, the brewing equipment page of this site, the url used to be:

http://traas.org/page.php?pid=13

whereas now it's

http://traas.org/page/brewing_equipment

Much easier to remember.

Coming soon: RSS/ATOM feed for blog content and photos, dynamic sitemap.xml, and improved photo viewer. Some of the old features don't work yet, notably all the submission forms (such as for email, blog comments), because I haven't gotten to them yet.

Traas.org v1.8 released today

I just updated the traas.org codebase and deployed it to the production web server. What's new? Well, dynamic everything. 100% of the content from traas.org is pulled from the database, and is easily editable. That's why there's now many, many spelling and punctuation corrections. Also, we now have support for all kinds of AJAXy features, the only one of which functions is the button next to the "Music I recommend" group, which refreshes the random list of five albums when you click on it. Coming soon are recipes and my own rantings. Please look through the site, and try to break it. If you find anything wrong, please comment below.

Page upgrade -- now with blog-like goodness

Yup... I fixed a few bugs in the site code. First, I noticed that robots are traversing my site, and screwing up the metrics I'm taking, so I added a robots.txt. I'm not expecting this to work as some shady organizations ignore the settings of this file, but it should cut down on some unneccesary traffic. Second, after reading this article, I realized that though my documents all parsed as valid XHTML 1.1, the benefits of such are nil unless I actually have the HTTP server pass the document to XML-aware browsers as MIME-type "application/xhtml+xml". Instead, apache was sending it as "text/html", which made tells the browser to look at the document as "tag soup", and tolerate all kinds of quirks in CSS and non-well-formedness.

Well, the problem is further complicated by Internet Explorer... not a single version knows how to deal with XML content. Luckily, user agents (in this case, browsers) publish what type of content they accept. Firefox, for instance, publishes "application/xhtml+xml" as one of the options in its HTTP-ACCEPT header. So I have a little bit of PHP code that snifs to see if the UA accepts what we want to publish:

if( stristr( $_SERVER["HTTP_ACCEPT"], "application/xhtml+xml" ) )
{
   header( "Content-type: application/xhtml+xml" );
}
else
{
   header( "Content-type: text/html" );
}

This basically sees if the UA accepts XHTML, and if so sends that MIME-type. Otherwise, it sends "text/html". So both classifications of browsers (those made by Microsoft, and those made by anyone else). So everybody is happy. I think.

Immediately after I did this, I tested it in multiple browsers and lo, it did render different. It handles the coloration of margins differently, and there was a white border on the top and bottm of the page, where the grayish background should have been. It turns out that I needed to apply the background color to the <html> element rather than the <body> element in the style sheet. One line of code difference, and it rendered perfect. I have to say: damn, I'm good! It rendered near identical using alternatively a legacy SGML parser and a modern XML parser. Life is, in fact, good.

Page upgrade—now with blog-like goodness

I've added a dynamic news feature that's not completely unlike a blog in terms of function. No user comments... yet. I need to build a nice, clean, spam-proof system for that. But nonetheless, I will be adding regular content to this section. This site is really coming along... it's about time. I've had the domain for how many years?

Features to add:

  1. an archive system (currently only displays the latest 10 entries)
  2. nested comments. Probably no fancy AJAX script at first, but later maybe
  3. fix the box model so I don't have to fill in all of the text necessarily. Probably just have to nest the <p> and <img> in a <div>
  4. clean up so that we render nicer with no stylesheet. This mostly means making more elements into <li> elements.

Keyboard Shortcuts

?
Show/hide help
Right
Select right-hand menu
Up
Next menu item
Down
Previous menu item
Left
De-select right-hand menu