Toplists - Add a Toplist
Overview
From this dialog you will be able to add toplists. The toplist feature allows you to generate lists that will show your traders sorted by a value that you select. For example, you may want to create a list of your traders that sent you the most unique ins in the past 24 hours. You can then display that list embedded in other pages of your site, such as a TGP or Tube page.
Toplist Settings
When adding or editing a toplist there are several settings you can configure. Those are as follows:
Toplist Template Code
The toplist templates use the same basic syntax as the other SFTrade templates and has the following template variables available:

$g_config
The software configuration settings
$g_config.site_name - Site Name
$g_config.traffic_url - Traffic URL
$g_config.base_url - SFTrade URL
$g_config.cookie_domain - Cookie Domain
$g_config.cookie_path - Cookie Path
$g_config.email_address - E-mail Address
$g_config.email_name - E-mail Name
$g_config.date_format - Date Format
$g_config.time_format - Time Format
$g_config.flag_accept_new_trades - Accepting new trades
$g_config.flag_captcha_register - Use CAPTCHA on registration form
$g_config.flag_allow_login - Allow users to login with a password to view their stats
$g_config.site_name_min - Site name minimum length
$g_config.site_name_max - Site name maximum length
$g_config.site_description_min - Site description minimum length
$g_config.site_description_max - Site description maximum length
$g_config.flag_req_email - E-mail address required
$g_config.flag_req_site_name - Site name required
$g_config.flag_req_site_description - Site description required
$g_config.flag_req_icq - ICQ required
$g_config.flag_req_nickname - Name/Nickname required
$g_config.flag_req_banner - Banner URL required

$g_trades
The trades that are eligible for display in this toplist. You can either iterate through each trade using a {foreach} or you can access each ranked trade by number. To access each ranked trade by number, use square brackets around the rank number. For example, to access the #1 ranked site use [1] as shown below:
$g_trades[1].domain - Domain name
$g_trades[1].return_url - Traffic URL
$g_trades[1].status - Account status
$g_trades[1].email - E-mail address
$g_trades[1].nickname - Name/Nickname
$g_trades[1].icq - ICQ number
$g_trades[1].site_name - Site name
$g_trades[1].site_description - Site description
$g_trades[1].banner - Banner URL
$g_trades[1].i_raw_60 - 60 Minutes - In Raw
$g_trades[1].i_uniq_60 - 60 Minutes - In Unique
$g_trades[1].i_uniq_pct_60 - 60 Minutes - In Unique %
$g_trades[1].i_proxy_60 - 60 Minutes - In Proxy
$g_trades[1].i_ctry_g_60 - 60 Minutes - In Good Country
$g_trades[1].i_ctry_n_60 - 60 Minutes - In Normal Country
$g_trades[1].i_ctry_b_60 - 60 Minutes - In Bad Country
$g_trades[1].i_ctry_g_pct_60 - 60 Minutes - In Good Country %
$g_trades[1].i_ctry_n_pct_60 - 60 Minutes - In Normal Country %
$g_trades[1].i_ctry_b_pct_60 - 60 Minutes - In Bad Country %
$g_trades[1].o_raw_60 - 60 Minutes - Out Raw
$g_trades[1].o_proxy_60 - 60 Minutes - Out Proxy
$g_trades[1].o_ctry_g_60 - 60 Minutes - Out Good Country
$g_trades[1].o_ctry_n_60 - 60 Minutes - Out Normal Country
$g_trades[1].o_ctry_b_60 - 60 Minutes - Out Bad Country
$g_trades[1].o_ctry_g_pct_60 - 60 Minutes - Out Good Country %
$g_trades[1].o_ctry_n_pct_60 - 60 Minutes - Out Normal Country %
$g_trades[1].o_ctry_b_pct_60 - 60 Minutes - Out Bad Country %
$g_trades[1].c_raw_60 - 60 Minutes - Clicks Raw
$g_trades[1].c_proxy_60 - 60 Minutes - Clicks Proxy
$g_trades[1].c_trades_60 - 60 Minutes - Clicks To Trades
$g_trades[1].c_ctry_g_60 - 60 Minutes - Clicks Good Country
$g_trades[1].c_ctry_n_60 - 60 Minutes - Clicks Normal Country
$g_trades[1].c_ctry_b_60 - 60 Minutes - Clicks Bad Country
$g_trades[1].c_ctry_g_pct_60 - 60 Minutes - Clicks Good Country %
$g_trades[1].c_ctry_n_pct_60 - 60 Minutes - Clicks Normal Country %
$g_trades[1].c_ctry_b_pct_60 - 60 Minutes - Clicks Bad Country %
$g_trades[1].prod_60 - 60 Minutes - Productivity
$g_trades[1].t_prod_60 - 60 Minutes - Trade Productivity
$g_trades[1].return_60 - 60 Minutes - Return
$g_trades[1].skim_60 - 60 Minutes - Skim
$g_trades[1].i_raw_24 - 24 Hours - In Raw
$g_trades[1].i_uniq_24 - 24 Hours - In Unique
$g_trades[1].i_uniq_pct_24 - 24 Hours - In Unique %
$g_trades[1].i_proxy_24 - 24 Hours - In Proxy
$g_trades[1].i_ctry_g_24 - 24 Hours - In Good Country
$g_trades[1].i_ctry_n_24 - 24 Hours - In Normal Country
$g_trades[1].i_ctry_b_24 - 24 Hours - In Bad Country
$g_trades[1].i_ctry_g_pct_24 - 24 Hours - In Good Country %
$g_trades[1].i_ctry_n_pct_24 - 24 Hours - In Normal Country %
$g_trades[1].i_ctry_b_pct_24 - 24 Hours - In Bad Country %
$g_trades[1].o_raw_24 - 24 Hours - Out Raw
$g_trades[1].o_proxy_24 - 24 Hours - Out Proxy
$g_trades[1].o_ctry_g_24 - 24 Hours - Out Good Country
$g_trades[1].o_ctry_n_24 - 24 Hours - Out Normal Country
$g_trades[1].o_ctry_b_24 - 24 Hours - Out Bad Country
$g_trades[1].o_ctry_g_pct_24 - 24 Hours - Out Good Country %
$g_trades[1].o_ctry_n_pct_24 - 24 Hours - Out Normal Country %
$g_trades[1].o_ctry_b_pct_24 - 24 Hours - Out Bad Country %
$g_trades[1].c_raw_24 - 24 Hours - Clicks Raw
$g_trades[1].c_proxy_24 - 24 Hours - Clicks Proxy
$g_trades[1].c_trades_24 - 24 Hours - Clicks To Trades
$g_trades[1].c_ctry_g_24 - 24 Hours - Clicks Good Country
$g_trades[1].c_ctry_n_24 - 24 Hours - Clicks Normal Country
$g_trades[1].c_ctry_b_24 - 24 Hours - Clicks Bad Country
$g_trades[1].c_ctry_g_pct_24 - 24 Hours - Clicks Good Country %
$g_trades[1].c_ctry_n_pct_24 - 24 Hours - Clicks Normal Country %
$g_trades[1].c_ctry_b_pct_24 - 24 Hours - Clicks Bad Country %
$g_trades[1].prod_24 - 24 Hours - Productivity
$g_trades[1].t_prod_24 - 24 Hours - Trade Productivity
$g_trades[1].return_24 - 24 Hours - Return
$g_trades[1].skim_24 - 24 Hours - Skim

