Gossamer Forum
Home : Products : Links 2.0 : Customization :

Expedia Map Mod

Quote Reply
Expedia Map Mod
This is for adding a Map Feature to your links using Expedia.Com.
This will only work if the link has a physical address and isn't only a Web link, like a local
business or Artist.
First let me say that I am NOT a programmer, someone else may come up with a better way of
doing this, but it works for me. This assumes you have a blank links.db, if your links.db
already has links in it you will have to edit it to include the new fields, this is discussed
(in detail) on how to do this in the FAQ & forums.


links.def Near the top you will see this section:

# Database Definition: LINKS
# --------------------------------------------------------
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 1, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
Description => [5, 'alpha', '40x3', 500, 0, '', ''],
'Contact Name' => [6, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [7, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
Hits => [8, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [9, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [10, 'alpha', 0, 5, 0, 'No', ''],
Rating => [11, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [12, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes']
);




Change it to this:

# Database Definition: LINKS
# --------------------------------------------------------
# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 1, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
Description => [5, 'alpha', '40x3', 500, 0, '', ''],
'Contact Name' => [6, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [7, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
Hits => [8, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [9, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [10, 'alpha', 0, 5, 0, 'No', ''],
Rating => [11, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [12, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],
Stnum => [14, 'alpha', 10, 10, 1, '', ''],
Stname => [15, 'alpha', 40, 75, 1, '', ''],
Sttype => [16, 'alpha', 10, 10, 1, '', ''],
Town => [17, 'alpha', 40, 75, 1, '', ''],
State => [18, 'alpha', 5, 5, 0, '', ''],
Zip => [19, 'numer', 10, 10, 1, '', '']

);


Note the comma at the end of each line EXCEPT the last line, no comma there.



A little farther down find this:

# Field Number of some important fields. The number is from %db_def above
# where the first field equals 0.
$db_category = 4; $db_modified = 3; $db_url = 2;
$db_hits = 8; $db_isnew = 9; $db_ispop = 10;
$db_contact_name = 6; $db_contact_email = 7; $db_title = 1;
$db_votes = 12; $db_rating = 11; $db_mail = 13;



Change it to this:

# Field Number of some important fields. The number is from %db_def above
# where the first field equals 0.
$db_category = 4; $db_modified = 3; $db_url = 2;
$db_hits = 8; $db_isnew = 9; $db_ispop = 10;
$db_contact_name = 6; $db_contact_email = 7; $db_title = 1;
$db_votes = 12; $db_rating = 11; $db_mail = 13;
$db_stnum = 14; $db_stname = 15; $db_sttype = 16;
$db_town = 17; $db_state = 18; $db_zip = 19;




detailed.html

Add the following line to your detailed page where ever you want the link to be:

<p><a href="http://maps.expedia.com/pub/agent.dll?qscr=mcst&strt1=<%Stnum%>+<%Stname%>+<%Sttype%>&city1=<%Town%>
&stnm1=Maine&zipc1=<%Zip%>"target="_blank" title="Map">Click here for a map of this business</a></p>




add.cgi and modify.cgi

sub send_email


Add the following:

Address: $in{'Stnum'} $in{'Stname'} $in{'Sttype'}.
City/Town: $in{'Town'}
State: $in{'State"}
Zipcode: $in{'Zip'}



You will also have to add the fields:

<%Stnum%> (for the street number of the building)
<%Stname%> (name of the street)
<%Sttype%> (street ext., St., Ave. etc...)
<%Town%> (town the business is in)
<%State%> (State the business is in)
<%Zip%> (Zip of the business)

to your:

add.html
add_error.html
add_success.html
detailed.html
modify.html
modify_success.html


That's about it, I've tried setting up the Driving Directions feature with the destination all setup
and the starting point left blank, but havn't gotten the url right yet, when I get this working I'll
add it to this mod.


Quote Reply
Re: Expedia Map Mod In reply to
You could also display the main map with the following codes:
Code:
<img src="http://msrvmaps.expedia.com/isapi/MSMap.dll?ID=33BkD.&C=40.266667,-85.833727&L=USA0409&CV=1&A=6&S=296,240&O=0,0&MS=0&P=|40.266667,-85.833727|1|<%Stnum%>+<%Stname%>+<%Sttype%>
<%Town%>,+<%State%>+<%Zip%>|L1|">
If you're real slick with LWP and regex's you can grab the whole page and edit out some of Expedia's stuff to cobrand it as your own.

--Drew
Quote Reply
Re: [Just_Lost] Expedia Map Mod In reply to
Any idea how I can link 30,000 addresses to Google/Microsoft/etc maps? Thanks, GeneUnsure
Gene99
Quote Reply
Re: [gene99] Expedia Map Mod In reply to
Check the code here >> http://www.executivehardwood.com/mapcode1.html
It has driving directions too. Just get a Google API/map key >> the long set of numbers & letters at the top of the code & look up the longitude & latitude of each address. , plug the 3 in there & change the address & location info & that's it. Gene
Gene99