Working on dealing with cities like 'Kowloon' - which don't have a direct match as 'Kowloon City' is actual city name. It appears in the soundex search - but that isn't sorted either.
I'm adding a 'reorg_possibles' function which will sort the combined direct and soundex matches, this is based on :
Given CITY and COUNTRY - we get a list of possibles+soundexes back from the the atlas web-service. These are a list of PCITY and PCOUNTRY
If PCOUNTRY is a priority country (UK, England....):
{
If PCITY matches CITY - actually Left$(PCITY, LEN(CITY)) = CITY
Add PCITY/PCOUNTRY to array_match
ELSE
Add PCITY/PCOUNTRY to array_country
}
ELSE // The PCOUNTRY isn't a priority
{
If PCITY matches CITY (As above)
Add PCITY/PCOUNTRY to array_lower_match
ELSE
Add PCITY/PCOUNTRY to array_lower_country
}
Then combine the arrays into a list in the following order:
array_match, array_lower_match, array_country, array_lower_country
So for London, you'll get all the London's in the UK, then Londons in the rest of the world, then near London matches in the UK, then near London matches in the rest of the world.
For Kowloon, you'll get Kowloon City, then near matches in the UK, followed by near matches in the rest of the world.
I've redirected a successful registration through the external site, using the redirect.php to load the parent frame.
The new_user2.php page currently uses two forms, one after the other. The first contains the birth date and time fields, and the city and country of birth fields. The second contains the listbox with the possible matches. Both forms submit to the same page, but were kept separate to make sure the php code was picking up the correct submit button. In order to re-arrange the fields (sticking the birth city and country fields under everything else,) I'll have to merge them in
to a single form, and work on making sure that PHP can pick up the correct submit button.
No comments:
Post a Comment