SiteCrafting Blah Blah Blog

Jan. 18, 2008 at 11:29am

Thoughts On Creating Website Advertising Guidelines

Let's say you've got a website, and you're considering whether or not to advertise on it. Or maybe you've already got a website with advertising, and you're wondering if a particular kind of ad is appropriate to display on your site. The only problem is, you don't have a concrete set of guidelines to filter out what is acceptable, and what isn't. These are the kinds of questions you should ask yourself to resolve this dilemma.


Read more

Comments (0) | Posted in Deep Thoughts, Marketing by Dave Poole


Dec. 4, 2007 at 11:41am

Facebook Beacon: Social Media Becomes Spyware

Advertising Gone Wrong

I've been a Facebook user for quite some time - even before they had the facebook.com domain. One thing that I absolutely love about it is the control they give you to limit what other people see about you. I've adopted a very serious set of controlls that limits only people I actually know to see anything about me. However, this is a false sense of security. Everything I post online that anyone besides me can access is inherently public. This is what initially drew myself and countless other people to Facebook.

However, their new advertising platform - Beacon - throws all this out the window. Beacon is a system that allows Facebook to track what you do on other websites. Let me reiterate that: Facebook tracks what you do online. They don't just track what you say you like on your profile, for example what movies you like; with Beacon they can track what movies you're actually renting.

Read more

Comments (1) | Posted in Deep Thoughts, Odds 'n Ends, Review, Security by Dave Poole


Oct. 26, 2007 at 2:05pm

Apache, MySQL, and PHP on Leopard (Mac OS 10.5)

I just finished installing Leopard on my computer, and my first impressions are that it's very slick and well thought out. One of my necessities as a developer is that I must have a webserver running on my personal computer, so I was dismayed when it wasn't functional after the upgrade. The main reason is that Leopard uses a different version of Apache than 10.4 did, and so some things get wonky. But it's easy to fix. Apache and PHP are included in Leopard, so the only thing missing is MySQL. To install that, go to MySQL's site, and download the latest copy for OS X. It's incredibly simple to install.

After that comes setting up Apache. Open up a terminal window, and type in "sudo pico /etc/apache2/httpd.conf". (Note that you must be a computer administrator to access the files in etc/) OS X 10.4 had Apache in /etc/httpd/, and that's part of why it didn't work after the upgrade. Find the line in httpd.conf that looks like "#LoadModule php5_module        libexec/apache2/libphp5.so", and remove the # sign at the beginning. Then search for AddType, and put the following somewhere around it.

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Save the file, and exit. Then open up System Preferences in Finder, and click on Sharing. Then turn on Web Sharing. That's all you need do to to setup a webserver on Leopard, or upgrade from OS 10.4. You should be able to open up a browser, and enter http://localhost/YOUR_USERNAME/ and see that the server is running.

Comments (30) | Posted in MySQL, PHP by Dave Poole


May. 14, 2007 at 8:02am

Centering Content with CSS

It's been quiet on the SiteCrafting blog lately, mostly because we've been very busy making websites for out great clients. I've been swamped for the last two weeks with one project, and I know Kevin, Ken, Reena, and... well, everyone has a full load.

My latest few projects have all been sites that have a defined content width, say 850px, but centered in the browser window. The usual way to accomplish centering with CSS is to make the margins of the content to automatically adjust to the window (margin: 0 auto;). Usually, that happens on the specific areas, so if you have three content areas to center, you either need a container for all of those areas, or set margins three times. The first option has problems with backgrounds, and the second results in more code than is needed.

Read more

Comments (2) | Posted in CSS by Dave Poole


Apr. 9, 2007 at 4:36pm

Printing without the Dialog

One day, one of our clients came to us with a very unusual request - they wanted to be able to print something directly from the browser, but without displaying the usual print dialog box. I don't have much time in the webdev business, but I've never heard of this kind of request, and neither had anyone else in the office.
Read more

Comments (0) | Posted in From the Workbench, Javascript, Odds 'n Ends, PHP by Dave Poole


Mar. 28, 2007 at 3:24pm

