|Associate Engine :
|Home > Associate Engine > Documentation > Quick Tutorial|
The results displayed by the Associate Engine script are determined by parameters that you as the webmaster indicate as part of the link to the Associate Engine script (or as part of the <SCRIPT> tag or Server-Side-Include statements). Once you learn the general format of a link to the Associate Engine script, you can easily access a majority of the features of the Associate Engine script.
The format of a link is generally:
<A HREF="/cgi-bin/ae.pl?PARAMETERS">Click here</A>
The format of a <SCRIPT> tag is generally:
Note: The script parameter is required. It tells Associate Engine that it is being called via a <SCRIPT> tag. The ampersand (&) is used to separate parameters.
The format of a Server-Side-Include (SSI) statement is generally:
Note: The ssi parameter is required. It tells Associate Engine that it is being called via an SSI statement. The ampersand (&) is used to separate parameters.
Note: For SSI statements to be recognized by your server, your server may required that the file containing the SSI statements have a filename that ends with ".shtml" rather than ".html", such as "index.shtml". Some servers are configured to recognize SSI statements in both ".html" and ".shtml" files. Some server may have recognition of SSI statements turned off. If SSI statements don't work on your server, ask your hosting company.
The format of a PHP virtual() function call is generally:
Note: The ssi parameter is required. It tells Associate Engine that it is being called via a virtual() function call which is functionally equivalent to an SSI statement. The ampersand (&) is used to separate parameters.
Windows Servers: The PHP virtual() function is not available on Windows servers. In that case, use the PHP file_get_contents() function instead:
PARAMETERS lets you specify various search criteria and formatting options.
You can see a good example at our data backup webpage. You'll see that we've included a mix of both content and products. The search results are generated using our Associate Engine script. For example, the grid of nine Iomega disk drive products shown at the data backup page were generated by inserting the following single line of HTML code into the webpage where we wanted the results to be shown:
This <SCRIPT> tag will run a Perl script that accesses Amazon.com's XML Web Services and returns formatted results. The above URL basically consists of a few PARAMETERS:
Parameter Name Parameter Value Meaning browsenodesearch= 1193862
This is the amazon.com's browse page number.
This specifies to search in amazon.com's electronics store.
This specifies that the results are to be formatted in a grid with the following options:
Option Meaning c:3,r:3
These grid options format the results in a 3-columns by 3-rows grid.
This grid option shows prices and displays them in the specified color, green.
This grid option indicates to align top the image and text results.
This grid option causes products with images to be displayed first, images first.
The above <SCRIPT> tag generates the following grid. You'll notice that the results are formatted as a 3-column by 3-row grid, with prices shown in green, with images and text top-aligned, and products with images shown first (products with no image are automatically shown as "[no image]").
(Advanced users: You can also specify a "grid" configuration variable in your
ae-ini.txtconfiguration file. It will be used as the default value for the "grid" parameter; that way you do not have to put any grid parameters (grid, p, at, if) in the URL. You can even set up a grid style similar in concept to a style in a word processor)
(Advanced users: Above are only a few of the many parameters supported. See Script Parameters in the Technical Documentation for a complete list.)
Simply by changing the browsenodesearch= number the webmaster can change the products displayed. For example, the following HTML line displays the nine CD-RW products also shown on the above data backup page:
Note that the only difference between the above two HTML tags is the number after the browsenodesearch= parameter.
It is also possible to display results in a list format. See our page on UPS power backup. Again, the HTML code to display this list is very similar to the above HTML tags. Here's the HTML code:
In the above UPS example, the browsenodesearch= parameter has changed, we've removed the grid parameters (which causes the results to default to a list format), and we've added in a pagesize= value to limit the results to 10 products.
The results are automatically updated and cached to show the top selling products so there's no need to cut-and-paste with the latest products.
E.&O.E.; © Cusimano.Com Corporation; www.c3scripts.com