The config.inc.php file is basically divided in two sections:
- one you must modify in order for amazOOP to work on your server. This is the section that will be described
in this document.
- The second part of config.inc.php should only be modified if you are
confident you know what you are doing. This part is covered in the
advanced settings section.
Server
First you must setup the domain names of your servers. You may also use an IP
address, for example if your test server is not associated with any domain name.
- $testServer = "test.server.com";
-
- $defServer = "www.server.com";
Based on your server's OS, you also have to specify the character(s) that separete
files. Remember that our test server is running Windows, and our definitive server is
running Linux or another UNIX-like OS.
- if($_SERVER['SERVER_NAME'] == $testServer)
- $fileSeparator = "\\";
- else
- $fileSeparator = "/";
Page type
Next you must indicate some characteristics of your pages.
You must indicate which character(s) are used to close individual tags. If your
pages are written in XHTML you should use " />"
, otherwise you
should use " >"
. Given the success XML has had lately, I suggest
you start coding your pages in XHTML if you don't do so yet.
Now you must indicate whether your pages are encoded in UTF-8 or not. By default,
AWS feeds are encoded in UTF-8 since they can include characters in Japanese and other
languages, but if you choose not to use UTF-8, all data will be transformed into ISO-8859-1.
I suggest using UTF-8 in your pages, specially if you are going to display information
from Amazon.co.jp.
- /**
- * Set this to " />" if your pages are in XHTML, or " >" otherwise.
- */
- $tagClose = " />";
-
- /**
- * Set this to true if your pages are UTF-8 encoded, or false otherwise
- */
- $UTF_8 = true;
Logging
You must now decide whether you want amazOOP to log errors and requests.
Set these variables to true
if you want to enable logging,
or false
if you do not require logging.
- $logErrors = true;
-
- $logRequests = true;
You must set a size for your log files, whether you are using them or not. If you
are not using log files these values will be ignored. The size is set in number of lines.
I have these values set to 2000 lines which seems to be enough in terms of time and the
files should not exceed 160KB.
- $requestLogSize = 2000;
-
- $errorLogSize = 2000;
You must obviously specify where your logs will be written. The file you downloaded
from SourceForge already contains an error log and a request log. Of course, you may
choose to use any other file, as long as it amazOOP has write permissions for it.
The variable that holds the name of the request log is $logFile
and
the variable that holds the name of the error log is $errorLog
.
- if($_SERVER['SERVER_NAME'] == $testServer)
- $logFile = "c:\\path\\to\\amazoop\\requests.log";
- else
- $logFile = "/path/to/amazoop/requests.log";
-
- if($_SERVER['SERVER_NAME'] == $testServer)
- $errorLog = "c:\\path\\to\\amazoop\\error.log";
- else
- $errorLog = "/path/to/amazoop/error.log";
Associates IDs
You can earn money from the sales you make using amazOOP. For this you have to apply
to Amazon's different associate programs around the world. When you get accepted in an
associate program, you receive an associate ID, wich you should add to amazOOP.
You do not have to request associate IDs from every Amazon site. You can request IDs
only for the sites you intend to sell products from and leave the rest with the default value
which is "webservices-20"
The addresses to the different associate program are:
French and Canadian Web Services are not available as of release 0.2. According to AWS
they should be available sometime during mid-2004
- $assocIDs = array( "us" => "usId-20",
- "uk" => "ukId-21",
- "fr" => "frId-22",
- "de" => "deId-23",
- "jp" => "jpId-24",
- "ca" => "caId-25"
- );
Images
You can use images in several places in amazOOP.
The most obvious place to start is with product images. These are usually provided
by Amazon, but occassionally, some product do not have an image. You can specify default
images to be used instead when this happens.
Since Amazon returns three image sizes, you must assign an image for each size. Of
course, you can also assign one image to all three sizes.
Our site's images are stored in folder c:\path\to\images\
in our
test server and in folder /path/to/images/
in our definitive server.
- $defaultImages = array( "small" => "/images/small.gif",
- "medium" => "/images/medium.gif",
- "large" => "/images/large.gif"
- );
Another place where you can use images, is for representing different platforms and
supports, such as DVDs, VHS, PS2, etc.
- $media = array( "dvd" => "/images/platforms/dvd.gif",
- "vhs" => "/images/platforms/vhs.gif",
- "dreamcast" => "/images/platforms/dreamcast.gif",
- "gamecube" => "/images/platforms/gcube.gif",
- "linux" => "/images/platforms/linux.gif",
- "ps2" => "/images/platforms/ps2.gif",
- "windows" => "/images/platforms/windows.gif",
- "xbox" => "/images/platforms/xbox.gif"
- );
You can also specify images to be used instead of regular buttons when creating "Add
to cart" forms.
- $buyNowImg = array ( "us" => "/images/mall/buttons/buyNowUS.gif",
- "uk" => "/images/mall/buttons/buyNowUK.gif",
- "de" => "/images/mall/buttons/buyNowDE.gif",
- "jp" => "/images/mall/buttons/buyNowJP.gif"
- );
Cache and Temporary Folders
To comply with the AWS Licese Agreement, and to improve performance, amazOOP requires
to directories to be created. Normally, when you extract the amazOOP source files to your
website's directory, these directories are automatically created.
You can use any other directories in your webserver as cache and temporary folder,
as long as they have write permission for amazOOP.
- /**
- * Temporary directory
- */
- if($_SERVER['SERVER_NAME'] == $testServer)
- $tmpDir = "c:\\path\\to\\amazoop\\tmp";
- else
- $tmpDir = "/path/to/amazoop/tmp";
-
- /**
- * Cache Directory
- */
- if($_SERVER['SERVER_NAME'] == $testServer)
- $cacheDir = "c:\\path\\to\\amazoop\\cache";
- else
- $cacheDir = "/path/to/amazoop/cache";
RSS Feeds
You can use amazOOP to provide RSS feeds. In order to do this you have to indicate
the path to the template to be used for the feed.
A sample template is included with amazOOP, but this feature is experimental and
will probably change in future releases.
- if($_SERVER['SERVER_NAME'] == $testServer)
- $xmlTemplate = "c:\\path\\to\\amazoop\\feed.xml";
- else
- $xmlTemplate = "/path/to/amazoop/feed.xml";
You should also setup some information needed to fill in the RSS feed. You may, of
course, leave this section empty if you don't plan to use RSS feeds.
- $rss = array( "xmlSchema" => "http://www.madd0.com/rss2m.xsd",
- "link" => "http://www.server.com/",
- "copyright" => "The content provided in this feed may be copyrighted.",
- "managingEditor" => "editor@server.com",
- "webMaster" => "webmaster@server.com",
- "author" => "author@server.com",
- "generator" => "amazOOP v0.2 (http://amazoop.sourceforge.net)",
- "docs" => "http://backend.userland.com/rss",
- "imageURL" => "http://www.server.com/images/logo_88x31.gif",
- "imageTitle" => "My Website",
- "imageLink" => "http://www.server.com",
- "imageWidth" => "88",
- "imageHeight" => "31",
- "title" => "My Website - ",
- "description" => ""
- );
Once this is configured, you are ready to start using amazOOP. AmazOOP can be further
customized to fit your specific needs, however, you have to be confortable with PHP, and
be armed with a lot of patience to understand the code. AmazOOP's advanced configuration is
documented in the Advanced Settings section.