Gossamer Forum
Home : Products : Links 2.0 : Customization :

Using URL for email and Title as name

(Page 2 of 2)
> >
Quote Reply
Re: [esm] Using URL for email and Title as name In reply to
It's easy for me to confuse people.
Simply put.

I originally used Title as a person's name.
URL was a mailto: instead of http://

Then there was category and description.
Following was the Contact Name and Contact Email.

It all worked just fine this way.
The redundancy was a person needed to enter the Title and Contact Name which was actually the same. As well as the URL field and Contact Email, which too was the same.

The theory was to substitute Contact Name and Email for Title and URL.

I know it was a stretch, but figured if I couldn't do it, I can always go back to the orginal way I had it. Of course by now I have edited so much code that I would have to start from scratch.

So I am going to correct the mistakes and try again.
Please don't go anywhere. Unsure
...steven
MINI Links
BMW 318ti Registry
Quote Reply
Re: [esm] Using URL for email and Title as name In reply to
I can confuse easily confuse people.

Simply put, I was using Title as a name. URL as a mailto:
Category and Description.

Then Contact Name and Contact Email.

The redundancy was that the Title and Contact Name where the same as were the URL and Contact Email.
It all worked fine this way.
What I wanted to do is to eliminate the Title and URL fields.

I just corrected my links.html page and voila!
It is working EXACTLY how I want it to.

Some of the other problems I encounted what that Title and URL was used on the email.txt files. I removed them and that got rid of the unkown tag error.

Now it's a matter of editing some more pages just to format them properly on the page.

Thanks guys. This has been quite a learning experience.
Links2 is awesome that it is so adaptable.SmileSmileSmile

There is somekind of iMac bug though.
I can not add resources. Modify is OK. I can't add on someone else's Link2 file either. But I'm fine on a PC and my Mac laptop.

Thanks again!
...steven
MINI Links
BMW 318ti Registry
Quote Reply
Re: [steven1214] Using URL for email and Title as name In reply to
This is so cool. It's already working like I want.Blush

Now I just need to add a Meta tag so spiders don't snatch all of the email addresses.
...steven
MINI Links
BMW 318ti Registry
Quote Reply
Re: [steven1214] Using URL for email and Title as name In reply to
Good news!

Now, just to complicate your life more, you could have the link go through jump.cgi, using the ID# field, which would keep the email addresses out of the code. This would require a bit of hacking to make jump.cgi look up the email address instead of the URL. Not too, hard, I'm sure... If you can get that to work, the only change you would need to make to what you have already done is to the link.html, a very minor thing.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Using URL for email and Title as name In reply to
No changes need to be done for jump.cgi... instead, you'll want to change the routine that builds url.db. The file is an abbreviated version of links.db that only contains the ID number and the URL for quicker lookup.

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy thoughts] Using URL for email and Title as name In reply to
Funny how this thread and project went full circle.

From Replacing Title and URL with Contact Name and Contact Email. Now to got back to the start and and reincorporate the jump.cgi.

I'll look into it and report back.

Then after that I need to add 2 fields.
Might even go back using the URL field.

This just goes to show how good Link2 is right from the start.

...steven
...steven
MINI Links
BMW 318ti Registry

Last edited by:

steven1214: Jan 11, 2003, 9:54 AM
Quote Reply
Re: [steven1214] Using URL for email and Title as name In reply to
I understand the concept but am lost in the execution.

Currently in my links.html file I have

Code:
<a class="link" href="mailto:<%Contact Email%>"><%Contact Name%></a>

I changed it to

Code:
<a class="link" href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>"><%Contact Email%></a>

Figuring I need to make some changes in my jump.cgi, I removed

Code:
# Let's get the URL.
open (URL, "<$db_url_name") or &error ("unable to open url database: $db_url_name. Reason: $!");
while (<URL>) {
(/^$id$delim(.+)/o) or next;
chomp ($goto = $1);
last;
}
close URL;
$goto or &error ("Can't find link id: $id");

And replaced it with