Back in the USSR

It's not a huge secret that I'm a rugby fan. There's a mystique about the rugby culture here in America. It's a lesser known sport in the US, and so when one rugby fan bumps into another fan, as they are prone to do, they usually spend a few moments swooning over the fact that someone else likes their sport. Just last night, I was out at JazzBones in my All Blacks jersey, and someone who I'd never met before started talking about rubgy with me. It was fantastic.
Read more

Comments (0) | Posted in Odds 'n Ends by Dave Poole


Mar. 16, 2007 at 10:48am

Safari and PNG Headaches

I just finished coding a new photography contest application for a client, and our graphic designer alerted me to some weirdness that Safari has with PNG images. To make a long story quite short, Safari doesn't translate PNG colors to match CSS colors reliably; it darkens them just a bit. The details are beyond me, so instead check out this article for those, and you can see an example in this image. The example labeled "Your Version" is the Safari rendering, and the box labeled "Our Version" is the Firefox rendering.

For you, this means that you shouldn't use PNG images where color matching is important, use GIF instead. However, if PNG use becomes more widespread, hopefully the treatment of PNG images by browsers and OSs will become more standard and can replace GIFs - which have fewer colors and larger filesizes.

Comments (4) | Posted in Browser Bugs, CSS, Design by Dave Poole


Feb. 28, 2007 at 1:25pm

PHP Strings - Gotcha!

Yesterday I was working with a script that saves an uploaded image to a database. If you've ever seen a binary file as a string, there's a ton of gobbelty-gook that is unreadable to people. For some very odd and inexplicible reason, my script only saved the first four character's worth of data to the database, and that's not very helpful. I did some digging, and revealed a weird gotcha in the way PHP treats strings.
Read more

Comments (0) | Posted in Coding Techniques, PHP by Dave Poole


Feb. 15, 2007 at 4:15pm

Design is Not Art

and neither is your website

When I was back in school, I would often tell people how my combined Art and Computer Science majors did not mean that I was doing graphic design, web design, or any other kind of mix of computers and art. To them, it was obvious that I would combine two usually separate majors into the usual combination. To me, however, art and computer science are totally separate. The purpose of art is in my mind to either 1) evoke an emotional response in your viewer or 2) create something beautiful. Computers are a communication medium, and the purpose of communication is to deliver information.

You can see examples of this every day - in websites of art schools that are impossible to divine information out of, or in strictly information websites that have no graphical content whatsoever. In the case of these two ideas, the graphic-less sites win out in function and usability, but the art school sites look better. The problem is, that the art school sites are impossible to use, and so it doesn't matter how good they look. The clear winner here is the plain, yet content centric site. And the lesson to learn is that content is king, and communicating that information well and effectively is the key to building a good website.
Read more

Comments (4) | Posted in Critiques, Deep Thoughts, Design by Dave Poole


Feb. 2, 2007 at 10:11am

Script Timing, v2

Making the timer look better

Last time, I outlined a way to create a simple PHP script timer. I use this timer in many of the projects that I work on, and it's really helpful to nail down trouble spots in scripts. The thing that it lacks, however, is a decent display. When you call the elapsed() function, it only gives you a number. Creating a decent display for each timer call is tedious and boring. So I simplified it. Now, I'm going to extend the existing Timer class and add some new functionality - make it look better and make it easier to call and display the information.

Read more

Comments (2) | Posted in CSS, PHP, Software Engineering by Dave Poole


Jan. 26, 2007 at 4:14pm

Making a PHP Script Timer

I've been ranting about a lot of things lately, but not many of them are related to my job description. I want to take a bit of time, and go back to good old PHP, CSS, and Javascript. Today, I'm going to go over how to create a execution timer that will let you know how much time has passed since it started. There are a number of benefits to using one of these things, for example to track down why a script would take 77 seconds to complete rather than 3 or less. (It was a bloated SQL query)
Read more

Comments (0) | Posted in PHP, Software Engineering by Dave Poole


Jan. 19, 2007 at 10:03am

Prototype Documentation

Finally...

