Sandcastles on the Beach Aug 12, 2008

Vacations

How do you spell relief, the BEACH!

This last week was a great week. You don't always know that you need a break until you go back feeling better and ready to take on new challenges. Countries that mandate a vacation have the right idea.

Our trip to Duck N.C. was a welcome break and the weather could not have been better. This year the temperature stayed in the high 80s and the water was not frigid. We where at the beach everyday at low tide. Thomas really enjoyed jumping waves and learning to boogie board.

I enjoyed the break from trying to pound knowledge into my head. This summer has been about improving my Photoshop and Flash skills and I have improved. But it was getting to the point of headaches if I picked up any book relating to any subject. The motivation was slipping a little bit.

We always stay at House 'N Duck located in Duck, N.C. It's a great house that's always taken care of and allow dogs for the week. Plus it's only a short walk to the beach and to the shopping and resturants.

One of my favorite activities on the beach is sandcastle building. I'm no pro at it but it's fun to try new things and to make a castle that is more than turning over a bucket filled with sand and saying finished. Since my son was able to walk one of his favorite event is Sandcastle destroyer.

Normally he destroys anything I'm building well before I ever complete my work. Those sand bucket towers are gone two seconds after their built. I never mind because their just sand. It's part of the whole process. This year was different, he's old enough now that he can wait. I will have to post the photos I have of him comtemplating which rampart he'll take out first.

Thomas deciding which part to destroy first.Since I can now keep him from demolishing anything I make as I do it, the castles have improved and they are a lot better. This gives me the time to really work on them. I also think that it makes it more fun to destroy.

He's developed the sneakiness that it takes to do it before anyone can stop him. You think it's safe so you go back to reading a book or watching the surf. The next moment there is mass destruction going on and a huge smile of his face. "Mission Accomplished! Next castle Daddy!"

Again, that's how it goes on the beach.

Lets Go O's Jul 25, 2008

Hobbies

Let's Go O's It's summertime and one of our favorite pastimes is to watch our Baltimore Orioles play at Camden Yards. The park is beautifully laid out and well maintained.

What is even better is that Thomas is now at an age that he really enjoys the game and all the extras that happen when you go to the game. Like any other sport, if you are just interested in the game, stay home and watch on the TV and the food is free and the drinks are cold.

Going to the game is about standing up and singing the National Anthem. About getting peanuts and hot dogs from the hockers walking through the bleachers. I admit I do more shelling of the peanuts and Thomas does more of the eating all my hard work. That's what a father does for his son.

When your team is at home, you cheer for the home team. The only time you should be rooting for the visiting team is when you've traveled to another city and you are cheering for your team. That's the way it should be. No booing of our team because they're off tonight, even if tonight last an entire season.

Last Friday night the O's took on Detriot Tigers and after exchanging the lead a couple of times won 7-4. But again, that isn't always the important part of the night. It's about being out with friends and family.

So until the next game we can go to, Let's Go O's!

Altering Page Titles Dynamically Jul 8, 2008

Programming Techniques

Looking at my site I constantly find things that need to be improved upon and fixed. One of the first items on my list is to correct the way my page titles appear. Currently there is only one title for the entire site. That just won't do!

Here at the school house we teach that the page title should reflect what is on the page. If the page is about apple pie recipes, the title should tell you that the page contains pie recipes. Simple enough and it is simple enough when dealing with static HTML or pages that do not dynamically interact with a database on the server side of the house. Page titles also help with your bookmarks. They are the starting point for what your bookmark will be until you modify it. The other important part of a bookmark is that it records the Uniform Resource Locater or URL which is your page's mailing address on the Internet.

In HTML/XHTML the <title> tag is located inside the <head> section of the document. You can add it to your page and it will reflect in the top of your program window and in your tab if you are using that browser feature. If you select "Bookmark Page" the page title will be the default field that you see in the dialog box. Take a look at Google and see how their page title appears. For more about the TITLE element visit the W3's page on the Title Element.

Since this site is built upon server side includes I only have one <title> tag. The first step for me to take is to change the static text of "Benjamin Olvey Photography & Design" to a PHP variable, i.e. $pagetitle. The next step is to create a switch function that will look at the URL page requesting the include and change the $pagetitle variable to reflect the content of the page.

The case switch statement I'm starting with is

<?php

$page = basename($_SERVER['SCRIPT_NAME']);
switch($page) {
case "about.php":
$pagetitle = "About OlveyPhotoDesign.com";
break;

case "webdesign.php":
$pagetitle = "Website Designs by Benjamin Olvey";
break;

case "photo.php":
$pagetitle = "Photography by Benjamin Olvey";
break;

case "contact.php":
$pagetitle = "Contact OlveyPhotoDesign.com";
break;

case "articles.php":
$pagetitle = "OlveyPhotoDesign.com Blog";
break;

default:
$pagetitle = "Benjamin Olvey's Photography & Graphic Design";
}

?>

