![]() |
apws.pl Script : |
||||
|
|||||
|
Note: "cgi-bin" directory
The instructions in this documentation assume that your web server has a directory namedcgi-bin where scripts are to be stored on your web server. Some web servers use a different name for this directory, such as:cgi-local , or cgi, or mainwebsite_cgi or something similar. In that case, where you seecgi-bin in any instruction, substitute it with the directory name that your web server uses.
The following diagrams illustrate what you will find in the apws.pl .zip file and where those files should be located on your server after you follow the installations instructions below.
Note: Some servers have the
cgi-bin directory separate from the publicly visible html files, such as: mainwebsite_cgi for yourcgi-bin files, and mainwebsite_html for your html files. So the following diagram may not exactly look like what you have on your server. Ask your hosting company if you don't know where yourcgi-bin directory is located.
|
.zip file:
|
Your server:
|
Follow these steps to install the apws.pl script:
Download apws.pl .zip file to your computer.
Unzip the .zip file. You should end up with a directory apws-YYMMDD (such as apws-070622).
Run your FTP program and connect to your server.
Go into your cgi-bin directory and create a subdirectory named apws
Go into the newly created subdirectory apws
On your local computer, go into the apws-YYMMDD
Upload apws.pl and apws-ini.txt and apws.dat to your server. Note: Upload these files using ASCII transfer mode. If necessary, change the first line of apws.pl to the path of perl on your server (default is: /usr/local/bin/perl).
Select apws.pl file on your server and do CHMOD 755 (User: read/write/execute; Group: read/execute; Other: read/execute) so that apws.pl can be run.
Select the templates folder (do not go into it) and upload the entire directory. Note: Most FTP programs allows you to upload an entire directory just like you can upload an individual file.
Select the includes folder (do not go into it) and upload the entire directory.
On your server, go to your root directory (the directory where your home page file is located).
Create a subdirectory named apws and then go into it.
On your local computer, select the img directory (do not go into it) and upload the entire directory. Note: Must be uploaded in binary mode since contains .gif/.jpg graphic files.
To test that apws.pl is installed successfully, run your web browser and access
DOMAIN.com/cgi-bin/apws/apws.pl (substitute in your own domain name in this URL) and you should see something like what is atwww.Million-Posters.com
500 Internal Server Error
If you see a "500 Internal Server Error" then follow these steps:
Redownload the .zip file to your Windows PC and unzip it again.
Reupload apws.pl file using ASCII transfer mode (not binary mode!)
Select apws.pl on the server and do CHMOD 755 (User: read/write/execute; Group: read/execute; Other: read/execute)
If necessary, change the first line of apws.pl so it has the correct path to perl on your server (default is /usr/local/bin/perl; try: /usr/bin/perl). If you're not sure, look in any other .pl file on your server that works, or ask your hosting company what is the path to perl.
Test the installation by accessing
DOMAIN.com/cgi-bin/apws/apws.pl again. Press your web browser's Refresh/Reload button.Request an apws-key.txt key file.
Note: Until you request and install the key file, apws.pl runs in demo mode and all links have no affiliate ID.
When you receive your key file, upload it to the same directory where apws.pl is located
(e.g.: /cgi-bin/apws/) .
To run apws.pl, access it at:
http://DOMAIN.com/cgi-bin/apws/apws.pl Parameters can be added at the end of the URL to tell apws.pl what to output. Multiple parameters can be specified. For example, the following parameters would tell apws.pl to output category 976 (Cat posters) displayed in a grid of
2-columns by4-rows :
http://DOMAIN.com/cgi-bin/apws/apws.pl?cat=976&grid=c:2,r:4 The parameters can be categorized into three groups:
- Search criteria
- Output formatting
- Redirection
- Configuration
Search Criteria Parameters
| Parameter | Default | Description | ||||||||||||||||||||||
|
0 |
AllPosters.com category # to display. To determine a category #, browse through our sample website million-posters.com to the category you want to display and observe the value of the cat parameter in the URL. Category 0 (zero) is the root top-level category. |
|||||||||||||||||||||||
|
(none) |
Specify this parameter to allow an 'out-of-bounds' category. If you are using the categories configuration variable to show a subset of categories rather than all categories, normally apws.pl will block access to any category that is outside of this subset, and the user is redirected to the AllPosters.com website. This behaviour can be overridden by specifying the catok parameter thus allowing an 'out-of-bounds' category to be displayed. For example, cat=101&catok will cause category 101 (Movies) to be displayed even if it is an 'out-of-bounds' category. |
|||||||||||||||||||||||
|
(none) |
Limits results to specified product height range. This parameter enables you search for products of a particular height (e.g.: all posters less than 20 inches in height). Examples:
Defaults to the value of the similarly named configuration variable height |
|||||||||||||||||||||||
|
(none) |
Keywords to search for. The characters +, |, and > have special meaning:
|
|||||||||||||||||||||||
|
(none) |
Limits results to specified product price range. This parameter enables you search for products of a particular price (e.g.: all posters less than $20 in price). Units of this parameter are specified via the currency parameter. Examples:
Defaults to the value of the similarly named configuration variable price |
|||||||||||||||||||||||
|
(none) |
Use pre-defined search defined in the configuration file. For example, search=hanks would use the search parameters defined in the search.hanks configuration variable. For example: search.hanks "keywords=tom+hanks&grid=c:2,r:3" Pre-defined searches can contain search criteria parameters as well as output formatting parameters. |
|||||||||||||||||||||||
|
PD |
Sort order.
Defaults to the value of the similarly named configuration variable sort |
|||||||||||||||||||||||
|
(none) |
Limits results to specified product width range. This parameter enables you search for products of a particular width (e.g.: all posters less than 20 inches in width). Examples:
Defaults to the value of the similarly named configuration variable width |
Output Formatting Parameters
| Parameter | Default | Description | ||||||||||||||||||||||||
|
shadow |
Type of border to appear around images. Possible values are: none, outline, shadow, mounted, framed, framed2, framed3, ..., framed10. See: Borders & Styles. Defaults to the value of the similarly named configuration variable border |
|||||||||||||||||||||||||
|
USD |
Currency to use for prices. Possible values are: USD, AUD, CAD, CHF, DKK, EUR, GBP, HKD, JPY, NOK, NZD, SEK, SGD, ZAR. Defaults to the value of the similarly named configuration variable currency |
|||||||||||||||||||||||||
|
c:3,r:6 |
Grid layout. Various options can be specified, each separated by a comma, and options can be specified in any order.
Examples:
Defaults to the value of the similarly named configuration variable grid |
|||||||||||||||||||||||||
|
(none) |
Fomat the output so that it can be used as the source of a <IFRAME> tag so that results can be embedded into a webpage. Example: <iframe href="/cgi-bin/apws/apws.pl?iframe&cat=101"> |
|||||||||||||||||||||||||
|
yes |
Display links to sub-categories ("kids") of the current category. Defaults to the value of the similarly named configuration variable kids |
|||||||||||||||||||||||||
|
(none) |
Number of columns (1, 2, or 3) to use when displaying links to sub-categories ("kids") of the current category. Defaults to the value of the similarly named configuration variable kids.cols. If no value is specified, then a suitable number of columns is automatically used based on the number of links. Defaults to the value of the similarly named configuration variable kids.cols |
|||||||||||||||||||||||||
|
1 |
Language to use for products. Possible values are:
Defaults to the value of the similarly named configuration variable language |
|||||||||||||||||||||||||
|
(none) |
Specified whether to use large images or thumbnail images. When the large parameter is specified, the grid is automatically set to Defaults to the value of the similarly named configuration variable img.large |
|||||||||||||||||||||||||
|
yes |
Display navigation bar ("navbar") at the top of pages so can link to parent categories of the current category. Defaults to the value of the similarly named configuration variable navbar |
|||||||||||||||||||||||||
|
(none) |
Overrides the kids configuration variable so that links to sub-categories (a.k.a.: "kids") are not displayed. To disable "kids" on a global basis, set the kids configuration variable to no |
|||||||||||||||||||||||||
|
(none) |
Overrides the pagebar configuration variable so that the pagebar is not displayed. To disable the pagebar on a global basis, set the pagebar configuration variable to no |
|||||||||||||||||||||||||
|
(none) |
When apws.pl links back to itself (e.g.: link to a |
|||||||||||||||||||||||||
|
1 |
Page to display. First page is 1. See size parameter to select size of each page. |
|||||||||||||||||||||||||
|
yes |
Display page bar at the bottom of pages so can link to continuation pages. Defaults to the value of the similarly named configuration variable pagebar |
|||||||||||||||||||||||||
|
(none) |
Fomat the output so that results can be embedded into a PHP webpage. Example: virtual("/cgi-bin/apws/apws.pl?php&cat=101"); |
|||||||||||||||||||||||||
|
(none) |
Fomat the output so that it can be used as the source of a <SCRIPT> tag so that results can be embedded into a webpage. Example: <script src="/cgi-bin/apws/apws.pl?script&cat=101" |
|||||||||||||||||||||||||
|
(none) |
Use pre-defined search defined in the configuration file. For example, search=hanks would use the search parameters defined in the search.hanks configuration variable. For example: search.hanks "keywords=tom+hanks&grid=c:2,r:3" Pre-defined searches can contain search criteria parameters as well as output formatting parameters. |
|||||||||||||||||||||||||
|
18 |
Page size specifying number of products to show per page. Maximum is 200. If there are more products than will fit on one page, a pagebar is displayed. See page parameter to select subsequent pages. Note: If the size parameter is greater than the grid size (#-of-columns X #-of-rows) then size is automatically decreased to the grid size. This adjustment thus makes the page parameter work as expected to show subsequent pages. |
|||||||||||||||||||||||||
|
0 |
Number of items to skip forward on the page. This parameter allows you to start displaying products starting at an offset from the first item on the page. This parameter is useful when you include two (or more) calls to apws.pl in an existing webpage and each call has a different page/grid size but you still want the posters to appear sequential. For example, suppose you have an SSI at the top of your page that displays a grid of 3-columns by 1-row, followed an article, and then a grid of 2-columns by 2-rows. The first grid should display products #1, #2, and #3. Then the second grid should display products #4 through #7. To do that, the second SSI needs to skip forward by 3 since the first SSI displays the first 3 products:
|
|||||||||||||||||||||||||
|
PD |
Sort order.
Defaults to the value of the similarly named configuration variable sort |
|||||||||||||||||||||||||
|
(none) |
Fomat the output so that it can be used as the source of a SSI (server-side-include) tag so that results can be embedded into a webpage. Example: <!--#include virtual="/cgi-bin/apws/apws.pl?ssi&cat=101"--> |
|||||||||||||||||||||||||
|
1 |
Item details layout style. Specifies the style to use when displaying the details of each item. Possible values are: 1, 2, 3, 4, 5, 6. See: Borders & Styles. |
|||||||||||||||||||||||||
|
default |
Template file to use to display page. Default is the value specified by the cat parameter, otherwise uses "default" which uses file default.html. Do not include the filename ending ".html". Note: script, ssi, php and iframe take precedence over template. |
|||||||||||||||||||||||||
|
(none) |
Displays program version information. Example: |
Redirection Parameters
| Parameter | Default | Description |
|
(none) |
Redirect to the specified category at the AllPosters.com website. For example, to redirect to category 101 (Movies): |
|
|
(none) |
Redirect to the home page of the AllPosters.com website. Example: |
|
|
(none) |
Redirect to the specified item at the AllPosters.com website. For example, to redirect to item 1234: |
|
|
(none) |
Redirect to the "framing" page at the AllPosters.com website for the specified item. For example, to redirect to item 1234 framed: |
|
|
(none) |
Redirect to the "mounting" page at the AllPosters.com website for the specified item. For example, to redirect to item 1234 mounted: |
|
|
(none) |
Redirect to the keywords search results page at the AllPosters.com website for the specified search keywords. For example, to redirect to keywords search for "tom hanks": Parameter gosearch can be combined with cat parameter to limit results to a specified category. |
Configuration Parameters
| Parameter | Default | Description |
|
(none) |
An additional configuration file can be loaded by using the cfg parameter. For example, cfg=blog would cause the configuration file |
Borders
The various borders available via the border parameter and border configuration variable are:
|
border=none |
border=outline |
border=shadow |
|
border=mounted |
border=framed |
border=framed2 |
|
border=framed3 |
border=framed4 |
border=framed5 |
|
border=framed6 |
border=framed7 |
border=framed8 |
|
border=framed9 |
border=framed10 |
|
Styles
The various styles available via the style parameter and style configuration variable are:
|
style=1 |
style=2
|
style=3
|
||
|
style=4
|
style=5
|
style=6 |
||
|
style=7
|
For those styles that display the product's price, you can hide the price by setting the price.show configuration variable to no
Customization is possible through the apws-ini.txt configuration file and also through template files in the cgi-bin/apws/templates directory.
Customization is possible through the apws-ini.txt configuration file. It is a text file located in the same directory where apws.pl is located. You can edit the file using any plain text editor such as Windows Notepad.
Configuration File Format:
To set a variable, use the line with the following format:
VariableName "VariableValue" If you want to include a " (quotation mark) in the VariableValue, then use any of these alternate formats:
VariableName 'VariableValue'
VariableName [VariableValue]
VariableName {{VariableValue}}Blank lines and leading spaces are ignored.
Everything afer a # character is ignored as a comment.
Configuration Variables:
The table below describes the configuration variables:
border
| Variable | Default | Description |
|
shadow |
Default value for the border parameter. |
cache.*
| Variable | Default | Description |
|
cache |
Cache directory. Relative to the directory where apws.pl is located. |
|
|
yes |
yes = Compress the cache to save disk space. |
|
|
3days |
Cache stale time (in hours). For units other than hours, add a units suffix: days, months, years. |
|
|
1MB |
Cache size (in bytes). For units other than bytes, add a units suffix: KB or MB. |
cat.* -- categories
| Variable | Default | Description |
|
yes |
yes = Redirect to category at AllPosters.com if no results. Note: "No results" message is defined by format.noresults configuration variable. |
|
|
(none) |
Causes category NUMBER to be deleted; it will not appear in the list of sub-categories. Any access to category NUMBER, or any of its sub-categories, will redirect to that category at the AllPosters.com website. See also: catdelkids and catkeep. For example, to delete "Movies" (category 101) use: catdel.101 yes Note: The yes is required. If you leave it out, an error will be reported when you run apws.pl |
|
|
(none) |
Causes sub-categories of category NUMBER to be deleted; it will appear that category NUMBER has no sub-categories. Any access to sub-categories of category NUMBER will redirect to that category at the AllPosters.com website. See also: catdel and catkeep. |
|
|
(none) |
Causes category NUMBER, and sub-categories of it, to be visible. This configuration variable enables you to make accessible specific sub-categories that have been deleted by catdel and catdelkids. Thus, for example, you could delete all Animals posters and then make Cats and Dogs posters (which are sub-categories of Animals) visible. See also: catdel and catdelkids. For example, to delete all sub-categories of Domestic Animals (41641) except for Cats (976) and Dogs (977) categories, use the following three configuration variable settings: catdelkids.41641 # delete all kids of Domestic Animals |
|
|
(none) |
Causes category NUMBER, and sub-categories of it, to be local. This configuration variable enables you to make local specific sub-categories that have been made remote by catremote and catremotekids. Thus, for example, you could make all Animals posters remote and then make Cats and Dogs posters local. See also: catremote and catremotekids. |
|
|
Posters |
Name of root category. |
|
|
Posters |
Name of nameless results. |
|
|
no |
Leave this configuration variable undefined unless required. Specifies the category to display if nothing to display. Defaults to catroot value if non-zero, or to 18979 (Posters > Featured Categories > Best Sellers). |
|
|
(none) |
Causes category NUMBER to be remote. Any access to category NUMBER, or any of its sub-categories, will redirect to that category at the AllPosters.com website. See also: catremotekids and catlocal. |
|
|
(none) |
Causes sub-categories of category NUMBER to be remote; category NUMBER is displayed locally. Any access to sub-categories of category NUMBER (but not to category NUMBER itself) will redirect to that category at the AllPosters.com website. See also: catremotekids and catlocal. |
|
|
(none) |
Category to display as root category. The root category is accessed by using parameter cat=0 or by not specifying the cat parameter. If set to 0 (zero) then the top-level root category of AllPosters.com is displayed as the root category. Thus all poster categories and sub-categories are available to be displayed. If set to a NUMBER then that category is displayed as the root category. For example, setting categories to 622 would cause the Animals category (category 622) to be displayed as the root category. If set to a comma-separated list of numbers would cause those categories to be displayed as the root category. For example, setting categories to 622,101,290 would cause the Animals, Movies, and Sports categories to be displayed as the root category. |
currency.*
| Variable | Default | Description |
|
(none) |
Default value for the currency parameter. |
|
|
$ |
Currency prefix. If you use the language parameter or the language configuration variable, apws.pl will use currency.prefix.LANGUAGEID if it is defined, otherwise currency.prefix will be used. |
|
|
(none) |
Currency suffix. If you use the language parameter or the language configuration variable, apws.pl will use currency.suffix.LANGUAGEID if it is defined, otherwise currency.suffix will be used. |
format.*
| Variable | Default | Description |
|
Framed |
Text for "Framed" link. |
|
|
Unframed |
Text for "Unframed" link. |
|
|
Mounted |
Text for "Mounted" link. |
|
|
|
Formatting string for navbar. Default is: <p class='apwsNavbar'>{navbar}</p> The formatting string can contain any HTML. The navbar will be substituted in where {navbar} appears in the formatting string. Note: The default formatting string uses class='apwsNavbar' thus allowing you to style the navbar by simply defining class apwsNavbar in CSS. |
|
|
|
Formatting string for pagebar. Default is: <p class='apwsPagebar'><b>pages:</b> {pages}</p> The formatting string can contain any HTML. The pagebar will be substituted in where {pages} appears in the formatting string. Note: The default formatting string uses class='apwsPagebar' thus allowing you to style the pagebar by simply defining class apwsPagebar in CSS. |
|
|
|
Formatting string for pagebar when the pagebar.remote configuration variable is set to yes. Default is: <p class='apwsPagebar'><a href='{link}'>Click here for more {form.keywords} in {name} ...</a></p> The formatting string can contain any HTML. The URL to the category/search results page at AllPosters.com will be substituted in where {link} appears in the formatting string. Note: The default formatting string uses class='apwsPagebar' thus allowing you to style the pagebar by simply defining class apwsPagebar in CSS. |
|
|
|
Formatting string for message when no results. Default is: <p class='apwsNone'>Nothing found</p> The formatting string can contain any HTML. Note: The default formatting string uses class='apwsNone' thus allowing you to style the message by simply defining class apwsNone in CSS. |
|
|
|
Template formatting string to use when script parameter is specified. Default is: {results} The formatting string can contain any HTML. |
|
|
|
Template formatting string to use when ssi parameter is specified. Default is: {results} The formatting string can contain any HTML. |
|
|
|
Template formatting string to use when iframe parameter is specified. Default is: <html><body bgcolor="white" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">{results}</body></html> The formatting string can contain any HTML. |
|
|
|
Template formatting string to use when no other formatting template selected. Default is: <html><head><title>{name}</title></head><body bgcolor="white">{results}</body></html> The formatting string can contain any HTML. |
grig -- language
| Variable | Default | Description |
|
(none) |
Default value for the grid parameter. |
|
|
(none) |
Default value for the height parameter. |
|
|
no |
Specifies whether to make image URL's absolute (start with the server's domain name instead of just relative "/"). Useful if you are calling apws.pl remotely from another server. Note: Images URL are automatically made absolute if parameters absurl, script, or iframe are specified. |
|
|
apws/img |
Images directory (relative to directory where your home page file is located). The images directory contains graphic files to generate the border/frame/shadow effect around images. The apws.pl .zip file contains the img directory that you should have uploaded during the installation procedure. |
|
|
no |
Default value for the large parameter. Note: If you always display large images, it is advisable to set the number of grid rows to a small number (e.g.: 1 through 5) otherwise the page may take some time to load, particularly on slow internet connection. |
|
|
yes |
yes = Show category kids (sub-categories). |
|
|
0 |
Number of columns in category kids list (0, 1, 2, or 3). The special value 0 causes apws.pl to automatically choose the number of columns based on the number of kids. |
|
|
(none) |
Default value for the language parameter. |
links.*
| Variable | Default | Description |
|
no |
yes = Links open new windows. |
|
|
_blank |
Target of links when they open a new window. Applies only when links.newwindow is set to yes. |
|
|
yes |
yes = Use relative links when referring to self. |
navbar.*
| Variable | Default | Description |
|
yes |
yes = Show navbar. |
|
|
yes |
yes = Link the navbar to self. |
|
|
(none) |
Prefix to navbar. This string is appended before the navbar. It can contain any HTML. Typically would be used to add a "Home" link at the start of the navbar, such as: navbar.prefix "<a href='/'>Home</a>" |
|
|
" > " |
Navbar link separator. Appears between each link in the navbar. |
pagebar.*
| Variable | Default | Description |
|
yes |
yes = Show pagebar. The format of the pagebar is specified in the format.pagebar configuration variable. |
|
|
"«back" |
Text of pagebar "back" link. The default value appears as: «back |
|
|
"next»" |
Text of pagebar "next" link. The default value appears as: "next»" |
|
|
"|" |
Pagebar page separator. |
|
|
50 |
Maximum pages on pagebar. |
|
|
no |
yes = Pagebar has links to AllPosters.com. See format.pagebar.remote configuration variable. |
price.*
| Variable | Default | Description |
|
(none) |
Default value for the price parameter. |
|
|
yes |
yes = Show prices. |
search.*
|
(none) |
Define search parameters. To access a pre-defined search in search.NAME, use parameter search=NAME For example, to define a search named hanks that does a keyword search for "Tom Hanks" (he is an actor) and outputs as a grid of search.hanks "keywords=tom+hanks&grid=c:2,r:3" To use this pre-defined search, use parameter search=hanks |
|
|
(none) |
Default pre-defined search to be used if no parameters specified. For example, to have Cats posters displays if no parameters are specified, then define: search.default "cats=976" Note: This does not change the root category. To do that, use the categories configuration variable. |
|
|
(none) |
Pre-defined search to be used when search=random is used. This pre-defined search is applied before a randomly selected search from search.random.* is applied. Thus you can apply a common set of parameters to all your random searches such as output parameters (e.g.: Note: You can leave the pre-defined search search.random undefined and still define search.random.* |
|
|
(none) |
Pre-defined random searches to be used when parameter search=random is used. One of the pre-defined searches from search.random.* is randomly choosen and applied. Note: If search.random is defined, it is applied first and then a randomly chosen |
size -- template.*
|
18 |
Items per page. |
|
|
(none) |
Default value for the sort parameter. |
|
|
1 |
Default value for the style parameter. |
|
|
(none) |
Default value for the template parameter. |
|
|
templates/1 |
Templates directory. Relative to the directory where apws.pl is located. The apws.pl .zip file contains the templates directory that you should have uploaded during the installation procedure. Four template sets are provided in the apws.pl .zip file. To see the other template sets, change template.dir to templates/2 or to templates/3 or to templates/4 |
virtual.*
| Variable | Default | Description | |||||||||||||||
|
(empty) |
Name of virtual directory. If empty, then Virtual Directory is disabled. See: Virtual Directory. Note: If you enable Virtual Directory, virutal.dir must match the directory name that you have specified in your .htaccess file. |
||||||||||||||||
|
/ |
Specifies the ending that is used at the end of Virtual Directory URL's. Some possible values:
|
||||||||||||||||
|
yes |
Specified whether to include the named portion in the virtual directory URL. The named portion is based on the category path. Example URL's for category 19816 ("Subjects > Animals > Domestic Animals > Cats > Kittens"): With virtual.named yes: With virtual.named no: |
||||||||||||||||
|
0 |
Maximum number of directories to include in the named/keyword portion of a virtual directory URL:
|
||||||||||||||||
|
1 |
Number of leading keywords to skip when generating the named/keyword portion of a virtual directory URL. The default is 1 since the first keyword the name of the root category (typically, "Posters"). |
||||||||||||||||
|
no |
Specifies whether to include the directory |
width -- www.host
| Variable | Default | Description |
|
(none) |
Default value for the template parameter. |
|
|
|
The domain name to use when processing SSI (server-side-include) back to your server. Defaults to your web server's domain name (from HTTP_HOST http header). In some situations, such as load balance servers, self requests must be to "http://local/" rather than "http://domain.com/". In that case, set www.host to "local". |
See the apws-ini.txt file for any other configuration variables that are not documented above.
Configuration Report:
To view the Configuration Report showing the loaded configuration, access
/cgi-bin/apws/apws.pl?cfg=CFGVALUE where CFGVALUE is the value of the cfg variable found in yourapws-key.txt file. The Configuration Report is organized into collapsible/expandable sections. Click a section to expand it open and see its details.
By setting the categories configuration variable, you can configure apws.pl to create a niche store that displays products from only a particular category (and its sub-categories) such as only Cats posters. You can also coinfugre apws.pl to display products from a set of categories (and their sub-categories) such as only Movie posters, Music postes, and Sports posters.
One Category (e.g.: Cats)
Edit apws-ini.txt and set the categories configuration variable to the category number that you want to appear at the root category. For example, to display Cats posters (category 976) at the root category, use:
categories 976 Once categories has been set, any access to a category that is outside of this category (e.g.: Travel posters, category 621) will automatically redirect the user to the accessed category at the AllPosters.com website.
Set of Categories (e.g.: Movies, Music, and Sports)
categories Configuration Variable
Edit apws-ini.txt and set the categories configuration variable to the category numbers that you want to appear at the root category. separate each category number by a comma (,). For example, to display Movies posters (category 101) and Music posters (category 122) and Sports posters (category 290) at the root category, use:
categories 101,122,290 A bulleted list of these categories will appear at the root category. The order of the list will be the same order that you specify the categories in the categories configuration variable.
Once categories has been set, any access to a category that is outside of these categories (e.g.: Travel posters, category 621) will automatically redirect the user to the accessed category at the AllPosters.com website.
catnoitems Configuration Variable
You should also set the catnoitems configuration variable. Thumbnails from this category will show up at the root category. If you do not set catnoitems then it defaults to category 18979 (i.e.: Posters > Featured Categories > Best Sellers). For example, to display thumbnails of Movies posters (category 101) at the root category, use:
catnoitems 101 You would typically set catnoitems to one of the categories that you are using in the categories configuration variable. For example, if you have
categories 101,122,290 then you might usecatnoitems 101
Customization is possible through template files in the cgi-bin/apws/templates directory.
Four template sets are provided in the .zip file. During the installation process, you should have uploaded the templates directory to
/cgi-bin/apws/templates
|
|
|
|
|
|
The template files to use are specified via the template.dir configuration variable as well as the optional template parameter. By default, template.dir is set to templates/1 which causes the templates in
/cgi-bin/apws/templates/1 to be used. For example, to use template set 2, change template.dir to templates/2You can use these templates as is, or modify them in your HTML editor, or create your own from scratch.
Create Template File to Match Your Website
To create a template file that matches the look-and-feel of your website, do the following steps:
Take one of your webpage files (e.g.: your "About Us" page) and copy it to default.html somewhere on your local computer. Making a copy ensures that you do not accidentally overwite the original file!
Cut out the contents portion of the webpage.
At the location in the webpage where you want the poster results to appear, add the following field code:
{results} Note: Those are curly braces
shift-[ andshift-] , they are not parentheses.For example, your template might now be:
<html>
<head><title>Posters</title></head>
<body background="img/back.gif">
<center><a href="home.html"><img src="img/logo.gif"></a></center>
<h1>Posters</h1>
{results}
</body>
</html>Edit all file references so that they start with a leading / character (see next section "Template Files and Broken Graphics" for full details). For example:
<html>
<head><title>Posters</title></head>
<body background="/img/back.gif">
<center><a href="/home.html"><img src="/img/logo.gif"></a></center>
<h1>Posters</h1>
{results}
</body>
</html>(optional) Edit the <TITLE> tag so that the title is more descriptive of the results. The field code {name*} returns the name of the results.
<title>Posters: {name*}<title> Using a plain text file (e.g.: Windows Notepad editor or other .txt editor), edit the text file apws-ini.txt (included in the .zip file) and change the template.dir configuration variable:
template.dir "." Upload default.html and apws-ini.txt to the same directory where apws.pl is located.
Access http://www.domain.com/cgi-bin/apws/apws.pl and ensure that the page appears correct. If graphics are broken, go back and edit your default.html file.
Template Files and Broken Graphics
If you create your own template files, you must ensure that all <IMG> tags have SRC's that start with a / character or with http:// such as SRC="/logo.gif" or SRC="http://www.mydomain.com/logo.gif"
Relative URL's such as in SRC="logo.gif"