One of the most popular javascript libraries, Prototype, has finally released a decent set of documentation. I'm really pleased, because it was a little difficult to work with not knowing what was available, and how to use all the tools.

Their website is very simple and easy to use, and will quickly become one of my most visited sites. If you haven't used Prototype, I highly reccomend taking a look at its features. It makes javascript development very fast and simple, even for complex problems. I've used it to great success. I don't know how it matches up with some other javascript libraries yet, but I'm planning on reviewing all of them.

Comments (2) | Posted in Critiques, Javascript by Dave Poole


Jan. 8, 2007 at 2:44pm

Let me know you care

One of my biggest soapboxes is the communication soapbox. Everyone has had times when communication broke down, and something went horribly wrong as a result. I don't mind saying I've had more than a few, but each time I took the effort to figure out why the breakdown occurrred so that I can fix it in the future.

One of the biggest, most beneficial means of communication is meeting with people face to face. There is mountains of data, information, and communication that goes on with facial gestures alone, and body language and tone of voice are equally important. Unfortunately working in a consulting agency, I don't get to meet many of the people that I'm building software for.

As a result, I have to fall back on more technical, yet less personal means of communication such as phone calls, email, and instant messaging. Here's some tips I've compiled about effectively communicating with out seeing the person you're talking to.
Read more

Comments (3) | Posted in Deep Thoughts by Dave Poole


Dec. 13, 2006 at 4:12pm

The <select> Tag and innerHTML

While I was working on a recent project, I ran into a weird bug with IE 6. I was using some AJAX to dynamically fill a <select> tag with options depending on what element was selected from the tag's parent. It worked fine, and quite seamlessly in Firefox, but broke for inexplicable reasons in IE. Read more

Comments (6) | Posted in Browser Bugs, Javascript, PHP by Dave Poole


Dec. 7, 2006 at 11:36am

How My New Car Can Help Your Website

I just got a new car - a Volvo 240 Wagon. I can't wait to take it on a road trip. This is the first time I've gotten my own car, and so I've been dealing with all the licensing, emissions, and insurance paperwork that goes along with buying a car. I've learned two important things from buying the car, and I want to share. Read more

Comments (3) | Posted in Critiques, Testimonials by Dave Poole


Dec. 1, 2006 at 8:41am

Use Functions for Readable Code

Code Soup versus Short Stories

On my way to meeting with a client, I got into a conversation about using functions in your code. One of the guys learned to write assembly first, and so his stance was that creating functions was only feasible when you used the same code more than (about) three times. That view makes a certain sense - don't deal with the overhead of creating tons of functions for stuff you'll seldom use.

I argue that you should use functions where ever possible, first because it makes code easier to generalize (and thus re-use), but also because it makes code much more readable.

Read more

Comments (1) | Posted in Coding Techniques, PHP, Software Engineering by Dave Poole


Nov. 20, 2006 at 11:55am

Two Dollars - Follow up

In response to my last post, one reader mentioned that sometimes clients take advantage of a developer's generosity, and that it seemed like I wanted the developers to grin and bear it to keep their clients happy. This is actually quite different from what I wanted to say, and so I want to expand on that a little, and why it's very important for both developers and clients to have a written set of guidelines to keep projects on track.

In my last article, I wanted to tell developers that creating something that works perfectly is almost the only acceptable outcome of a job. For example: do you notice how the gas gauge in your car (or someone's car, if you don't have one) changes depending on the angle the car is sitting on? If the car is perfectly level, the gauge reads correctly, but on hills the level may be deceptively low or high, depending on where the sensor is in the tank. This is hardly a problem when it comes to using the car; it'll keep driving as long as there is some amount of gas in the tank, but it bugs me.

Read more

Comments (0) | Posted in Software Engineering by Dave Poole


Nov. 15, 2006 at 10:39am

Two Dollars

Why going the extra mile always pays off

Two dollars is a small amount, but two is a magical number. Despite it's seeming insignificance, two represents the difference between doing a job, and doing it right.

