Gossamer Forum
Home : Products : DBMan : Customization :

E-mail and URL not "clickable"

Quote Reply
E-mail and URL not "clickable"
Don't you just love the way newbies phrase things?
Anyway, I'm working with an existing dbman that has an entry for "email" and "url" in the Add form. Problem is, when the form displays, the email and url are displayed as plain text and not launchable ;o)

I can't determine where and in what form I need to add or modify dbman so that these fields are clickable <ducking>

Reall, really need this one answered.


Lance

Quote Reply
Re: E-mail and URL not "clickable" In reply to
Try this:

<a href="mailto:$rec{'Email'}">$rec{'Email'}</a>

<a href="$rec{'URL'}">$rec{'URL'}</a>

Quote Reply
Re: E-mail and URL not "clickable" In reply to
Thanks Phillip but where do I put it.

Quote Reply
Re: E-mail and URL not "clickable" In reply to
It depends where you want it. Are you using the short/long display mod?

Quote Reply
Re: E-mail and URL not "clickable" In reply to
No. I think.

A friend began this for me and had to leave town suddenly on family business.

I have done a quick study using JP's configuration utility and without modifying the script have the default form with the e-mail and url are "clickable".

I can see here settings in default.config and they are similar to mine but not hyperlinked.

//snip

# Database Definition
# --------------------------------------------------------
# Definition of your database. Format is
# field_name => ['position', 'field_type', 'form-length', 'maxlength', 'not_null', 'default', 'valid_expr']

%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
category => [1, 'alpha', 40, 255, 1, '', ''],
name => [2, 'alpha', 40, 255, 1, '', ''],
address => [3, 'alpha', 40, 255, 1, '', ''],
city => [4, 'alpha', 40, 255, 1, '', ''],
state => [5, 'alpha', 40, 255, 1, '', ''],
zip => [6, 'alpha', 40, 255, 1, '', ''],
phone => [7, 'alpha', 40, 255, 1, '', ''],
fax => [8, 'alpha', 40, 255, 1, '', ''],
Filename => [9, 'alpha', 40, 255, 0, '', ''],
Graphic => [10,'alpha',0,255,0,'','Yes'],
founded => [11, 'alpha', 40, 255, 1, '', ''],
employees => [12, 'alpha', 40, 255, 1, '', ''],
guarantee => [13, 'alpha', 40, 255, 1, '', ''],
emergency => [14, 'alpha', 40, 255, 1, '', ''],
bonded => [15, 'alpha', 0, 3, 1, 'Yes', 'Yes|No'],
license => [16, 'alpha', 40, 255, 1, '', ''],
email => [17, 'alpha', 40, 255, 1, '', ''],
url => [18, 'alpha', 40, 255, 0, 'http://', '^http://'],
profile => [19, 'alpha', '40x3', 500, 0, '', ''],
specialization => [20, 'alpha', 40, 255, 0, '', ''],
verified => [21, 'alpha', 40, 255, 0, '', ''],
verified_button => [22, 'alpha', 40, 255, 0, '', ''],
user => [23, 'alpha', -2, 15, 0, '', '']
);

//end snip

Guess my question is how does dbman 'know' that email and url should be hyperlinked.

TVM - Lance

Quote Reply
Re: E-mail and URL not "clickable" In reply to
What you are showing me below is all your field definitions.

In Reply To:
Guess my question is how does dbman 'know' that email and url should be hyperlinked.
It doesn't know. You need to add the code I provided you wish in the second post in this thread.

Can you save your html.pl file as a html.txt and post a link for it here. I'll then be able to tell you where to put that code...

Quote Reply
Re: E-mail and URL not "clickable" In reply to
Wow! Thanks

http://www.nmcontractors.com/htmlpl.htm

Quote Reply
Re: E-mail and URL not "clickable" In reply to
First of all in "default.cfg" do you have $db_auto_generate enabled? If so then disable it.

