Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Setting up white pages - please help me walk through this process.

Quote Reply
Setting up white pages - please help me walk through this process.
I have a default installation of links sql working. (sort off.. still have some problems, but I'm working through them one by one).

The first customisation I need to do is setup a white pages.

This will allow members to list the following items.

First_Name, Last_Name, Address_1, Address_2, City, State, Country, Phone, Fax, Email, URL, Description

The first 9 fields are custom. I have figured out how to add them to the database but am not too happy about modifying the fields as is.

My questions are :-

* Do I have to modify lsql_Links and add these 9 fields to every row in the table? The rest of my directory has about 700,000 entries from DMOZ and I don't want to pad each of those entries with the White Pages structure. Any way in which I can set this up a bit more optimally?

* Can I setup a category in such a way in which it uses an alternative table for its links? Say the category White_Pages/Hong_Kong and White_Pages/Singapore use the table lsql_whitepages_links for their links?

More questions later :)
Quote Reply
Re: [shriram] Setting up white pages - please help me walk through this process. In reply to
Can someone help me with this?
Quote Reply
Re: [shriram] Setting up white pages - please help me walk through this process. In reply to
There are two ways to do this:

a) add the nine fields to the Links table. Disadvantage: as you said. But, is disk space really a problem? Advantage: much easier to implement. Hardly any programming necessary.

b) add a new table for your white pages information. Advantage: better structure of data. Disadvantage: much more difficult to implement, requires some custom programming.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Setting up white pages - please help me walk through this process. In reply to
I've already got 700K odd entries for my links, so not too keen on adding the extra white space.

Couple of questions.

Any ideas what the category.def field is used for?

What files / classes would I have to modify? I'm a complete perl novice so this is a bit intimidating.. to begin with. :)
Quote Reply
Re: [shriram] Setting up white pages - please help me walk through this process. In reply to
OK,

A few things.

First -- if you are not a programmer, or familiar with Unix, Perl, MySQL, and/or the layout of Links, do not edit *ANYTHING* in the ../admin directory by hand, only edit what you can access through the Admin interface. If you make changes, you can severely affect how Links works, and may introduct subtle and not so subtle bugs.

Second -- Adding the extra fields to your database through the Admin interface will add the fields to *every* record in the Links table. The fields will be set to the default values provided in the definitions you provided, or to Null if no value was provided.

Third -- the "white space" issue is somewhat trivial. Empty fields if defined as varchar (Links default when CHAR is selected) will use only a few bytes if empty. Nine fields will use up maybe 50 bytes of database storage per record, which even for 750k records works out to a fairly trivial amount of space (by today's standards), vs the amount of effort needed to develop a linked table system. You will use more disk space if you index those fields (which you'd want to do if you plan to search on any of them), no matter what system you use, and the indexes use up a larger amount of disk space.

Fourth -- the use of a linked table would require some programming overhead, and a whole set of routines to manage the records. Depending on your future plans, it may pay to develop this, but that would be a lot of overhead (time, cost, delay, etc), up front, which you will not have if you add those fields in.

Fifth -- you can always start out with the simple system of adding the 9 fields to the Links record, then move them to a linked table at a later date, using a simple (or fairly simple) Select/Update/Insert command to copy the data from the Links table to the Address_Book table (for example).


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Setting up white pages - please help me walk through this process. In reply to
Pugdog,

Thanks. Got to research mysql to see how they pad a row with fields not used with Varchar. The good part about varchar is the fulltext index capabilities.

Shri