One summer while I was still in college, I worked in a brewery in Colorado waiting tables. I recommend that everyone work in a restaurant at some time in their life. It teaches you a lot about life and service. While I was working there, I began to understand the value of such a small amount, and how much good work is worth.

Read more

Comments (0) | Posted in Deep Thoughts, Design, Software Engineering, Testimonials by Dave Poole


Nov. 8, 2006 at 1:36pm

The Joys of Object Oriented PHP

It's pretty common for PHP developers to make complex and difficult to maintain scripts, and I am no exception. I write my code in two distinctly different ways: scripts that do a whole bunch of things depending on input, and classes that do a bunch of things depending on how they are called, but from lots of different scripts. But which is better?

It's a nice ego boost for any prrogrammer to know they created a script/function/class that is really useful, and well designed, but at some point the code stops being well designed, and becomes gross. I think that point is when you have one script that displays an entire (SQL) table of data, views a particular row, edits that row, can delete that row, or can add new row to the table.

If my Software Engineering professor sees me doing that, I imagine that he'll reevalute my grade in his class.
Read more

Comments (2) | Posted in Coding Techniques, Critiques, PHP by Dave Poole


Nov. 1, 2006 at 9:16am

Bulletproof HTML Critique

I ran across a neat article from Sitepoint via Stylegala that you all should read on how to make your HTML 'perfect'. In the world of design, the concept of perfect is non-existant. There is no solution that will work for solving every problem, and there are exceptions to every rule. This article is no different. Read the full article, and then check out my comments.
Read more

Comments (3) | Posted in Critiques, CSS, Design, Javascript, XHTML by Dave Poole


Oct. 20, 2006 at 9:17am

What Customer Service Should be Like

I recently received a gift certificate to a popular online merchant, aka Company. I'm not telling who Company is, because I like them, and I don't want my comments to be taken the wrong way. The entire thing was a fiasco, but I ended up with a nice warm and fuzzy feeling, simply because the merchant actually cared about my experience.

Here's the important parts:

  • If something goes wrong, tell the customer why
  • Never have an action with out a success or error message
  • If you can reasonably accomodate the customer's request, do so
  • Respect your customer's schedule
  • If the customer isn't happy, ask them why
Read more

Comments (2) | Posted in Critiques, Testimonials by Dave Poole


Oct. 13, 2006 at 10:59am

A Piece of Query Cake

Making Inserts Sucks

If you've ever created SQL queries with PHP, you probably know what a pain it can be to create insert and update statements. I really, really (really) don't like it. As I was working on my personal site, and exploring possible frameworks to use, I came across CodeIgniter. They have a great database interaction library, especially the function for creating the insert queries.

Today, armed with only the descriptions of CodeIgniter's query helper functions, I spent 20 minutes trying to duplicate some the effect of the insert and update functions. I've never seen the code, or even used it, but I didn't have to see the code to write a similar function. Both functions take a table name and an associative array of column names and values. The update function also requires a WHERE statement, and it can't be blank. This is different from CodeIgniter, and that's so you don't accidentally reset all of the passwords in the mysql users table, or any table for that matter. And then, *poof*, the function gives you a nice sql statement.

I'll never have to write another "INSERT blah blah blah" again. Yay!
Read more

Comments (2) | Posted in Coding Techniques, MySQL, PHP by Dave Poole


Oct. 9, 2006 at 11:31am

Strange Behavior with Opera 9 and Safari

While I was working on the latest site for Airstream, I came on some extremely weird behavior concerning the navigation. First off, the designers did an extremely good job with the visuals. On the other hand, I had to be really creative to figure out how to make various parts of the site work.

Here's some background for how the navigation was supposed to work: there are five sections to the site, and each section has sub sections that show up in the navigation bar, depending on what your current location is. Navigation and sub-navigation. Also, the navigation area has a graphical background that can't change. Since the PNG spec isn't fully supported by IE yet, we had to go with GIF or JPG graphics.

Here's what it is supposed to look like (and what we ended up with):

Airstream - Intended

Read more

Comments (0) | Posted in Browser Bugs, CSS by Dave Poole