This procedure:


sub html_record {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.

my (%rec) = @_; # Load any defaults to put in the VALUE field.
($db_auto_generate and print &build_html_record(%rec) and return);

my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';
my $font = 'Font face="Verdana, Arial, Helvetica" Size=2';

print qq|
<TABLE WIDTH="475" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>ID:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'ID'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Title:</FONT></TD>
<TD> <$font>$rec{'Title'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>URL: </FONT></TD>
<TD> <$font><A HREF="$rec{'URL'}">$rec{'URL'}</A></Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Type: </FONT></TD>
<TD> <$font>$rec{'Type'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Date:</FONT></TD>
<TD> <$font>$rec{'Date'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Category:</FONT></TD>
<TD> <$font>$rec{'Category'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Description:</FONT></TD>
<TD> <$font>$rec{'Description'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Validated:</FONT></TD>
<TD> <$font>$rec{'Validated'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Popular:</FONT></TD>
<TD> <$font>$rec{'Popular'}</Font></TD></TR>
</TABLE>
|;
}


is where your search results are displayed. You'll need to add all the fields you want displayed in here and then add this code in there:

<a href="mailto:$rec{'email'}">$rec{'email'}</a>

<a href="$rec{'url'}">$rec{'url'}</a>

for the "email" field and "url" field.

Hopefully I've explained myself alright and have been of some help. If not let me know.


Quote Reply
Re: E-mail and URL not "clickable" In reply to
You da Man!

I'll make the changes and post my glee - probably tomorrow.

If you ever get out to sunny NM the drinks are on me.

Lance

Quote Reply
Re: E-mail and URL not "clickable" In reply to
Great - glad I was of some help Smile.

Well I live in New Zealand so I don't think I'll be anywhere near New Mexico anytime soon but I might hold you to that one day Wink Smile

Good luck with your database.
Quote Reply
Re: E-mail and URL not "clickable" In reply to
Philip.

It was a 'mod' or something 'cause the file that needed the changes was called directory_html.pl

Anyway,it works! Not to abuse your good nature, but is there a way to have the link open in a new window instead of sending them away when they click the url?

BTW, friends of ours who are teachers at the Waldorf school here in Santa Fe just moved to New Zealand. Juta and Mark. Can't be that many Waldorf schools in NZ, or can there?

Lance

Quote Reply
Re: E-mail and URL not "clickable" In reply to
In Reply To:
It was a 'mod' or something 'cause the file that needed the changes was called directory_html.pl
Sorry I meant to say "html.pl" but the person who setup your database must have renamed the file.

In Reply To:
Anyway,it works! Not to abuse your good nature, but is there a way to have the link open in a new window instead of sending them away when they click the url?
Great Smile

Try this:

<a href="$rec{'URL'}" target="_blank">$rec{'URL'}</a>

In Reply To:
BTW, friends of ours who are teachers at the Waldorf school here in Santa Fe just moved to New Zealand. Juta and Mark. Can't be that many Waldorf schools in NZ, or can there?
What part of New Zealand is that? Auckland, Wellington, Christchurch, Dunedin?


Quote Reply
Re: E-mail and URL not "clickable" In reply to
You should use:

target="newwin"

....for cross-browser compatibility.

Installations:http://www.wiredon.net/gt/

Quote Reply
Re: E-mail and URL not "clickable" In reply to
>>What part of New Zealand is that? Auckland, Wellington, >>Christchurch, Dunedin?

Ahh. Us Yanks. Dunno. I'll find out.

How do you do that 'edit' thing anyway.


Quote Reply
Re: E-mail and URL not "clickable" In reply to
Hi Paul!

Thanks for the tip. I'll give it a go on Moday.

L.

Quote Reply
Re: E-mail and URL not "clickable" In reply to
I'm not really sure what you mean but have a look here http://www.gossamer-threads.com/...english.pl?Cat=#html and I'm sure you'll find an answer