Gossamer Forum
Home : Products : Links 2.0 : Customization :

links.def error (adding fields)

Quote Reply
links.def error (adding fields)
When I attempt to log into Admin Panel, why would I get this error?
Error Message : fatal error: syntax error at /.../cgi-bin/admin/links.def line 36, near "Price"

%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
Date => [2, 'date', 15, 15, 1, \&get_date, ''],
Category => [3, 'alpha', 0, 150, 1, '', ''],
Description => [4, 'alpha', '40x2', 500, 0, '', ''],
'Contact Name' => [5, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [6, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
Hits => [7, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [8, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [9, 'alpha', 0, 5, 0, 'No', ''],
Rating => [10, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [11, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [12, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],
Price => [13, 'alpha', 10, 10, 1, '$', ''],
Location => [14, 'alpha', 10, 20, 0, 0, ''],
'Contact Phone' => [15, 'alpha', 30, 50, 0, '', ''],
Details => [16, 'alpha', '40x3', 800, 0, '', '']
);
Looks right to me! Does anyone see something I can't?


Quote Reply
Re: links.def error (adding fields) In reply to
Change the following codes:

Code:

Price => [13, 'alpha', 10, 10, 1, '$', ''],


to the following:

Code:

Price => [13, 'alpha', 10, 10, 1, '\$', ''],


You have to "escape" the $ character since it is a special Perl character that signifies variables among other things.

Regards,

Eliot Lee

Quote Reply
Re: links.def error (adding fields) In reply to
nope, same error. Ugh!

Quote Reply
Re: links.def error (adding fields) In reply to
Make sure you update the "important fields" variables below the %db_def hash. The values of the variables need to match with their index position as defined in %db_def.

--Drew
Quote Reply
Re: links.def error (adding fields) In reply to
No problem there as far as the code goes. I had added a location and contact_phone as "important fields" and deleted URL per its removal in the %db_def definitions but this has not removed the error either with or without the additional hashes. I moved line 36 to line 38 and attempted to access Admin Panel and the same error came up again referring to line 36 near "Price" instead of referencing line 38. Ain't that odd!

Quote Reply
Re: links.def error (adding fields) In reply to
Btw, following your comment of a corrupt links.db in the Homepage Maker thread, I deleted Links 2.0 from the site and reloaded it afresh with the exception of the Template html files and 58-Snap mod site_html_templates.pl.

Quote Reply
Re: links.def error (adding fields) In reply to
hey man
im having the same problem as you. and if you ever do resolve this plz tell me 2 =]

thanx

Quote Reply
Re: links.def error (adding fields) In reply to
It has resolved itself now. All the building and rebuilding musta stressed out the server. Initially the error was a comma missing off the end of %db_def list just before the "Price" routine. As it says, only the last item on the list is to have no comma. This blunder of mine musta thrown the server into stubborness and after a time was able to rebuild and respond to further instructions. In short, have a cuppa and a quicky and it should be right!