Gossamer Forum
Home : Products : Links 2.0 : Customization :

Need Email Address instead of URL in Links 2

Quote Reply
Need Email Address instead of URL in Links 2
I am trying to set up my search engine with e-mail addresses instead of URL's. I found a couple notes here in the modification section about it. But I think they were a little incomplete. My question is what does the Add form look like. What changes do I need to make. And how do you keeep it from giving you a "invalid format" for url field?

Any help is greatly appreciated. Thanks!

thomas@lightwaveworld.com
Quote Reply
Re: Need Email Address instead of URL in Links 2 In reply to
If they'll all be email addresses, change the default for the URL field from 'http://' to 'mailto:' in the links.def file.

You'll might want to alter the text of the add form, add success, add failure, modify, modify success and modify failure pages to say name instead fo title and email instead of URL. But they will work as they are, no other changes in the program are necessary.

Dan O.
Quote Reply
Re: Need Email Address instead of URL in Links 2 In reply to
I've tried a few different things and I took DanO's suggestion and put "mailto:" in place of "http://" in the links.def file. And made some changes in the add form. But it still comes back and says "URL (Invalid format)". So where do I go now?

Feel free to try it out and see what I mean.

http://www.lightwaveworld.com/cgi-bin/treasure/hunters/add.cgi
Quote Reply
Re: Need Email Address instead of URL in Links 2 In reply to
I don't have time to answer all of your questions, but I don't think Links would return an invalid call because in Links.def, its specified to take ftp urls, http urls, and mailto: urls

------------------
------------------------------------------
Lavon Russell
LookHard! Search
http://www.lh.yi.org
Quote Reply
Re: Need Email Address instead of URL in Links 2 In reply to
OK, I've taken a look and I think its one of two reasons. People aren't writing in "mailto: email@address" they are probably writing in webmaster@blah.com, so look at the contact email in links.def and copy(make backup first) the '.+@.+\..+'], and replace '^http|news|mailto|ftp'],
OR 2, take the mailto: where shown at line above and switch it with the http.

For Number 1, if you don't know the contact email, it looks like this Contact Email' => [7, 'alpha', 40, 75, 1, '', '.+@.+\..+'],

Try number 1 first
------------------
------------------------------------------
Lavon Russell
LookHard! Search
http://www.lh.yi.org

[This message has been edited by Bmxer (edited July 24, 1999).]
Quote Reply
Re: Need Email Address instead of URL in Links 2 In reply to
I'm still not getting anywhere it seems. I had a problem in the admin screen where I have about 57 categories in my database but am unable to add anything through the admin area. It comes back with Unable to add THer. THer stands for Treasure Hunter. And it says URL (Invalid Format). Hmmm! Am I still missing something here. Tried all your suggestions. Anyone care to take a peek if I give you the URL?

Drop me a line.

thomas@lightwaveworld.com
Quote Reply
Re: Need Email Address instead of URL in Links 2 In reply to
I don't know why you're having a problem with email addresses in the URL field. I used that field for email addresses before I modified anything in the original script.

I just made sure the 'mailto:' was at the beginning, hence the change of the default value in the links.def I suggested.

Dan O.
Quote Reply
Re: Need Email Address instead of URL in Links 2 In reply to
OK! I finally got it to accept the entry without it complaining about it being (URL Invalid). But now it doesn't link the name on the category page.

This is what I have now:
Quote:
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 1, 'http://', ''],
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']
And my category page is located here:
http://www.lightwaveworld.com/Treasure/thers/Indiana/

[This message has been edited by Thomas Clark (edited July 25, 1999).]
Quote Reply
Re: Need Email Address instead of URL in Links 2 In reply to
Seems the only way I can get it to accept an entry as an e-amil address instead of an URL is like this:
URL => [2, 'alpha', 40, 75, 1, 'mailto:', ''],

But it still doesn't create a link on the pages for the title.

http://www.lightwaveworld.com/Treasure/thers/Indiana/
This page has no links on it. Why? What am I missing here. I've played with it for the last couple hours. Even when I put it back to default it still doesn't give me a link.

What gives?
Quote Reply
Re: Need Email Address instead of URL in Links 2 In reply to
Did you alter the code that defines how the links are formatted?

Are you using templates?

Dan O.
Quote Reply
Re: Need Email Address instead of URL in Links 2 In reply to
Yes I am using templates. I've started over from scratch with all new files and it seems to work now. Although I have a bunch of new problems.

I'll post a new topic on it if I can't find one posted already.

Thanks everyone!