Gossamer Forum
Home : Products : Links 2.0 : Customization :

New fields to link and strange errors

Quote Reply
New fields to link and strange errors
Hello

i added new fields to my links.def:

# Definition of your database file.
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
City => [2, 'alpha', 40, 75, 1, '', ''],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
Description => [5, 'alpha', '40x3', 500, 0, '', ''],
'Contact Name' => [6, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [7, 'alpha', 40, 75, 1, '',
'.+@.+\..+'],
Hits => [8, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [9, 'alpha', 0, 5, 0, 'No', ''],
AreaPhone => [10, 'numer', 0, 5, 1, '', ''],
Phone => [11, 'numer', 10, 10, 1, '', ''],
ReceiveMail => [12, 'alpha', 10, 10, 1, '', 'No|Yes']


);

and modified that:

# Field Number of some important fields. The number is from %db_def above

# where the first field equals 0.

$db_title = 1; $db_city = 2; $db_modified = 3; $db_category = 4; $db_contact_name = 6;

$db_contact_email = 7; $db_hits = 8; $db_isnew = 9; $db_areaphone = 10; $db_phone = 11;

$db_mail = 12;


The new fields are added in the admin panel, i have no problem to add a new link, at this point the file links.db is ok and start with the ID number but when i rebuild the pages the ID number becomes No and of course nothing works as there is no more ID to identify the link.

Any hint of what I am doing wrong?

I am pulling my hairs, i read about all postings without finding any explanation to my problem. I re-uploaded all the datas files to start over several times and always have the same problem, i re-uploaded the original links.def and it works fine, i am not trying to addd new fields to an already existing database this is a new install.

Thanks
Quote Reply
Re: [wirefram] New fields to link and strange errors In reply to
Quote:
'Contact Email' => [7, 'alpha', 40, 75, 1, '', [/size]'.+@.+\..+'],

Im assuming that the [] tag isnt in the actual links.def file, but was an after effect of the editor?

If not, that could be your problem.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [wirefram] New fields to link and strange errors In reply to
Did you add new delimiters in links.db for the new fields?

Last edited by:

RedRum: Jan 25, 2002, 2:59 AM
Quote Reply
Re: [RedRum] New fields to link and strange errors In reply to
confirm wither you added new field at the time fo first installation or in running database

if you added latter a new field han you have update database with new filed also
Megrisoft
Web Hosting Company
India Software Company
SEO Company


Quote Reply
Re: [megri] New fields to link and strange errors In reply to
I replaced previous 'Contact EMail' def with the original:

'Contact Email' => [7, 'alpha', 40, 75, 1, '', '.+@.+\..+'],

as this is a new install, i add my new fields to links.def for the first time, create a new category and add 1 link, my files links.db + url.db + other in the data directory are blank so i don't have to add new delimiters to links.db.

Then i do "rebuild all" and the ID number get replaced with No instead of a number.

here is what I have now:

ID => [0, 'numer', 5, 8, 1, '', ''],

Title => [1, 'alpha', 40, 75, 1, '', ''],

City => [2, 'alpha', 40, 75, 1, '', ''],

Date => [3, 'date', 15, 15, 1, \&get_date, ''],

Category => [4, 'alpha', 0, 150, 1, '', ''],

Description => [5, 'alpha', '40x3', 500, 0, '', ''],

'Contact Name' => [6, 'alpha', 40, 75, 1, '', ''],

'Contact Email' => [7, 'alpha', 40, 75, 1, '', '.+@.+\..+'],

Hits => [8, 'numer', 10, 10, 1, '0', '\d+'],

isNew => [9, 'alpha', 0, 5, 0, 'No', ''],

AreaPhone => [10, 'numer', 0, 5, 1, '', ''],

Phone => [11, 'numer', 10, 10, 1, '', ''],

ReceiveMail => [12, 'alpha', 10, 10, 1, '', 'No|Yes']

);

**

# Field Number of some important fields. The number is from %db_def above

# where the first field equals 0.

$db_title = 1; $db_city = 2; $db_modified = 3; $db_category = 4; $db_contact_name = 6;

$db_contact_email = 7; $db_hits = 8; $db_isnew = 9; $db_areaphone = 10; $db_phone = 11;

$db_mail = 12;

**

%add_system_fields = (

isNew => 'No',

Hits => '0',

ReceiveMail => 'Yes'

);

**



%db_select_fields = (

isNew => 'Yes,No',

ReceiveMail => 'Yes,No'

);



** As the ID number get replaced with "No", as "No" is in my fields 9 and 12, i assume there is a confusion somewhere between the field 1 and these 2 others the problem happen when i rebuild the pages otherwise before i rebuild everything is working fine, when i add the new link, the ID number is there.


Quote Reply
Re: [wirefram] New fields to link and strange errors In reply to
For every new field you add you need to add a | to the end of every record in links.db
Quote Reply
Re: [RedRum] New fields to link and strange errors In reply to
My file links.db is blank, empty, can't add a new delimiter!
Quote Reply
Re: [wirefram] New fields to link and strange errors In reply to
My problem is fixed here is what i have now in ly links.def

ID => [0, 'numer', 5, 8, 1, '', ''],

Title => [1, 'alpha', 40, 75, 1, '', ''],

City => [2, 'alpha', 40, 75, 1, '', ''],

Date => [3, 'date', 15, 15, 1, \&get_date, ''],

Category => [4, 'alpha', 0, 150, 1, '', ''],

Description => [5, 'alpha', '40x3', 500, 0, '', ''],

'Contact Name' => [6, 'alpha', 40, 75, 1, '', ''],

'Contact Email' => [7, 'alpha', 40, 75, 1, '', '.+@.+\..+'],

Hits => [8, 'numer', 10, 10, 1, '0', '\d+'],

AreaPhone => [9, 'numer', 3, 8, 1, '', ''],

Phone => [10, 'numer', 7, 8, 1, '', ''],

isNew => [11, 'alpha', 0, 5, 0, 'No', ''],

isPopular => [12, 'alpha', 0, 5, 0, 'No', ''],

Rating => [13, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],

Votes => [14, 'numer', 10, 10, 1, 0, '^\d+$']

);

**Pretty much like what i had before, the difference is there:

# Field Number of some important fields. The number is from %db_def above

# where the first field equals 0.

$db_category = 4; $db_modified = 3; $db_city = 2;

$db_hits = 8; $db_isnew = 11; $db_ispop = 12;

$db_contact_name = 6; $db_contact_email = 7; $db_title = 1;

$db_votes = 14; $db_rating = 13; $db_areaphone = 9; $db_phone = 10; $db_mail = 15;

**I got "$db_mail=15; " and have no definition for this field in my %db_def but i assume this is the reason why my links.db didn't work before.

I have no other explanation. Strange...