Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Pugdog...please read

Quote Reply
Pugdog...please read
I am in a bind here...I have 3 days left to get my new links configured on my new server and all the links transfered from 1.1 on my old server before the old server goes down.
You seem to really know what your doing, could you please help me.

Here is what I still have not been able to figure out how to do:
1. I need to add 2 additional fields to the link side, "keywords" and "return link".
I also need to know how to get those new fields to show up in the add.cgi and admin.
I then need to get the search to also search on the keywords field.
2. I need to setup the "search only in this category" checkbox option.
3. I need to know what to modify so I can import my links from the old system, with the 2 additional fields. I already did a test import, and they import with no problems, its just that the "keywords" and "return link" fields aren't imported.
Can you help me with this?
Quote Reply
Re: Pugdog...please read In reply to
Forget number 1. I found it staring me in the face in the admin Smile

I still need to figure out 2 and 3
Quote Reply
Re: Pugdog...please read In reply to
#1 you got
#2 is not easy. I think that's being worked on by alex (I could be wrong).

#3 Import.pl reads the Links.def file that you put in the setup directory. When you tried the import, did you modify that file to reflect the new changes? Also make sure you have updated the Links.def file in the defs directory.

Also..... Here's the biggie. If you resync the Links.def with it's table, do the fields remain? (the fields are actually added to the SQL table?)

If all of this is ok, I might need to look at your files. My database has over a dozen fields added and I've successfully imported it many, many times. I have to turn all the 'required' fields to off, though, and I make sure both Links.def files the old one in the setup directory and the new one in the defs directory ACCURATELY reflect the the old links 2.0 db and the new LinkSQL db respectively.

Quote Reply
Re: Pugdog...please read In reply to
BTW... make sure you make the same changes you make to the Links.def and Links table to the Validate.def and Validate tables! IF you want the users to be able to add keywords, and such, they deal with the Validate table, not the Links table.
Quote Reply
Re: Pugdog...please read In reply to
Ok...so I added 2 fields thru the admin to the links table. Here is the fields from the def.
keywords => ['16', 'CHAR', '40x2', '120', '0', '', '', '2'],
Return_Link => ['17', 'CHAR', '40', '150', '0', '', '', '0']

I take it that I must manually add these to the validate.def also, and manually add the fields in the db too right??
Quote Reply
Re: Pugdog...please read In reply to
Got it!!
Import worked..
Some records wouldnt import cause the length exceeded the Keywords field length, but screw them, they had too many keywords anyway Smile
Most were duplicated over and over....

Next question....If I had a field validation to the def files, for Return_Link of http:\/\/.+\..+ How will this affect existing records in the DB, since Return_Link is not a required field?
Quote Reply
Re: Pugdog...please read In reply to
It won't affect existing records at all,
unless you try to modify and save them back.

If you turn validation or reqired off on import, you only run into problems when you try to modify an existing record (believe me, I have many, many misbehaving records, and I'm always tweaking the .def file to save them back <G> ) but it's a lot easier to deal with one record at a time, than trying to fix a few thousand on import.

Quote Reply
Re: Pugdog...please read In reply to
So if I turn on that validation now...which I did...when a user trys to modify his record, he will get an error?
Let me try to explain this better. I have 8 main categories.
If you goto add or modify a link, there is no "Return Link" field..except in 1 main category, and its sub-categories, there is a "Return Link" field displayed, and is required.
So....if a user, who isnt required to have a return link, modifies his link..he wont have a "return link" field. And if he submits the mod, he gets an error?
Quote Reply
Re: Pugdog...please read In reply to
It's only REQUIRED if you set NOT NUL to 1

If you have a validation string, I believe it will only attempt to validate if required.

So if a user doesn't enter anything, and it's not required, nothing will happen.

If a user enters something, and it's not required, but it fails the validation check, it will generate an error.