Site Plugin documentation
-------------------------

                          *** OUT OF DATE ***
						  
In order to facilitate support for multiple item types, it was felt 
appropriate, that this support should also include more than just
IMDB for automatic item import.  The site plugin architecture has
been introduced to provide this.

The basic functionality is:

A site/ subdirectory, with a subdirectory off of site/ for each
particular site:

	/site
	    	/imdb

The site.php will be used to include the particular
site/?????/index.php at runtime, while the functions/site.php will
provide numerous functions appropriate for use with all sites.

Each site will include a index.php which will be the initial
page to start the site plugin process.  This page expects to recieve
a $s_item_type and whatever other input parameters as provided
by the $item_input_fields[] array for the specific site.

Each specific site will also provide a config.php file to include
various configuration parameters that will be used in the item_add.php
and item_details.php scripts.

The following describes the various variables that must be included
in the site config.php script.

// You must specify a title, otherwise the plugin will not be recognised
$site_title = "Site Title";

// This is an external link, that will be included on the item_add.php
$site_external_link = "http://link.to.site.com";

// specifies the icon to use for item_add.php and item_details.php scripts
// to help identify which [is being|has been] used.  This icon should
// be specified relative to the actual site/$site directory itself!
$site_image_icon = "image.gif";

// Specifies any mappings between what is passed from the site plugin, and
// what the item_input script expects to receive.  
// 		Format is s_attribute_type=>site_variable.
// If they are the same, then do not bother including them.
$site_attribute_map = array("cdtime"=>"run_time","cdtrack"=>"tracks");

$title_attribute = "alt_title";

// Specifies an array of any extra fields required in the site process.  For
// instance search parameters, such as title for IMDB.
$site_input_fields[0] = array(field=>"title",value=>"Title");
$site_input_fields[1] = array(field=>"date",value=>"");
// You could even specify such things as login name for specific plugins 
// that require it.
$site_input_fields[2] = array(field=>"uid",value=>"");

// This defines the SRC= part of a HREF link for the item.  The rest of the 
// link block will be obtained from the $site_title/$site_image_icon 
// combination!
$site_item_link_rs[] = array(link=>"Link text",url=>"url_of_link");
$site_item_link_rs[] = array(link=>"Link text 2",url=>"url_of_link 2");

Integration with Language support
---------------------------------

Each site plugin will have a $lang_var['site'] array entry, with a format 
similiar to the following.  

$LANG_VARS['site']['imdb'] = array('description'=>'<i>The</i> source of movie 
information, but with nothing specific to distribution formats such as DVD and VHS.',
				'input_fields'=>array('title'=>'Title Search'));

Requirements
------------

There are several things that has to be assumed if this is going to work.
For one, the url parameters coming from the script that calls the main
item_input.php script, have to be of the same name as the strtolower
S_ATTRIBUTE_TYPE defined for the s_item_type.  You can use the 
$site_attribute_map if they are going to differ.  Also if the external 
site is providing a title, it must be accessible from item_input as $title,
nothing else.  

s_attribute_type table configuration
------------------------------------

In order for the system to accurately recognise which site_type actually 
inserted a particular record so that requests can be made against this site
to display links etc, it is a good idea (and useful anyway) to have at least
one s_attribute_type assigned to a site_type.  This is done by setting the 
s_attribute_type site_type field to be the same name as the subdirectory 
underneath site/  There is a 10 character restriction on names so choose 
carefully.

When item_display.php displays a record it will get a list of all site plugins
that are linked to the particular s_item_type and ask each of them in turn, to
display a item link.  

It is up to each plugin to decide whether to display a link, if there are no 
actual site specific attributes set.  For example, in the CASE of IMDB, it 
will display a special link based on TITLE and YEAR if no IMDB_ID attribute 
is set.
