
dhorne
User
Feb 15, 2003, 6:25 AM
Post #1 of 3
(3395 views)
Shortcut
|
|
Database API Questions
|
Can't Post
|
|
I’m moving a site from standard handcoded flatfiles to Article Manager. I’d like to automate this, and am looking to use the Database API. I can parse out the following information from the original site: *Article Title *Author *Subject *Article body *Image filenames I have added a custom field to Article Manager to store the original filename so that I can match the article to the file if required. From looking at the examples that come with the API zip I think I understand what is required to load the files, except where images and custom fields are involved. My questions are as follows: 1. How do I specify the image filenames when I call the API? 2. Do I put ***imagen*** placeholders for the graphics? 3. How do I specify the custom field (original filename)? 4. Do I copy the images to the upload directory? If so I take it that the names will be recognized and the placeholders will be substituted with the appropiate <img> tag when the article is published I’m guessing something like my %rec = ( 'mon' => $mon, 'day' => $day, 'year' => $year, ‘hour’ => hour, ‘min’ => $min, 'name' => $article, 'summary' => $summary, 'content' => $body, 'summary_format' => 'auto', 'content_format' => 'auto', 'status' => 2, 'cat' => 1, 'art_type' => 1, ‘spare1’ => $author, # Is the author the first spare field? ‘spare2’ => $original_name, ‘ufile_image1’ => $image[0], ‘ufile_image2’ => $image[1], ); my $new = &DB_Add($db{'art'}, \%rec); I’m not clear on the relationship between the ufile_image and imagename. Any advice appreciated. Thanks, Dan Dan Horne Redbone Systems Ltd [url]http://www.redbone.co.nz[/url]
|