At the simplest level this means that when photo.php request the header include the switch will set the $pagetitle variable to "Photogaphy by Benjamin Olvey" therefore reflecting the content on the page more accurately.

The item that makes the switch statement work is the variable it is examining. I used the basename function which determines the filename from the directory path set in the $_SERVER Global Array field "SCRIPT_NAME". This array is automatically generated by the server when it receives a php page request.

As the switch statement is ran, it will try to match each case until it finds a match. When it does, the $pagetitle variable will be set to reflect the content of the page. Afterwhich the break; command exits out of the switch statement. If no case matches the $_SERVER['SCRIPT_NAME'] then the default $pagetitle is set. To read more about the $_SERVER array visit the PHP Manual.

The break command is important in that the switch statement doesn't need to continue if a case has been matched.

So far I have really only tackled the upper tier to my site. When we go into my blog all it will say is OlveyPhotoDesign.com Blog. What I have to tackle now is getting the switch statment to change the page title to reflect the content that is being filter to the viewer. If you click on a Hobbies topic from the blog, I want the page title to reflect "OlveyPhotoDesign.com Blog: Hobbies." Then when an actual article is being veiwed the title will show the article title "OlveyPhotoDesign.com Blog : Altering Page Titles Dynamically."

To get this far I will have to employ the $_GET data array that is the work horse behind the filtering process. But that is another days work.

To Tri or Not Jun 29, 2008

Hobbies

Everyone needs to stay in shape, it's a fact. Otherwise our bodies start to slow down and soon even the smallest stress on the body results in pain.

Over the last couple of months I have been contemplating what my next fitness goal should be. I've discovered that I stick with a plan better than just working out for fun. I have ran two marathons and a few half-marathons.

I have always enjoyed running. Its always been my time to think things out and to destress. However, training for a marathon takes a certain stress on you and there's a significant amount of time that you have to commit to get across the finish line. I have also used bicycling and swimming in the past to help keep in shape.

Running has always been the easiest out of the three to do. Just walk out the front door and you're working out. Swimming involves going to a gym and biking requires a bike that can be an expensive startup. I've started my running again, slow as it may be. What I have to decide is what is my next goal.

I haven't gotten to that point, but I've been kicking around the idea of doing a triathlon. Triathlons are a combination of swimming, biking, and running all wrapped up into one event.

As a kid I remember watch the TV specials on the Hawaii Ironman Triathlon and thinking how cool it looked. Now I can understand the commitment that these athletes (elites and us common folk) take to not just get to the starting line, but to also try our luck.

So now at the age of 36, I am thinking of doing a sprint or olympic length triathlon. A sprint triathlon consist of approximately a 500 yard swim, 12 mile bike ride, and a 5k run. Olympic distances are about double that of the Sprint level.

Now the question is am I commited? Many things go into it, it's not just whether I want to do it or not. Buying a Triathlon bike will run me about $1500 after getting the bike, pedals, shoes, and at least a couple pairs of shorts. While most of my swimming will be in a pool, I'll have to rent a wetsuit for the actual open water swim. All of this adds up to a pretty penny

On top of that is the time commitment. I have been getting up earlier each week to get my running in. However, now it will be more like five to six times a week plus a couple of evening workouts. Add this to a schedule of full-time work, part-time college, family time, and professional development. That's a big load to add the time it take to train for a triathlon. That's a big load to carry.

But at the same time, the body has to be taken care of also. If you stay in shape you will be happier and healthier in everything else you do.

So again, the question is to Tri or not to try. I'm leaning more and more to tri-ing. I just need to ensure that I am ready for the commitment. I haven't decided on an event, but there are more than a couple Olympic length events that are held here in Columbia and in Annapolis, Maryland. So we will have to see.

Dreamweaver CS3 with CSS, Ajax, and PHP Jun 20, 2008

Bookshelf

There are a number of books that have aided in the development of this site. This one played a major role because it transitioned me from typing all of the code by hand to using and modifying that same code in Dreamweaver. The program that I have used for assembling all of my web designs.

David Powers has but together a great book that does more than tell you how to use the program. Powers goes through all the new functions and abilities of Dreamweaver CS3. What's even better is he goes into the basics of PHP and MySQL. From there he takes you into adjusting the code and adding more security and function into your site.

Overall his tutorials are very thorough and gets your hands into modifying CSS and PHP. I haven't found a section yet that hasn't aided in my understanding of web design and programming.

Additionally it does a great job at combining the strengths of PHP and SPRY in helping you create exciting, dynamic content.

Overall this is a great addition to any bookshelf for those who use Dreamweaver to develop and design websites.

Second Date Jun 13, 2008

Cascading Style Sheets

Earlier I wrote how it's not just important to develop a great design, but it's also important that it look accurate across the multitude of browsers that we use to view the same code.

Writing code that is compliant with XHTML and CSS standards takes us a great distance with getting the same look across different web browsers. Unfortunately you cannot rely on every user updating their favorite browser when the next version comes out. MSIE 7 has been out for about a year and W3Schools.com reports that about 28% of the visitors use MSIE 6 to view their site. A browser that's know not to support many CSS style attributes or natively supporting the PNG24 file format.

