|
Location of toplist templates All toplist templates should be placed in /ftt/toplist_templates/ directory. They can be with any extension. You can create toplist template with .php or .html or any other extension. By default there are example.html file in this directory with sample toplist template.
Syntax of toplist templates
In template files you can insert special html container <toplist>. Syntax of that container: <toplist type=SORT_TYPE id=ID group=GROUP_NAME>BLA_BLA_BLA</toplist>
where SORT_TYPE can be one of the following: - clicks - sort trades by clicks
- q_clicks - sort trades by qualified clicks
- prod - sort trades by productivity
- q_prod - sort trades by qualified productivity (qualified clicks / raw ins)
- raws - sort trades by raw hits in
- uniques - sort trades by unique hits in
ID - the number of toplist position. For example, id=2 - second position in toplist. It can also be set in format: id=1-10 - that means 1 to 10 toplist positions will be written. GROUP_NAME - name of group or groups (comma separated) for which toplist will be created. Thats optional parameter. BLA_BLA_BLA - some html you want to output with special words that will be replaced with:
- {URL} - url of site
- {TOPLIST_DOMAIN} - site domain
- {TOPLIST_NAME} - name of site
- {TOPLIST_DESCRIPTION} - description of site
- {TOPLIST_BANNER} - url of site banner
- {WEBMASTER_NICK} - nickname of webmaster
- {RAWS} - daily raw hits in from trader
- {UNIQUES} - daily unique hits in from trader
- {CLICKS} - daily clicks from trader
- {Q_CLICKS} - daily qualified clicks from trader
- {PROD} - productivity of trader
- {Q_PROD} - qualified productivity of trader (qualified clicks / raw in)
- {SENT} - how many hits was sent to trader
- {COUNTER} - toplist position number
You can write parameters in any order and you can use brackets just like in other html tag. For example, these templates are equal: <toplist id="1-10" type='clicks' group=movies,teens>TOPLIST_NAME</toplist> <toplist group='teens,movies' id=1-10 type="clicks">TOPLIST_NAME</toplist>
Sounds unusual for you, right? Ok, here are some examples for better understanding:
Usually in trade scripts toplist templates looks about like this: 1. <a href=##URL1##>##DOMAIN1##</a><br> 2. <a href=##URL2##>##DOMAIN2##</a><br> 3. <a href=##URL3##>##DOMAIN3##</a><br> 4. <a href=##URL4##>##DOMAIN4##</a><br> 5. <a href=##URL5##>##DOMAIN5##</a><br>
Now, how that code will be written for FTT: <toplist type=raws id=1>1. <a href={URL}>{TOPLIST_DOMAIN}</a><br></toplist> <toplist type=raws id=2>2. <a href={URL}>{TOPLIST_DOMAIN}</a><br></toplist> <toplist type=raws id=3>3. <a href={URL}>{TOPLIST_DOMAIN}</a><br></toplist> <toplist type=raws id=4>4. <a href={URL}>{TOPLIST_DOMAIN}</a><br></toplist> <toplist type=raws id=5>5. <a href={URL}>{TOPLIST_DOMAIN}</a><br></toplist>
or
<toplist type=raws id=1-5>{COUNTER}. <a href={URL}>{TOPLIST_DOMAIN}</a><br></toplist>
Same result, but more compact.
You can use as many <toplist> containers on your template page as you wish.
There are special condition if you use {TOPLIST_BANNER} in your <toplist> container. In that case only trades with specified toplist banner url will be used. You can set toplist banner url in trade edit page. So, you can make special toplists for trades with toplist banner url specified!
Placing toplists on your main page
When your toplist template page is ready and uploaded in /ftt/toplist_templates directory, you should wait some time (specified on main settings page) or manually click on toplist update link in your admin interface to create new toplist from template. That new toplist file will be placed in /ftt/toplists/ directory with same name as in /ftt/toplist_templates/. Now you can include that file on your main page. Just write <?include("./ftt/toplists/YOUR_FILE.EXT");?> in your index page html. If you want to use SSI write <!--#include virtual="ftt/toplists/YOUR_FILE.EXT" --> instead.
|