To access the #2 ranked site replace [1] with [2] and so on...

Thumbnails
If a trade has thumbnails you can access them using this template syntax: <img src="{$g_config.base_url}/th/{$g_trades[1].domain}-1.jpg"> Where the 1 indicates the thumbnail you want to display. For example, if you have setup to grab 3 thumbnails for each trade you can use 1, 2, or 3 to access the different thumbnails: <img src="{$g_config.base_url}/th/{$g_trades[1].domain}-1.jpg"> <img src="{$g_config.base_url}/th/{$g_trades[1].domain}-2.jpg"> <img src="{$g_config.base_url}/th/{$g_trades[1].domain}-3.jpg"> If you would like to have a random thumbnail selected, this template syntax can be used: {assign var=$thumb code=rand(1,$g_trades[1].thumbnails)} <img src="{$g_config.base_url}/th/{$g_trades[1].domain}-{$thumb}.jpg">
Example Templates
Below are a few example toplist templates showing the different ways to access the trades in the $g_trades variable.

Accessing by Rank Number
This example shows how to access trades by their rank number in the $g_trades template variable. A total of 5 trades will be displayed with their domain linked to their return URL setting. This will also show the raw in value from the past 24 hours. <table> <tr> <td> 1. <a href="{$g_config.base_url}/out.php?t={$g_trades[1].domain}" target="_blank">{$g_trades[1].domain}</a> ({$g_trades[1].i_raw_24}) </td> <td> 2. <a href="{$g_config.base_url}/out.php?t={$g_trades[2].domain}" target="_blank">{$g_trades[2].domain}</a> ({$g_trades[2].i_raw_24}) </td> <td> 3. <a href="{$g_config.base_url}/out.php?t={$g_trades[3].domain}" target="_blank">{$g_trades[3].domain}</a> ({$g_trades[3].i_raw_24}) </td> <td> 4. <a href="{$g_config.base_url}/out.php?t={$g_trades[4].domain}" target="_blank">{$g_trades[4].domain}</a> ({$g_trades[4].i_raw_24}) </td> <td> 5. <a href="{$g_config.base_url}/out.php?t={$g_trades[5].domain}" target="_blank">{$g_trades[5].domain}</a> ({$g_trades[5].i_raw_24}) </td> </tr> </table>
Accessing Using {foreach}
This example uses a {foreach} template function to iterate over the trades in the $g_trades template variable. A total of 30 trades will be displayed with their domain linked to their return URL setting. The {foreachdone} triggers an exit from displaying trades, so even if you have more than 30 available only the top 30 will be listed. <table> {foreach var=$trade from=$g_trades counter=$counter} <tr> <td> {$counter}. <a href="{$g_config.base_url}/out.php?t={$trade.domain}" target="_blank">{$trade.domain}</a> ({$trade.i_raw_24}) </td> </tr> {if $counter == 30}{foreachdone}{/if} {/foreach} </table>
Accessing Using {range}
This example uses a {range} template function to iterate over the trades in the $g_trades template variable. A total of 10 trades will be displayed with their domain linked to their return URL setting. This is useful when you want to display trades from a certain starting point to a certain ending point. For this example, the trades ranked 11 through 20 will be displayed. This example also shows how to display an "Add Your Site" link if there are not enough trades to fill the entire table. <table> {range start=11 end=20 counter=$i} {assign var=$trade code=$g_trades[$i]} <tr> <td> {if !empty($trade)} {$i}. <a href="{$g_config.base_url}/out.php?t={$trade.domain}" target="_blank">{$trade.domain}</a> ({$trade.i_raw_24}) {else} {$i}. <a href="{$g_config.base_url}/register.php" target="_blank">Add Your Site</a> {/if} </td> </tr> {/range} </table>