Hi,
for tailoring Links 2 to my needs, I added some more fields to it, like "Language" (German/English), "Keywords" and "AltCategories".
Everything's ok with the admin screen; the new fields appear and they work fine.
For whatever reason (lost my brain? ), I don't get them to show up on add.html, add-sucess.html...
Here's a snipplet of modified code of my links.def:
%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 1, 'http://', '^http|news|mailto|ftp'],
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', ''],
isPopular => [10, 'alpha', 0, 5, 0, 'No', ''],
Rating => [11, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [12, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],
Language => [14, 'alpha', 0, 10, 1, '', ''],
AltCategories => [15, 'alpha', 0, 500, 0, '', ''],
Keywords => [16, 'alpha', '40x2', 500, 0, '', '']
);
# Database file to use -- defined in links.cfg.
$db_file_name = $db_links_name;
# Counter file to use -- defined in links.cfg.
$db_id_file_name = $db_links_id_file_name;
# The column name for the database key.
$db_key = 'ID';
# Database delimeter.
$db_delim = '|';
# Title used in admin output.
$html_title = 'Links Database';
$html_object = 'Link';
# 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_url = 2;
$db_hits = 8; $db_isnew = 9; $db_ispop = 10;
$db_contact_name = 6; $db_contact_email = 7; $db_title = 1;
$db_votes = 12; $db_rating = 11; $db_mail = 13;
$db_language = 14; $db_altcategories = 15; $db_keywords = 16;
# Field number to sort links by:
$db_sort_links = 1;
# Field names you want to allow visitors to search on:
@search_fields = (1,2,5,16);
# System defaults. When adding new links or modifying links, these fields
# can not be overwritten by a user.
%add_system_fields = (
isNew => 'No',
isPopular => 'No',
Hits => '0',
Rating => 0,
Votes => 0,
ReceiveMail => 'Yes'
);
# Hash of column names to possible options. If you want to use a select form
# field, you can use &build_select_field in your HTML page. This routine will
# make a <SELECT> input tag using the following values:
%db_select_fields = (
isNew => 'Yes,No',
isPopular => 'Yes,No',
ReceiveMail => 'Yes,No',
Language => 'Deutsch,Englisch'
);
What must I do to call them from add.html etc. ???
Maybe something magic....?
For example, I tried to get the AltCategories showing up by both, using <%AltCategories%> and <%altcategories%>, analog to <%Language%> and <%language%> - for the case the call is case-sensitive!
The result?:
Unkown Tag: altcategories
Unkown Tag: language
Could you please tell me what to do?
Thanx in advance so much !!!
[This message has been edited by Kodak (edited August 24, 1999).]
for tailoring Links 2 to my needs, I added some more fields to it, like "Language" (German/English), "Keywords" and "AltCategories".
Everything's ok with the admin screen; the new fields appear and they work fine.
For whatever reason (lost my brain? ), I don't get them to show up on add.html, add-sucess.html...
Here's a snipplet of modified code of my links.def:
Code:
# Definition of your database file. %db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 1, 'http://', '^http|news|mailto|ftp'],
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', ''],
isPopular => [10, 'alpha', 0, 5, 0, 'No', ''],
Rating => [11, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [12, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],
Language => [14, 'alpha', 0, 10, 1, '', ''],
AltCategories => [15, 'alpha', 0, 500, 0, '', ''],
Keywords => [16, 'alpha', '40x2', 500, 0, '', '']
);
# Database file to use -- defined in links.cfg.
$db_file_name = $db_links_name;
# Counter file to use -- defined in links.cfg.
$db_id_file_name = $db_links_id_file_name;
# The column name for the database key.
$db_key = 'ID';
# Database delimeter.
$db_delim = '|';
# Title used in admin output.
$html_title = 'Links Database';
$html_object = 'Link';
# 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_url = 2;
$db_hits = 8; $db_isnew = 9; $db_ispop = 10;
$db_contact_name = 6; $db_contact_email = 7; $db_title = 1;
$db_votes = 12; $db_rating = 11; $db_mail = 13;
$db_language = 14; $db_altcategories = 15; $db_keywords = 16;
# Field number to sort links by:
$db_sort_links = 1;
# Field names you want to allow visitors to search on:
@search_fields = (1,2,5,16);
# System defaults. When adding new links or modifying links, these fields
# can not be overwritten by a user.
%add_system_fields = (
isNew => 'No',
isPopular => 'No',
Hits => '0',
Rating => 0,
Votes => 0,
ReceiveMail => 'Yes'
);
# Hash of column names to possible options. If you want to use a select form
# field, you can use &build_select_field in your HTML page. This routine will
# make a <SELECT> input tag using the following values:
%db_select_fields = (
isNew => 'Yes,No',
isPopular => 'Yes,No',
ReceiveMail => 'Yes,No',
Language => 'Deutsch,Englisch'
);
What must I do to call them from add.html etc. ???
Maybe something magic....?
For example, I tried to get the AltCategories showing up by both, using <%AltCategories%> and <%altcategories%>, analog to <%Language%> and <%language%> - for the case the call is case-sensitive!
The result?:
Quote:
Unkown Tag: keywords Unkown Tag: altcategories
Unkown Tag: language
Could you please tell me what to do?
Thanx in advance so much !!!
[This message has been edited by Kodak (edited August 24, 1999).]