Code:
# Let's get the Contact Email Address.
open (URL, "<$db_email_name") or &error ("unable to open url database: $db_email_name. Reason: $!");
while (<URL>) {
(/^$id$delim(.+)/o) or next;
chomp ($goto = $1);
last;
}
close URL;
$goto or &error ("Can't find link id: $id");

figuring the jump needs to look up the Contact Email.
My logic comes from my links.cfg file which includes

Code:
$db_email_name = "$db_script_path/data/email.db"; # PATH to email database.

The result I get is that it can't find link id.

One problem I see is that email.db has no data. That is probably why I get the can't find link id error.Unsure

Mu url.db has contains
1|mailto: omitted
2|mailto: omitted
3|mailto: omitted
4|mailto: omitted
up until I made some fields not required. Data is not being added as resources are being added.
...steven
MINI Links
BMW 318ti Registry
Quote Reply
Re: [steven1214] Using URL for email and Title as name In reply to
Then realizing that was wrong, I tried.

Code:
# Let's get the Contact Email Address.
open ('Contact Email', "<$db_contact_email") or &error ("unable to open url database: $db_contact_email. Reason: $!");
while (<'Contact Email'>) {
(/^$id$delim(.+)/o) or next;
chomp ($goto = $1);
last;
}
close URL;
$goto or &error ("Can't find link id: $id");

Still an error message. I know the answer is staring me in the face.

In searching other topics I came across someone someone trying the same substitution of an email address for a url over here.
...steven
MINI Links
BMW 318ti Registry

Last edited by:

steven1214: Jan 11, 2003, 4:07 PM
Quote Reply
Re: [steven1214] Using URL for email and Title as name In reply to
Sorry for keep on replying to myself.
Sometimes I need to talk to myself.Wink

Once again searching the forum, I came across this.

In the links.html file, add

Code:
<%if URL%>
<a href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>"><%Title%></a>
<%endif%>

<%ifnot URL%>
<a href="mailto:<%Contact Email%>"><%Contact Name%></a>
<%endif%>

Seems to work. Sly
...steven
MINI Links
BMW 318ti Registry
Quote Reply
Re: [steven1214] Using URL for email and Title as name In reply to
Doncha hate it when the answer is SO simple? I, too, have spent hours trying to make something work, and then discover that adding a tiny bit of code does the trick... Glad you found the answer; just gotta use the right search terms, huh?

Well, we're ALL learning here! Wink

-edit (after thinking...)

>>>This will still put the e-mail in the code, though. Going through jump.cgi will keep the address hidden. Maybe, in nph-build.cgi find sub build_url_index and change

print URL "$values[$db_key_pos]$db_delim$values[$db_url]\n";

to

print URL "$values[$db_key_pos]$db_delim$values[$db_contact_email]\n";

This MIGHT put the email info instead of the URL into the quick-lookup (url.db), and then no changes to jump.cgi would be required...

Maybe not...Unimpressed


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Jan 12, 2003, 1:31 PM
Quote Reply
Re: [PerlFlunkie] Using URL for email and Title as name In reply to
Actually it is not working like I really want.Crazy
Using the jump.cgi it appeared to be working properly.
That is hide the email address until called for.

What I forgot is that I edited the links.db to place the Contact Email with a mailto: in the URL field. So when the jump.cgi called it, it was calling the mailto: tag.

But when people added new records, URL is blank since it's not required. Then I get an error message. So I went back to including the email address on each page.

I'll get back to that.
In the meantime, I added a website and additional info field. I did not want to use the URL field for fear of it popping up somewhere unexpectedly.

I just found the General Discussion forum. Shocked
There are so many things I'd like to do, one is set the pages to 3 columns. I've seen it discussed but it appears there is no clean way of doing.

So in the meantime, I'm going to tweak what I have.
Make it is solid before delving into other mods.

Thanks everyone for your help.
The support made it fun to learn a little about the workings of Links.
...steven
MINI Links
BMW 318ti Registry
Quote Reply
Re: [steven1214] Using URL for email and Title as name In reply to
Quote:
I just found the General Discussion forum.

You are posting in the correct forum. This forum is for questions about customizing LINKS 2.0. So, I'd recommend continuing to post in this forum.
========================================
Buh Bye!

Cheers,
Me
> >