By Paul
10/05/06 (Edited 01/08/11)
If you're importing from Gossamer Threads Links 2.0 or Duncan Carver's Link Management, you can do this directly and simply... see http://scripts.webmastersite.net/w...ndex.php?section=resources to download the importers for those.
To import from any other sort of flat file database, go to Admin Panel -> Additions -> Import and select the flat-file option. You will need to specify the format of the file where it asks. Open the file in a text editor and deduce what the file is using to separate links from each other, and fields within the link. Then take note of what order the fields are in, starting with the number 0, and type the numbers where your admin panel asks.
The most common flat-file import may be CSV -- you're better off using the specialized CSV importer option though, rather than the flat-file import option, if you want to do a CSV.
For importing tags, separate each tag with a pipe (the | character). You can change this separator to something else with the $tagssplitchar tweak, but it needs to be unique, so you can't use a comma in CSV where commas are separating fields.
You can include custom fields in your import by modifying the import template (Admin Panel -> Templates -> Manage Templates -> Admin CP Templates -> Import). Find
<br>Type: <input type="text" name="typeloc" size="5" value="{TYPELOC}">
in there. Copy that line, but change "type" to the name of your custom field in the name and value attributes. For example if you want to handle a field named "company" you should add this to that spot in the template: <br>Company: <input type="text" name="companyloc" size="5" value="{COMPANYLOC}">
. Repeat for as many custom fields as you want.To import file attachments, first upload the files to the /attachments/ directory. Then add lines for fields named filefield1, filefield2, and so on for as many as you need. Your flat-file database will need to contain the filenames at this location. If you want to have separate display filenames compared to the real on-disk filenames for the purpose of preventing direct downloads, add additional lines for the fields filefield1title, filefield2title etc (note these must still be filenames with extensions like .jpg, not simply titles). In the future when caption and sort order options are available you'll use filefield1caption and filefield1sortorder for those. An alternate file attachment option is to specify a URL instead of a filename, and WSN will automatically import the file from that URL.
If you're importing a very large number of items you may find that the page times out. If so you'll need to cut your file into parts and do one part at a time.
Be sure to regenerate counters after you finish importing.




