Mel, I did as you suggested. The initial .db files are, of course blank. The links.def file
Code:
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']
My spider creates 6 output fields, URL|TITLE|DESCRIPTION|KEYWORDS|CATEGORY|EMAIL
Do you think import will work if I append a seventh field |ID to my spider output which it
leaves blank for SQL to autoassign and I rearrange and trim the links.def file to this?
Code:
URL => [0, 'alpha', 40, 75, 1, 'http://', '^http|news|mailto|ftp'],
Title => [1, 'alpha', 40, 75, 1, '', ''],
Description => [2, 'alpha', '40x3', 500, 0, '', ''],
Keywords => [3, 'alpha', '40x3', 500, 0, '', ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
'Contact Email' => [5, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
ID => [6, 'numer', 5, 8, 1, '', '']
The only reason I do not make ID the first field has to do with entry validation
inside my script. I'd rather not mess with it if I don't have to.
I exported my present category fields corresponding to the fields from the 2.0
category.def file to a file links/admin/tmp/data/categories.db. The only changes it seems
I need make are
Meta_Description to
'Meta Description', ditto for Meta_Keywords,
unless you say otherwise. Does the field
Related equate to
FatherID in SQL?
or can I leave this field blank?
And now the tough questions: The majority of my submissions come in the form
of URL only from Submit Wolf, a VERY POPULAR meta search engine submission
software program. My spider fills in the blanks for TITLE, DESCRIPTION, KEYWORDS
and sometimes EMAIL by capturing them from the pages. Therefore, the majority
of entries will not have a CATEGORY assignment.
1) Will SQL allow me to import those records?
2) If it will, what will happen if a URL is imported without a category assignment that
matches a URL already in the SQL database that has a CatLink relation assigned to it?
I will, of course, back up my existing database and try it anyway but I would feel a lot
better if I knew it's been done and is doable.
Mark Brasche
http://SurfSafely.com/