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.
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.