User Guide

AShop V User Guide34
AShop Software © Copyright 2002 - 2010
There are two ways to include the lists, either through Javascript or a PHP include. This is how to use
the Javascript version...
<script language="JavaScript" src="top.js.php"></script>
And this is how to use the PHP include version...
include "includes/toplist.inc.php";
Note that the second version only works in a PHP script.
Parameters may be added to both versions of the script to customize the output. To add a parameter to
the Javascript version, first add a question mark "?" and then add the parameter. If more than one
parameter is specified, add an ampersand "&" after the first parameter and to separate additional
parameters. Here is an example.
<script language="JavaScript" src="top.js.php?items=5&redirect=product.html"></
script>
To add a parameter to the PHP include version, set it as a variable before the include statement. For
example:
$redirect="index.php";
include "includes/toplist.inc.php";
Number of Products Shown
If not otherwise specified, the top.js.php script will display the last 10 new products and latest additions.
To display a lower number of products, add the parameter "items=x" where x is the number of products
to display.
This include will display the 5 most popular and latest additions:
<script language="JavaScript" src="top.js.php?items=5"></script>
Or for the PHP include version use:
$items = 5;
include "includes/toplist.inc.php";
Redirect To A Different Product Page
In shops where only custom catalog pages are used and a direct link to the default storefront script is
not desired, the top.js.php product links can be redirected to the custom catalog pages by adding a
"redirect=x" parameter, where x is the local file name or URL.
This include will display the 10 most popular and latest additions in a custom product page named
"product.html".
<script language="JavaScript" src="top.js.php?redirect=product.html"></script>
The Layout Parameter
By setting the layout parameter you can control which lists are shown. These are the possible values of
the parameter: