Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Contact Info & LinkOwner

Quote Reply
Contact Info & LinkOwner
Could someone please explain in brief how the new relationships are supposed to work. And what happened to Contact_Email and Contact_Name. They seem to have been removed during import and in exchange for LinkOwner however the scripts are still using them in places, i.e. the From: field in add.cgi emails.

Wil

Quote Reply
Re: Contact Info & LinkOwner In reply to
The problem comes with dynamic sites.

There is a new field "LinkOwner" in the Link table, and that is roughly equivalent to the "Username" field in the old one. The difference is, that in dynamic pages, "Username" gets the ID of the currently logged in user, so there had to be some way of differentiating them.

The Username, and Email address are part of the User table,and available as tags.

What you can do, if you want to import the Contact_Name and Contact_Email (if they don't relate to user records) is to re-name them in your old database before import, and they won't be selected out.



PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Contact Info & LinkOwner In reply to
this was something i was confused about. When i add sites, (as an admin) i want to be able to add the email address of the owner of the site, i couldn't seem to be able to do that, certainly not in the browser. I want to have the email listed as owner but don't want to have to set each one up as an editor.

The main reason for doing so is that once the database is finised (everything is done by hand) i want to send the owner of the links 1 email to say they are included and this is how you rate your site and then a link so that they can reveive further notifications, if they don't click on it then their email is deleted from the database. Any ideas?

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: Contact Info & LinkOwner In reply to
The connections in Links NG are a little more sophisticated than in 1.1x

They connect the User table to the Links table via the Username => LinkOwner pairing.

When you send a newsletter, or mailing to link owners, the ID in the "Links.LinkOwner" field is matched to the Users.Username field.

Once you do that, Users.Email is available.

When a logged in user is browsing your site, the <%Username%> and <%Email%> tag refer to that user. <%LinkOwner%> refers to the owner of the link being browsed.

I haven't played with import enough to know how it all works, but Alex may have a solution to this more elegant than what I can suggest.

If you don't use Usernames, you'd need to create a field in your current database called "Username" and add a munge of the Contact_Name to that field, then key the Users table record to the mugned Username and add Contact_Name and Contact_Email to that. Then the new records would be properly attached to the Users record for mailings.

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Contact Info & LinkOwner In reply to
thank you. I now understand how it works and agree it is the best plan when people are submitting to the directory.

Really mine is just to do a 1 shot mailing after i have got the directory going. I think what i might just do is add a field in the link table for email and type them in and then just write a small custom mail script to send an email to each of those people once i have finished the directory. What will be harder will be to try and get an automated way to make a link possible that they can click on which will then let them become a user and then assign the link back to the newly created user. I think it will be possible though.

Thanks pugdog, that helped a lot.

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: Contact Info & LinkOwner In reply to
If your directory is large, you can use an SQL statement to insert the email from the Users table. How to do it depends on how your tables are set up. But you join Users and Links on the Users.Username = Links.LinkOwner and set the Links.Contact_Email = Users.Email (the actual depends on what you are trying to do, but that is the idea).

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Contact Info & LinkOwner In reply to
Ok... bit confusing let me twist it around a bit and see if I got it right.

The problem was the import. Contact_Name and Contact_Email were meant to be imported as the new LinksOwner and his/her email. (This did take place from what I can tell) The old Contact_Name Contact_Email was removed during the conversion obviously. My main problem is that add.html as well as other templates still refer to Contact_Name, Contact_Email, which get no value as the Fields are completely gone. Something I obviously must remedy.

So when I send out a mass mailing to all the link owners is this going to the LinkOwners email or the Contact_Email? Boy! Somewhere along the line this got confusing.

I truly need help in this figuring this out. I can get over the loss of over 600 opt_in link owners (though my boss probably can't but we won't tell him), but I must get this whole thing straightened out real soon.

Now back to my Qmail email problem......

Wil

Quote Reply
Re: Contact Info & LinkOwner In reply to
Here's the problem.

Contact_Name and Contact_Email are not the same as the Username/LinkOwner field. Contact name was a non-unique string, that contained a proper name or other tag. Username was (supposedly) a unique string, that should have been limited to alpha numeric characters.

This is why I said before you import, if you create a Username field, you'll create a link from the Links.LinkOwner field to the Users.Username field, which would contain the Contact_Email and Contact_Name as Email and Name in each row.

Are you following?

If you do not have a Username field in your database, the mapping of Contact_Name-->LinkOwner-->Username may work.



PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Contact Info & LinkOwner In reply to
Well the import was done back at Alpha1 and many records have been added since then. So you can see that delima. If I re-import from the old I will loose the new. So lets just see if I can get things straighted out from here forward and call those 600 contacts a lose.

So, putting all the relationships aside since they are confusing me anyways, the Links table should have what columns? Username? or Contact_Name, Contact_Email?

Wil

Quote Reply
Re: Contact Info & LinkOwner In reply to
The links table has Links.LinkOwner. If you have a Username field, you can just rename that to LinkOwner. It maps the the Users.Username field. All the Links table needs is LinkOwner to tie it to the Users table. (That is if you require all add-links to register.)

The Link table has _less_ information in it, because it uses data-relationships to build them, and heads towards a more normalized database.

Contact_Name ---> Users.Name

and

Contact_Email ---> Users.Email


This was "redundant" information from the users records in flat-file links. It was also "useful" if you don't require user-registration.

With user registration, you create a "user" object, that lives in a table. That object has ties to other objects and tables, which in turn have ties to it.

For instance, Users.Username is the key that ties the links table to the User record. You can do a search for Links.Username to find all the links that belong to a user, or you can do a search for Users.Username to find the user who owns the link (ie: LinkOwner).

That way, the user record is added only once, and there is only ONE UNIQUE field that ties the links to the users.

Make sense?

Once you grasp the concept of data relationships you start to try to make all these little tables, and then you forge some compromise :) A totally normalilzed database is an ideal. For performance reasons, some compromises are made -- such as storing the single logo/graphic in the Links record. It's a performance enhancement that makes a _lot_ of sense in the current archetecture, but if that advances, it can be abstracted out.

