Associate Engine : Quick Tutorial  
Home > Associate Engine > Documentation > Quick Tutorial

Quick Tutorial

Browse Quick Tutorial
  1. How to run Associate Engine
  2. Introduction to PARAMETERS
  3. Showing Different Products
  4. Showing Results as a List
  5. Learn More
 

Related:



How to run Associate Engine

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.

  1. The format of a link is generally:

    <A HREF="/cgi-bin/ae.pl?PARAMETERS">Click here</A>

  2. The format of a <SCRIPT> tag is generally:

    <SCRIPT SRC="/cgi-bin/ae.pl?script&PARAMETERS"></SCRIPT>

    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.

  3. The format of a Server-Side-Include (SSI) statement is generally:

    <!--#include virtual="/cgi-bin/ae.pl?ssi&PARAMETERS"-->

    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.

  4. The format of a PHP virtual() function call is generally:

    virtual("/cgi-bin/ae.pl?ssi&PARAMETERS");

    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:

    print file_get_contents("http://www.mydomain.com/cgi-bin/ae.pl?ssi&PARAMETERS");

PARAMETERS lets you specify various search criteria and formatting options.



Introduction to PARAMETERS

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:

<SCRIPT SRC="/cgi-bin/ae.pl?script&browsenodesearch=1193862&mode=electronics&grid=c:3,r:3,p:green,at,if"></SCRIPT>

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.

mode= electronics

This specifies to search in amazon.com's electronics store.

grid= c:3,r:3,p:green,at,if

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.

p:green

This grid option shows prices and displays them in the specified color, green.

at

This grid option indicates to align top the image and text results.

if

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.txt configuration 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.)



Showing Different Products

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:

<SCRIPT SRC="https://www.c3scripts.com/cgi-bin/ae.pl?script&browsenodesearch=565304&mode=electronics&grid=c:3,r:3,p:green,at,if"></SCRIPT>

Note that the only difference between the above two HTML tags is the number after the browsenodesearch= parameter.



Showing Results as a List

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:

<SCRIPT SRC="https://www.c3scripts.com/cgi-bin/ae.pl?script&browsenodesearch=764572&mode=electronics&pagesize=10"></SCRIPT>

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.



Learn More





E.&O.E.; © Cusimano.Com Corporation; www.c3scripts.com