Gossamer Forum
Home : Products : DBMan : Customization :

Compare fields

Quote Reply
Compare fields
I'm using DBMan to keep track of clubs. Is there a way to have DBMan check to see if there is an E-mail address? If there is something in the E-mail field in the database when it is viewed have it show an icon, and if there is no E-mail address then do nothing.Laugh

Thanks,
Dean
Quote Reply
Re: [Chandler] Compare fields In reply to
Are you using auto-generate? If not you can do something simple such as (under html_record in html.pl):

|; if ($rec{'email'} ne "") {print qq|<img src="./pic.jpg">|;} print qq|

of course you could get really fancy and do something like:

|; if ($rec{'email'} ne "") {
if ($rec{'email'} =~ /yahoo.com/) {print qq|<img src="./yahoo-logo.gif">|;}
elsif ($rec{'email'} =~ /hotmail.com/) {print qq|<img src="./hotmail-logo.gif">|;}
elsif ($rec{'email'} =~ /aol.com/) {print qq|<img src="./aol-logo.gif">|;}
else {print qq|<img src="./generic-email-logo.gif">|;}
} print qq|

Try it and see what happens. Note that there is no "e" in the else/if statement (elsif).

Good Luck!

Ps: If you're using auto-generate then we'll have to punt.
Quote Reply
Re: [Watts] Compare fields In reply to
That seems to be working. How do I keep the mailto active? Here is what I have. The icon is only there if there is an E-mail address, but the mailto is not working.
<TD |; if ($rec{'Email'} ne "") {print qq|<A HREF="mailto:$rec{'Email'}"><img src="email.gif" border="0"></A>|;} print qq|<$font></Font></TD>


Thanks,
Dean
Quote Reply
Re: [Chandler] Compare fields In reply to
Probably just a typo here, but make sure your <TD> tag is closed properly. Here you have <TD |; and it should be <TD>|;

Otherwise it looks like it *should* work. Can't see any reason why not.
Quote Reply
Re: [Watts] Compare fields In reply to
Thanks Cool,

I appreciate all the help you gave me. It is working now.


Dean