NOTE: this page really needs an update, seeing as I now have a job using php to build Web applications. Nonetheless, the basics here still apply.
At first I was going to name this page “All the stuff I learned while building this blog,” and that’s a long list. Just accept that a lot of this stuff was new to me. I have definitely been getting my geek on lately. I plan to keep this as a living diary of the technology here, so people who wonder “how’d he do that?” can get at least a partial answer. Of course, if you’re curious about something, just ask!
I chose WordPress because it’s a pretty straightforward system based on php, which lets the server custom-build web pages, and MySQL, a database that keeps all the stuff handy, if the php code asks nicely for it. The thing is, I’ve never used php before. I’ve used some other systems that use similar concepts, but php is the open-source Web engine for the common man.
As an aside, iBlog, my old blog system doesn’t use any of that fancy stuff. It’s made to work with Web servers that are off limits to the blogger — without those fancy tricks on the sever the blog software has to generate (in my case literally) thousands of files and keep track of which ones need updating when I correct a spelling error. So for what it was built to do, iBlog was really remarkable. No longer am I tied to the crappy .mac service, however, so iBlog’s greatest strength means little to me. My adventures extracting 1300 episodes out of iBlog is documented here.
But I digress. At this rate the page will be about six miles long.
Let’s start with the banner, shall we? It’s done with Flash, and uses the following techniques:
- Traditional Flash Animation
- ActionScript 3.0 (out the wazoo)
- Code-controlled animation
- Dynamically loaded text and images
- Dynamically loaded and tracked audio (All For Me Grog!)
- Dynamically loaded external Flash Files
To provide the XML data for the poetry corner I created a WordPress page with a custom database query. I use php to turn the random poem request into XML which is returned to the Flash animation. Flash makes a separate request for the image indicated in the XML.
Alas, my drawing skills did not see the same improvement as my Flash programming skills. So it goes.
On the php/WordPress side, I think most of the things I’ve done are pretty ordinary, but I sure learned a lot doing them. There are some features I miss from iBlog, like the ability to make categories go in reverse order (for the serial fiction on this site) and the ability to stick a post at the top of each category, not just the main page. I’ve got the reverse-order thing mostly working; the first step was pretty easy but the page forward/page back controls are confused and it looks like I’m going to have to do some real coding there.
I was very pleased to see that right out of the box I could control the text of different categories independently. WordPress does a good job of putting all kinds of identification over each piece it generates so the CSS can affect exactly the right elements. Way to go, WordPress! (I had to hack that into iBlog.) I’m still getting the text just right, but I know I can.
Long have I wanted to have rounded corners on my blog episodes and now I do. I had to do a fairly significant restructuring of WordPress templates to avoid having to write the code several times, and I think I can optimize further, but at least I don’t have all those copies of the same thing running around. I bet most geeks tweaking the code make the same changes I did; I’m kind of surprised it doesn’t just start out that way.
CSS3 is sneaking into the blog as well, gradually and insidiously. If you go to the comment screen for a single episode you will see navigation helpers above the episode. (This is technically a page, so it doesn’t get the helpers.) On some browsers the links in the navigation section will be over a translucent background with rounded corners. At this moment, only Safari and Firefox support both the translucency and the rounded corners, but they do the corners in a non-standard way. I might write more about it as an actual episode, to share the geekly love.
And… huh. I have “allow comments” checked, but there’s no sign of the stuff. I threw in the line of code that hopefully will work without destroying everything.