ZAT - notes on Z to A Travel

31 August 2006

Status

I’ve actually been getting quite a bit of coding done the last few weeks, so I haven’t posted much here. The user code for creating a new user id, signing in, changing your password, and so forth is done. You can now sign in, and even have it remember you on your computer (with a cookie). I don’t have any of the other user profile things done.

I decided to use the user’s email address for the user id. Each user has a (unique) nickname, so they can sign on using either their email address or their public nickname. When a user creates a new account, their password is emailed to them. They use this password to log in, but can change their password if desired. If they forget their password, they can have a new one emailed to them. This isn’t completely secure, but this website really doesn’t need a bulletproof level of security. Besides, it won’t be particularly secure until I get a certificate and start using https.

I read an interesting article that pointed out that as long as you have an easy way for people to reset their password, you don’t really need to do the common thing of having them type in their password twice. If they make a mistake, they can just reset it and try again.

As a result, creating a new account is very simple. You just type in your email address and a nickname. ZAT checks to make sure they are both unique (and valid) and then emails out a new password. Signing in is also easy — you just type in either your email address or your nickname, and your password. You can also check a box to have ZAT set a cookie and remember you on the current computer. Most people will want to do this, unless they are accessing ZAT from a random computer (like at an Internet Cafe).

I also have the first Google Map up. This is the map that allows the user to define new Regions. A Region is an area on a map, used to define countries, states, cities, neighborhoods, national parks, etc. Imagine a typical guide book — a Region in ZAT corresponds to a chapter or section in a guide book. Defining a Region is simple. You give it a name (e.g., Portland) and say what it is a part of (e.g., Oregon). You can optionally define alternate names or abbreviations (for example, for the USA you might specify that it has alternate names of “America” and “US”) — this makes it easier for people who are searching. Finally, you click on two points on the map to define the boundary of that Region. That’s it!

Next up is to implement the definition of Places. A Place corresponds to an entry in a guide book; for example, a restaurant, hotel, sight, etc.

After that is the part of ZAT concerned with associating a Place or a Region with a URL (to a web page). So for the Region “Portland” there can be a number of associated web pages, talking about travel to and about Portland. And for the Place “Benson Hotel” (one of the old classic hotels in Portland) there can be a number of links to websites with information about the Benson — the official website, blog entries from people who have stayed in the Benson, photos of the Benson, special discount offers to stay at the Benson, etc.

Then I can start to tackle the really hard part — letting people search a map for Places and Regions, and giving them access to the associated links.

So far it is going well. The Google Maps API is pretty straightforward JavaScript, and is well documented. I did spend a day trying to track down a bug, which turned out to be a bug in their library. I’ve submitted it but it has not been fixed yet. Luckily, it fails only on Safari (not on Firefox or IE, the two other browsers I test), so hopefully Google will fix this bug before I launch ZAT.

Filed under: General — zat @ 6:08 pm

Books

I’ve been reading a number of books in order to bring myself up to speed on current web technologies. Here are some of the ones I’m most enjoying:

Web Design in a Nutshell (third edition) by Jennifer Robbins
Bulletproof Web Design by Dan Cederholm
Pro MySQL by Kruckenbert and Pipes
JavaScript: The Definitive Guide (fifth edition) by David Flanagan

I’ve also bought the following, but haven’t read them enough to evaluate them yet:

DOM Scripting by Jeremy Keith
PHP Hacks by Jack Herrington
Google Maps Hacks by Gibson and Erle
Web Mapping Illustrated by Tyler Mitchell
Mapping Hacks by Erle, Gibson & Walsh
Upgrading to PHP5 by Adam Trachtenberg
Programming PHP by Lerdorf, Tatroe & MacIntyre (so far not too impressed)
Beginning PHP and MySQL 5 by Jason Gilmore

I’ve used a lot of programming languages in my time (even invented a couple of them) but it is very interesting trying to learn two similar languages (PHP and JavaScript) at the same time. Oy! I wish someone would create a decent set of server-side libraries for JavaScript, so you could write both the server-side and client-side code in the same language.

The other day I wrote some Javascript and it wouldn’t work. I looked at it and looked at it, and couldn’t see anything wrong with it. I checked all the library functions to make sure I was calling them correctly. Suddenly, I realized that I was trying to use a PHP library function in a JavaScript program. I was calling it with the correct arguments, I was just in the wrong language. Doh!

–wm

Filed under: General — zat @ 5:20 pm

Powered by WordPress