Gossamer Forum
Home : Products : Links 2.0 : Customization :

Adding new fields to links.def

Quote Reply
Adding new fields to links.def
Hi, I hope someone can help me out with a problem that I am having with adding new fields to the entries. I have searched the database which has got me where I am now.

I have added 6 new fields to links.def for things such as price, version, and platform.

When I add a new entry and then build the files I have got all the modifications working other than price and platform which just say yes.

Below is how I added them to links.def

Platform => [10, 'alpha', 40, 75, 1, '', ''],
Price => [10, 'numer', 40, 75, 1, '', ''],

If I change price to numer I then get No appear in the links.htm file.

With the price I am also trying to ensure that it excepts $ and £ signs.

I hope someone can help me out

Thanks

Quote Reply
Re: Adding new fields to links.def In reply to
Code:
Platform => [10, 'alpha', 40, 75, 1, '', ''],
Price => [10, 'numer', 40, 75, 1, '', ''],
Hmmm....both have the field id #....which should be unique.

40 and 75 are probably way too large for a number. You may want price to be

Price => [11, 'numer', 9, 9, 1, '', ''],

Instead of 9 put your own - 10, 11, 8 etc



Do you want to accept or except the $ and £ signs?

Gene
Quote Reply
Re: Adding new fields to links.def In reply to
To accept $ or £ I think this would work.....


Price => [10, 'numer', 40, 75, 1, '', '^£\d |\$\d '],
If that gives an error you'll need....


Price => [10, 'numer', 40, 75, 1, '', '^\£\d |\$\d '],

Remember that the last filed in links.def has no trailing comma.

-----
Ugh....the forum has parsed out some of the code - after each \d above add a plus sign

Paul Wilson.
http://www.wiredon.net/gt/
http://www.perlmad.com/
Quote Reply
Re: Adding new fields to links.def In reply to
Thanks for the feedback.

I will try and type slowly this time so my English is slightly better.

I have managed to get the required fields to be placed onto the links.htm file no problems.

The problem I have at the moment is that when you submit information from the add.shtml file it is being rejected by add.cgi. However from the admin panel I can add them all okay.

Do you know if there are anymore fields within the scripts that require updating at all.

Cheers


Quote Reply
Re: Adding new fields to links.def In reply to
In Reply To:
when you submit information from the add.shtml file it is being rejected by add.cgi
can you provide any more info. what is the error message?

Gene
Quote Reply
Re: Adding new fields to links.def In reply to
And don't remember to use Bobsie's upgrade.pl if U have data in your links.db!

and without "," at the end of the last field in the links.def

See Ya

Quote Reply
Re: Adding new fields to links.def In reply to
I think you mean......

And do remember to use Bobsie's upgrade.pl if U have data in your links.db!



Paul Wilson.
Installations:
http://www.wiredon.net/gt/