So, when I designed version 3.0 I wasn't shocked when I saw that my design was accurate across many new browsers. When it came to MSIE 6, 5.5, and 5.0, well, it wasn't pretty. The navigation bar was at the bottom of the page and I had the grey opaque borders that represented the alpha transparency of my PNG-24 files.

Now I don't have all the different browser programs loaded on my computer so I used Browsershots.org to view olveyphotodesign.com and that gave me a clear idea of how the site looked on different browsers and different operating systems. You can also specific if you what Flash, Java, JavaScript enabled or turned off. You can examine how different display resolutions may effect your liquid layouts. The biggest minus I can see is that you are making your work public as you develop a site. That may not be what you are looking for but if you don't have the resources, a site like this may be your best option. Just make sure to remove the files from your server until you are ready to go live.

Olvey Photo Design viewed using Microsoft Internet Explorer 6.0First I tackled the positioning of the navigation bar. It's the standard unordered list tag that is set up to float across the width of the page. To place the bar at the top of the page and keep it there I assigned it the style attribute of position: fixed; z-index: 2;. This keeps in fixed in place and allows the page to fit underneath the bar as you scroll down the page.

MSIE 6 and below does not recognize position: fixed however it does properly place an element using the position: absolute. Changing this attribute corrected the issue I had with the navbar appearing at the bottom of the page. But this also makes the site navigation scroll with the rest of the page.

Tackling the second issue of the PNG transparency issue there are a couple different ways to address it. The first is by using the MSIE Alpha Image filter that only MSIE recognizes. It works but it makes for some nasty looking hacks and coding that doesn't validate to CSS standards. The second is to use either GIFs or JPEGs in place of the PNG files.

The fix to my design issue

Changing the style attribute from fixed to absolute removed the need to use PNG image files since the effect of scrolling underneath the navigation was gone. Therefore I switched the files over to JPEGs.

I chose to use a JavaScript file by Chad Lindstrom that detected the browser being used to view the page. If JavaScript recognized the browser as MSIE6 or eariler, it uses the document.write funtion to insert a link to my MSIE.css file containing the absolute attributes and JPEG images. Otherwise it writes the link to my global.css file that has the fixed positioning and PNG images. In case JavaScript is turned off, I have a noscript tag that links to the MSIE.css as a safety valve.

Many people feel that it's not reliable to run these scripts detecting browser verisons and having to update them when newer versions are released. Since I'm trying to detect a few older versions, I felt this was the best way to go. Additionally I was able to keep the design I orginally set out to develop.

So I would say on my second date I'm looking pretty good.

Go Swimmer Go! Jun 9, 2008

Hobbies

This weekend was great, I watched my wife swim in the the Chesapeake Bay 1 Mile Swim. This was a companion swim to the people swimming across the Bay in the 4.4 mile event.

Beth's wave starting offEven though the weather was hot The whole family showed up to cheer her and her sister on in their events. This was the first time that Beth has swam in an open water event.

Like any goal we set, Beth worked more than four months getting ready for Sunday. All of that work paid off with her finishing in about 52 minutes.

Thomas had a great time also with running through the outdoor shower that was set up for the swimmers and trying to do the hula hoop.

I think we should always attempt to do new things and encourage those around up to try big things. With patience and training we can overcome many things. Sometimes they are rewarding and at other times they simply help us along our daily path.

Swim on Beth!

Checking out how I look. Jun 5, 2008

Cascading Style Sheets

Today we do not just design for one browser. Even with Internet Explorer holding about a 65% of the market share, there's IE4, IE5, IE5.5, IE6, and IE7. IE 8.0 beta has recently been release.

Browser Shot of olveyphotodesign viewed with IE6.If you are currently using IE6 or below to view this page then right now you are probably thinking that I'm not a good programmer. Well, I'll disagree with you but the truth is I need to do some more work.

I know this because of sites out there that allow you to view your site across multiple platforms and browsers. They allow you to view different display resolutions, with Flash Player or JavaScript enabled or disabled.

Browserhots.org is a great site to use and it's free. It gives you a army of screen shots that tell you how well you've coded your page. From there you can work on getting your site to look good across all browsers.

Overall olveyphotodesign.com looks pretty good until you get to IE6 and lower. Why worry about it right? IE7 is out and it's web standards is vastly improved.

The reason is it that as of last month, approximately 30% of people surfing the web are still using IE6. So for 30% of you my site looks like dodo.

So the next major fix for this site is to update my code so that I look good for you too. I really didn't mean to cheat you but maybe on our second date I'll dress up for you too.

Ciao!

Building Version 3.0 Jun 3, 2008

Programming Techniques

Version 3.0 started approximately five months ago. Along with redesigning the site I had to develop my PHP understanding and SQL database structure. Before I could get to that I had to set up a test server using my home computer and then learning UNIX commands and SQL database management. During the upcoming month I plan on turning more of the static pages into dynamically accessed data.