After reading up all the resources and some other forums this is what I have done for adding fields.
1. Changed the link.def to incorporate the new fileds as per the resource centre instructions.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 0, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
AltCategories => [5, 'alpha', 0, 500, 0, '', ''],
Description => [6, 'alpha', '40x3', 500, 0, '', ''],
Service Times =>[7, 'alpha', '40x2', 500, 0, ", "],
'Contact Name' => [8, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [9, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
Phone => [10, 'numer', 40, 30, 0, ", "],
Fax => [11, 'numer' 40, 30, 0, ", "],
Hits => [12, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [13, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [14, 'alpha', 0, 5, 0, 'No', ''],
Rating => [15, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [16, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [17, 'alpha', 10, 10, 1, 'Yes', 'No|Yes']
);
# Database file to use -- defined in links.cfg.
$db_file_name = $db_links_name;
# Counter file to use -- defined in links.cfg.
$db_id_file_name = $db_links_id_file_name;
# The column name for the database key.
$db_key = 'ID';
# Database delimeter.
$db_delim = '|';
# Title used in admin output.
$html_title = 'Links Database';
$html_object = 'Link';
# Field Number of some important fields. The number is from %db_def above
# where the first field equals 0.
$db_Service_Times = 7;
$db_alt = 5; $db_phone = 10; $db_fax = 11;
$db_category = 4; $db_modified = 3; $db_url = 2;
$db_hits = 12; $db_isnew = 13; $db_ispop = 14;
$db_contact_name = 8; $db_contact_email = 9; $db_title = 1;
$db_votes = 16; $db_rating = 15; $db_mail = 17;
2.In all the add and mod forms I have added the fields as well.
<td align="left" valign="top" bgcolor="#EEEEEE"><font face="Arial,Helvetica" size="2">Church Service Times:</font></td>
<td><font face="Arial,Helvetica" size="2"><textarea wrap="virtual" name="Service Times" value rows="2" cols="42"></textarea></font></td>
</tr>Thats one example.
3.In the site.template.html.pl in all the sub sites for these forms I added the following.
Phone => $phone,
Fax => $fax,
How am I doing so far?
I know I need to add these fields to the DB and I can use the fields.cgi for that and run it three times for the three different fields.
After all this what else do I need to do. These fileds will need to be in the email sent to me.
Is this what do to get it to do the above.
In the add.cgi and modify.cgi
add this at sub send_email:
Service Times: $in{'Service_Times'}
Phone: $in{'Phone'}
Fax: $in{'Fax'}
I have kept a backup copy of everything and am still yet to include the fields in the DB. Before I did that I wanted to make sure what I had done was right.
------------------
www.nzcid.godzone.net.nz
New Zealand Christian Internet Directory
[This message has been edited by Ian Conza (edited January 30, 2000).]
1. Changed the link.def to incorporate the new fileds as per the resource centre instructions.
Code:
# Definition of your database file. %db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 0, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
AltCategories => [5, 'alpha', 0, 500, 0, '', ''],
Description => [6, 'alpha', '40x3', 500, 0, '', ''],
Service Times =>[7, 'alpha', '40x2', 500, 0, ", "],
'Contact Name' => [8, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [9, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
Phone => [10, 'numer', 40, 30, 0, ", "],
Fax => [11, 'numer' 40, 30, 0, ", "],
Hits => [12, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [13, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [14, 'alpha', 0, 5, 0, 'No', ''],
Rating => [15, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [16, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [17, 'alpha', 10, 10, 1, 'Yes', 'No|Yes']
);
# Database file to use -- defined in links.cfg.
$db_file_name = $db_links_name;
# Counter file to use -- defined in links.cfg.
$db_id_file_name = $db_links_id_file_name;
# The column name for the database key.
$db_key = 'ID';
# Database delimeter.
$db_delim = '|';
# Title used in admin output.
$html_title = 'Links Database';
$html_object = 'Link';
# Field Number of some important fields. The number is from %db_def above
# where the first field equals 0.
$db_Service_Times = 7;
$db_alt = 5; $db_phone = 10; $db_fax = 11;
$db_category = 4; $db_modified = 3; $db_url = 2;
$db_hits = 12; $db_isnew = 13; $db_ispop = 14;
$db_contact_name = 8; $db_contact_email = 9; $db_title = 1;
$db_votes = 16; $db_rating = 15; $db_mail = 17;
2.In all the add and mod forms I have added the fields as well.
Code:
<tr> <td align="left" valign="top" bgcolor="#EEEEEE"><font face="Arial,Helvetica" size="2">Church Service Times:</font></td>
<td><font face="Arial,Helvetica" size="2"><textarea wrap="virtual" name="Service Times" value rows="2" cols="42"></textarea></font></td>
</tr>
3.In the site.template.html.pl in all the sub sites for these forms I added the following.
Code:
Service_Times => $service_times, Phone => $phone,
Fax => $fax,
How am I doing so far?
I know I need to add these fields to the DB and I can use the fields.cgi for that and run it three times for the three different fields.
After all this what else do I need to do. These fileds will need to be in the email sent to me.
Is this what do to get it to do the above.
In the add.cgi and modify.cgi
add this at sub send_email:
Service Times: $in{'Service_Times'}
Phone: $in{'Phone'}
Fax: $in{'Fax'}
I have kept a backup copy of everything and am still yet to include the fields in the DB. Before I did that I wanted to make sure what I had done was right.
------------------
www.nzcid.godzone.net.nz
New Zealand Christian Internet Directory
[This message has been edited by Ian Conza (edited January 30, 2000).]