note: Over time, database tables have become smaller, but have increased in number. We used to make really, really big tables... but now it's easier to make smaller ones, and relate them (computers are fast enough to do that in real time, RAM is cheap and plentiful, etc).



PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Contact Info & LinkOwner In reply to
Right on..... Well the good news is yes Links.LinkOwner does exist and its relationship with Users.Username is a valid one. Even though I have a bunch of email addresses as Usernames which I will correct eventually.

Let me toss what I have done out here and see if you see any ramifications in the future.

I did go ahead and add a Contact_Email and Contact_Name into Links. When a registered user come along to add a record the add.html template asks for Contact Name and Contact Email but the values default to <%Username%> and <%Email%>. So if an editor/registered user is adding a listing for someone else they can change these values to their desired <%Contact_Name%> and <%Contact_Email%>.

See any problems with this? Will Links.Contact_Name and Links.Contact_Email conflict with anything?

Wil

Quote Reply
Re: Contact Info & LinkOwner In reply to
No, That's how I handled it for my fields. After all, a link might need to point to a customer service, or other department, not the users own email account.

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Contact Info & LinkOwner In reply to
Hmmmm..... well after adding in the fields to SQL and to the add.html template I get the same results as without them. Contact_Name and Contact_Email remain blank as if the values are never making it to SQL. I also can't seem to make them required fields.

Oddly enough it works fine when I turn off 'User_Required'. Guess I need to make Contact_Name ContactName and Contact_Email ContactEmail so that they don't conflict with the script. Trouble with that is that the emails continue to go to Contact_Email. But they aren't even working with Qmail right now..... so what does that matter. :-( I am getting a headache.



Quote Reply
Re: Contact Info & LinkOwner In reply to
I can't check on this machine, but those fields should still be available.

I know on my system, with templates that use them, I get unknown-tag errors.

Make sure your templates are really what you think they are. Make sure you added the columns via LinkSQL _not_ mysqlman. If you did, you need to resync the def files! :)

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ


Quote Reply
Re: Contact Info & LinkOwner In reply to
Well, with the help of Speedy and also the db not syncing up correctly I am most discouraged. I think alot of the problem could be resolved by me redeveloping the templates. They came from way back in the LinksSQL1.0 days, and I trimmed a few of the features even back then, for instance the Editors which I have never used.

Frankly, I think it is time for a full redevelopment. Pugdog if I send you a copy of my Links and Users properties do ya think you could look them over for me? If I am reassured that my DB is in order then I will feel more confident as I move through the redevelopment process. And if you do this for me how would you like the properties formatted and delivered?

Wil

Quote Reply
Re: [pugdog] Contact Info & LinkOwner In reply to
I pulled up this old post because this is what I am trying to accomplish.
What I would have is in addition to User.Username=Links.Linkowner have
User.email=Links.Contact_email
User.name=Links.Contact_name

Then if I changed any of the above in either the links table or users table the other would be updated.

Is this possible to set up in links 2.04 or 2.05 without significant changes?

Thanks.


Regards,
Clueless