Creating a toplist

If you want to use a toplist on your site, you have to create a new template, upload it to your server, set how it should be sorted and which sites to show and include the file generated by the template in the page where you want to use the toplist.

Creating a new template
Toplist templates are files with .stt extension that contain HTML code of a toplist, where the dynamic values are replaced by certain keys. Once per hour, files with the same name, but with .html extension are generated. Those files have the keys replaced by the current data from the database. These are the keys you can use (replace the # with the rank of the site):

%%sitename%#%% - Shows the site name of the trade ranked the #th.
%%domain%#%% - Shows the domain of the trade ranked the #th.
%%in%#%% - Shows the number of incoming hits of the trade ranked the #th.
%%uniques%#%% - Shows the number of uniques of the trade ranked the #th.
%%out%#%% - Shows the number of outgoing hits of the trade ranked the #th.
%%clicks%#%% - Shows the number of clicks of the trade ranked the #th.
%%url%#%% - Shows the url of the trade ranked the #th.
%%extra?%#%% - Shows the ?th extra field of the trade ranked the #th.

If you want to see an example, go to stt-toplist directory, there is a sample template.

Uploading a template
Upload the template with .stt extension to stt-toplist directory.

Regenerating & customizing the toplist
If you want the toplist to work, you have to go to the 'Toplist' section in your admin area. Once you do so, every toplist template from a stt-toplist directory creates a HTML file. Your template should appear in the list of the existing templates. If it doesn't, check whether you uploaded it to stt-toplist directory and whether the stt-toplist directory is CHMOD'ed to 777.

All toplists are sorted by incoming hits and all active trades are shown by default. This is how you can change the sorting: Select the toplist templates you want to edit. Then type in the pattern you want to use for the toplist sorting. Next to the 'Sort by' form, there is a list of keys you can use. You can also use parentheses (), substraction -, addition +, multiplication * and division /. This generates number n for each trade. After you finish typing, select if you want the trades to be sorted ascending (lowest n on the top) or descending (highest n on the top). For example, if you want to sort the trades by quality, do it this way:

SORT BY clicks/out

You can also edit which trades are shown. This is useful when you want to make a niche-specific toplist or if you only want to show trades sending high-quality traffic. Next to the form, there is a list of keys you can use. You can also use parentheses (), substraction -, addition , multiplication * and division /. If you for example want to display only sites in 'matures' category that have at least 120% productivity, do it this way:

category IS (=) matures AND clicks/in IS HIGHER THAN (>) 1.2

Leave all fields blank if you want to display all active trades.

Including the toplist to your site
The toplist can only be included in the page with the .php extension. If your page has other extension, rename it (for example, if its name is index.html, rename it to index.php). To include the toplist to your site, insert this code to the place where you want it to display (replace 'toplistname' with the toplist name :o)):

<? @include './stt-toplist/toplistname.html'; ?>