This year, Ames and I went to 3 different halloween parties. You can see all of our crazy pictures at Amesnjas.com, but here are some of the best costume highlights.




Top 5 reasons why a Toyota Camry does not make a good off-road vehicle.
Sorry Ames, I couldn't resist.
I had a very specific idea of how I wanted the homepage on my site laid out. I wanted either the entire latest post front-and-center in my content area, and below that I wanted to have 2 columns with excerpts from the two previous posts. I know there's probably a way to do this with Movable Type, but the easier solution to me seemed to be writing a PHP page that grabbed the info I needed from my Movable Type database.
The only problem with that concept was that I couldn't use the excerpt tag if I wasn't building the page through movable type. Well, I knew I could shorten the post to a specified number of characters by using the LEFT string function in my SQL query.
LEFT(mt_entry.entry_text, 500)
The only problem this left (no pun intended) was that I didn't want to see any images, pre tags, links, etc. in these "Recollections". What I needed was a way to remove all the html from these strings. I was really close to writing a regular expression to do this when I ran across a very useful PHP function: strip_tags. With strip_tags, all I had to was change:
<?php echo $row_Recollection1['entry_text'];?>
to...
<?php echo strip_tags($row_Recollection1['entry_text']);?>
I just had about 800 calories for lunch: Grilled Beef Patty, Macaroni and Cheese (Mexican Style), 2 pieces of Wheat Snack Bread, and some Nacho Cheese filled pretzels. According to the packaging this is Menu No. 8 Hamburger Patty. It was actually a pretty good lunch, but even after running 4 miles this morning, I probably shouldn't have eaten the whole thing.
After hurricanes Frances and Jeanne cut through my hometown of Vero Beach, the National Guard was there passing out water, ice, and these meals. So this weekend, when my sister-in-law and her boyfriend came up for the Gator game, they brought some for me and Amy. It would have made a great meal for camping or hiking since they're pretty much good forever, but I thought it would make a great novelty lunch in the office.
For those looking for something fun to do with the heater pack in an MRE, Chris (our programmer with military experience) says that pouring about 3-4 of the small bottles of Tabasco in the pouch will create a "pepper-spray like gas". Fun! Unfortunately I opted for a warm hamburger patty rather than a dangerous prank.
For myself, adopting movable type as my blog platform wasn't really that hard of a task. I've had some difficult issues to overcome, but those have come mainly from the design I created, and from the features that I've been trying to work into my site. For those of you considering movable type, I give it two thumbs up so far. If you have a host with php and sql, I recommend it even more.
I'd like to do some how-to posts about the design and css in a later post. Aside from those issues though, I've done a lot to make movable type perform the way it does here. Most of that can be attributed to a few tutorial pages and sites out there that are must reads for potential Movable Type bloggers.
There's so much more to write about and link to here as I've really learned a lot in the last couple of weeks. I guess that should have come as no surprise since I switched to a new webhost, used a different backend, and created a comletely new design.
I'm still a few more weeks away from re-launching the new jasongraphix, but I've been making great progress with Movable Type and learning lots of new tricks. One of my goals with the re-design was to make the site as dynamic as possible by breaking the design into independent php modules that I can include anywhere. One such module, actually contains the menu for my site, and I ran into a minor problem last night. The menu is actually an unordered list that depends on an id="active" identifier to change it's style.
If the menu was actually copied onto every page, I would only have to place the identifier on whatever li was active and be done with it. With the menu in a php file that is included on every page this is a little more difficult. I originally thought I could pass a variable to the include to let it know what menu item to affect, but I knew there had to be a better way, to contain everything in the menu include.
The first idea that came to mind was the php function PHP_SELF. PHP_SELF can be used to get the URL of the page that the browser is on. For Instance, if we were at
http://www.jasongraphix.com/archive/directory/directory/index.php and used:
<?php echo ($_SERVER[PHP_SELF]); ?>
We would see the string:
/archive/directory/directory/index.php
Ok, so that's a neat trick. The problem was breaking a good variable like "archive" out of that mess. I know I could do this by writing a regular expression, but I REALLY don't like regular expressions. I infact loath regular expressions. Sorry Nathan.
The solution: explode()
My inner B&B voice says "Fire,fire,fire heh,heh,heh".
Explode actually takes a string (like our long URL) and brakes it into an array of values by a specified character. In our case that character is "/".
With that in mind, I was able to write up a function to get the variable I needed:
<?php
$target = $_SERVER[PHP_SELF];
$foo = explode('/', $target);
$menupage = $foo[1];
?>
With menupage defined, I can then write up my menu like:
<ul id="navlist">
<li<?php if($menupage==""){echo(' id="active"');}?>>
<a href="/">Home</a></li>
<li<?php if($menupage=="archive"){echo(' id="active"');}?>>
<a href="/archive/">Archive</a></li>
<li<?php if($menupage=="portfolio"){echo(' id="active"');}?>>
<a href="/portfolio/">Folio</a></li>
<li<?php if($menupage=="artwork"){echo(' id="active"');}?>>
<a href="/artwork/">Artwork</a></li>
<li<?php if($menupage=="about"){echo(' id="active"');}?>>
<a href="/about/">About</a></li>
<li<?php if($menupage=="resume"){echo(' id="active"');}?>>
<a href="/resume/">Resume</a></li>
</ul>
And viola! A completely dynamic menu include that automagically finds out where it's at, and makes my menu reflect it by inserting a much needed id="active" identifier.