Gossamer Forum
Home : Products : Links 2.0 : Customization :

Deleting/reusing existing database fields?

Quote Reply
Deleting/reusing existing database fields?
Are there any detailed tutorials on customising the fields in links.def and category.def?

Adding new fields seems simple enough, but I'd like to remove/rename/reuse existing fields.

For example, I don't need 'Contact Name', 'Contact Email', Hits, isPopular, Rating, Votes or ReceiveMail.

I would, however, like to add about 10 extra unrelated fields for use on the detailed pages.

Basically, I need to know which files and subroutines reference the fields I wish to delete, and was hoping someone else has posted this info somewhere.

Does anyone know where I could find something like that?
Quote Reply
Re: [wysardry] Deleting/reusing existing database fields? In reply to
deja vu!

see http://www.gossamer-threads.com/...;;page=unread#unread

bottom line...don't delete 'em. if you don't want to use them, make 'em non-required and leave 'em off the html pages.

I'm outta here!


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] Deleting/reusing existing database fields? In reply to
Well, there are two reasons I don't want to leave the unused fields in place:-

1. The database will be bigger than it needs to be (even if it is just by a few "|" characters

2. Leaving the routines as they are would mean the script made redundant subroutine calls

If I go through all the scripts commenting out the unused code (to speed up the build) I may as well remove the extra fields too.

The database is completely empty at present, so I'm not worried about messing anything up by making these changes. I was just hoping I could get some pointers as to where to make them to save looking through files that don't need changing.
Quote Reply
Re: [wysardry] Deleting/reusing existing database fields? In reply to
There are a few fields that seem to cause problems when removed, but others can be deleted and cause no ill effects. My links.def has only six of the original fields. I did have problems without the Date field, but removed the ones you listed without incident. I also removed large portions of code from nph-build.cgi.


Leonard
aka PerlFlunkie
Quote Reply
Re: [wysardry] Deleting/reusing existing database fields? In reply to
actually if you look at post #13, what your refer too is discussed ( at least in part ).

http://www.gossamer-threads.com/...i?post=227268#227268

there is another post about a month or so that goes into great detail about stripping out parts of Links 2


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] Deleting/reusing existing database fields? In reply to
PerlFlunkie: Yes, I figured some fields could be removed without too much trouble, whilst others would require a search through every script.

I was just hoping that someone had explicitly explained which fields are used in which files.

esm: I saw that post, but it's still a little vague.

I guess I'm going to have to bite the bullet and go through everything with a fine tooth comb.
Quote Reply
Re: [wysardry] Deleting/reusing existing database fields? In reply to
See if this comb helps: Wink

http://gossamer-threads.com/...ng=detail.cgi;#34961


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Deleting/reusing existing database fields? In reply to
Well, it certainly shows that variables like $db_hits_path are used in a lot of places. Crazy

I think I have a search utility that will look in multiple files, so I'll have to dig it out. I also recently a text editor which colours common Perl tags which should come in handy.

Thanks for digging that link out.Smile When I tried searching I either got thousands of matches or a few unrelated ones.
Quote Reply
Re: [wysardry] Deleting/reusing existing database fields? In reply to
http://www.gossamer-threads.com/...;;page=unread#unread

http://www.gossamer-threads.com/...earch_string;#218105

http://www.gossamer-threads.com/...earch_string;#218198


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Quote Reply
Re: [esm] Deleting/reusing existing database fields? In reply to
I'm not sure I agree with the poster's idea of commenting out the database backup routines. It would be safer to just delete excess backup files via FTP every now and then, making sure there is at least one backup available before building each time.

The rest of the article seems sensible enough and along the same lines as I would have tried first.

The first post is the most useful, as the others are earlier versions from the same person, with a couple of mistakes in (he/she didn't comment out the lines that call the hits and rating routines in the build_all subroutine).

Did you search for those, or look for them specifically because you remembered reading them before? Only I know I definitely wouldn't have used keywords that would have matched the first one.

Either way, thanks for pointing them out. Cool
Quote Reply
Re: [wysardry] Deleting/reusing existing database fields? In reply to
Some of the above references is what I have done.

http://www.happytogether.com/318ti/registry/

Instead of a database of resources, my link2 is a database of people's names and cars.

Location
City - year of their car - model
Additional Info _______
Website___________

I commented out in my html pages several things that I don't need. I have also used some of the original fields by renaming them on my html pages. For instance, instead of 'category' I call it location. I originally used URL as another email address. I have since changed that and reverted back to using it as a URL but it is commented out everywhere except the add and modify pages. For what I wanted to do, I found it easier to create a new field and paste the URL there when validating. These way I don't use the jump.cgi and I can still use the admin.cgi to check links. I list Contact Name and Contact Email instead of Title and URL.

So in my very limited experience, you might want to recyle those fields, just reference a different name to them.

Note: Take my advice with a grain of salt. I am very new to this.

...steven
...steven
MINI Links
BMW 318ti Registry
Quote Reply
Re: [steven1214] Deleting/reusing existing database fields? In reply to
Things are a little more complex in my case as I'm not only renaming fields, I'm putting them to different uses.

I think I have a handle on what each section does now though (after much scrolling up and down and switching windows to follow the logic of the code).