Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Confirmation of steps

Quote Reply
Confirmation of steps
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.

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>
Thats one example.

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).]
Quote Reply
Re: Confirmation of steps In reply to
Sounds good.

If this is an existing database, you have added the fields via the upgrade.pl script written by Bobsie, right?

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------








Quote Reply
Re: Confirmation of steps In reply to
Hi Elliot!

Thanks for the reply.

The script I use is called fields.cgi. I got it off the forum somewhere and used when I installed the Alt Category mod.

If you have to insert multipule fields then one has to run it multiple times.

------------------
www.nzcid.godzone.net.nz
New Zealand Christian Internet Directory




Quote Reply
Re: Confirmation of steps In reply to
Right...and that script was originally written by Bobsie.

Wink

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------








Quote Reply
Re: Confirmation of steps In reply to
Hi Elliot!

Okay - I am thankful for it as it makes it easier for me a noivce at this to add the fields.

Just a couple of questions..

I want to users to be able to send an email and get their ID number so if they have to mod their entry they can find it easily enough. As many of the entries wont have URL addresses.

What else would you suggest I add in this area.



------------------
www.nzcid.godzone.net.nz
New Zealand Christian Internet Directory




Quote Reply
Re: Confirmation of steps In reply to
Use the Password Lookup Mod in the Resource Center...first place to check ALWAYS.

Wink

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------








Quote Reply
Re: Confirmation of steps In reply to
Hi Elliot!

Thanks! Just wanted to make sure of the correct name of the mod.

Couple of other things you could answer for me:

See this line in the links.def], Service Times =>[7, 'alpha', '40x2', 500, 0, ", "],

I want the default text to be either N/A or Not Applicable to appear when there is nothing entered. I want it to appear on the actual link in the DB not just in the admin.

2.
I have included the email field to show on links, but it shows as text not as an email address on can click on to send the person an email..

I have not altered this code as it is part of links:

'Contact Email' => [9, 'alpha', 40, 75, 1, '', '.+@.+\..+'],

What would be the code at the end to make it appear as I am seeking.


------------------
www.nzcid.godzone.net.nz
New Zealand Christian Internet Directory




Quote Reply
Re: Confirmation of steps In reply to
1) You cannot do it in the links.def unless you want N/A to also appear in the add form and modify form in that field.

What you have to do is following in link.html template file:

Code:
<%if Service Times%>
<%Service Times%>
<%endif%>

AND

Code:
<%ifnot Service Times%>
N/A
<%endif%>

2) You have to add the email link yourself in the link.html file! Like the following:

Code:
<%if Contact Email%>
<a href="mailto:<%Contact Email%>"><%Contact Email%></a>
<%endif%>

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------








Quote Reply
Re: Confirmation of steps In reply to
Hi Elliot!

Code:
<%if Contact Email%><a href="mailto:<%Contact Email%>"><%Contact Email%></a><%endif%>

I did this and rebuilt and it still shows as text.. What could I have done wrong?



------------------
www.nzcid.godzone.net.nz
New Zealand Christian Internet Directory




Quote Reply
Re: Confirmation of steps In reply to
It shouldn't! It should show it as a LINK!

Since you are probably not using the Enhanced Template.pm, make sure that you use the codes that I posted EXACTLY with the tags on separate lines...Make sure that this is in your link.html file:

Code:
<%if Contact Email%>
<a href="mailto:<%Contact Email%>">
<%Contact Email%></a>
<%endif%>

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------








Quote Reply
Re: Confirmation of steps In reply to
Hi Elliot!

Still no joy! It is showing all the mail addresses as text.

I am using the enhanced template.pm but I changed it anyways.

------------------
www.nzcid.godzone.net.nz
New Zealand Christian Internet Directory




Quote Reply
Re: Confirmation of steps In reply to
Uh...Ian...Check again...I just looked at your HTML Source Code, and guess what I saw!

Code:
<a hef="mailto:penny@elim.org.nz">
penny@elim.org.nz</a>

It should be:

Code:
<a href="mailto:penny@elim.org.nz">
penny@elim.org.nz</a>

YOU ARE missing the r for the href code!

Edit your link.html and then re-build your index!

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------








Quote Reply
Re: Confirmation of steps In reply to
Hi Elliot!

Many many thanks - I just did not see that. Error corrected and all is well.

Once again many thanks.

Installed both password mods and they work as well.

Now we only have to import all the old data from the other DB's in the new format.


------------------
www.nzcid.godzone.net.nz
New Zealand Christian Internet Directory




Quote Reply
Re: Confirmation of steps In reply to
Good. Have you bought that HTML book I recommended? You should really consider buying it SOON. (OH, and using it!)

Good luck with the conversion.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. Smile
----------------------










[This message has been edited by Eliot (edited January 31, 2000).]