Site Templates
Template Editing Interface
Editing the site templates is done through the Templates > Site Templates function in the control panel. That interface will look
something like this:
Search and Replace
-
Available Templates - This section will list all of the available site templates that you can edit. When you first access
the page, only this section will be shown. Click on a template name to load that template for editing.
Code Editor - This is the text input box where you can make modifications to the template code. When you first access this interface, this field will not be visisble. Click on one of the available templates to load that template and make the code editor visible.
Toolbar Functions - Use the toolbar functions to peform the following actions:
Click this icon to bring up the Search and Replace dialog where you can perform a search and replace on many templates at once.
Click this icon to save the currently loaded template
Click this icon to reload the template code for the currently loaded template. This is useful when you do a search and replace which affects the current template you are editing.
Click this icon to access this documentation file
SFTrade allows you to make quick changes to your templates in bulk with the Search and Replace function. When you access the Search and Replace function a dialog will appear that will allow you
to select the templates that you want to perform this action on, the code to search for in the template, and the replacement code to use. Multiple templates can be selected by holding down the shift or ctrl
keys on your keyboard as you click on templates in the selection list. Once you have selected the templates and entered the search and replacement code, press the Apply Changes button to start the task.
Once completed a notification message will be displayed letting you know how many replacements were made.
Templates & Their Variables
All of the site templates will have the following variable set:
$g_config
The software configuration settings
Below you will find a list of all the site templates shipped with the software, a description of when the template is used, and details on the template variables available (if any) on that template.
$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_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
Below you will find a list of all the site templates shipped with the software, a description of when the template is used, and details on the template variables available (if any) on that template.
global-footer.tpl
-
This template is designed to be used with the {template} function, and contains the template code that will be used as the footer for all of the site pages
global-header.tpl
-
This template is designed to be used with the {template} function, and contains the template code that will be used as the header for all of the site pages
register-closed.tpl
-
This template will be displayed when you are not accepting new registrations
register-complete.tpl
-
This template will be displayed when a user completes the registration process
$g_trade - This will contain the trade account data that was submitted $g_trade.domain - Domain name
$g_trade.return_url - Traffic URL
$g_trade.status - Account status
$g_trade.email - E-mail address
$g_trade.nickname - Name/Nickname
$g_trade.icq - ICQ number
$g_trade.site_name - Site name
$g_trade.site_description - Site description
register.tpl
-
This template will be displayed when a wishes to register a new trade account
$g_trade_rules - This will contain the trade rules you have setup in the control panel
$g_trade_rules_array - This will contain the trade rules you have setup in the control panel, broken up into an array with one line per array index
$g_trade_defaults - This will contain the default values assigned to new trades as you have configured in the control panel
style.css
-
This is not actually a template, but can still be edited through the template editor. This is the style sheet that is used for all of the site templates.
trade-stats-disabled.tpl
-
This template will be displayed you have selected to not allow logins to view stats
trade-stats-forgot-confirm.tpl
-
This template will be displayed when a user submits valid information to retrieve their lost password
trade-stats-forgot-confirmed.tpl
-
This template will be displayed when a user clicks on the confirmation link in the e-mail message sent to confirm retrieval of a lost password
$g_trade - This will contain the trade account data
$g_trade.password - This will contain the new password for the trade account
trade-stats-forgot.tpl
-
This template will be displayed when a user clicks the "Lost Password?" link
trade-stats-login.tpl
-
This template will be displayed when a user wishes to login to view their stats
trade-stats.tpl
-
This template display the user's stats after they have logged in
$g_trade - This will contain the trade account data
$g_trade.domain - Domain name
$g_trade.return_url - Traffic URL
$g_trade.status - Account status
$g_trade.email - E-mail address
$g_trade.nickname - Name/Nickname
$g_trade.icq - ICQ number
$g_trade.site_name - Site name
$g_trade.site_description - Site description
$g_stats - This will contain the trade account stats
$g_stats.i_raw_60 - Raw in from the past 60 minutes
$g_stats.o_raw_60 - Raw out from the past 60 minutes
$g_stats.c_raw_60 - Raw clicks from the past 60 minutes
$g_stats.prod_60 - Productivity from the past 60 minutes
$g_stats.i_raw_24 - Raw in from the past 24 hours
$g_stats.o_raw_24 - Raw out from the past 24 hours
$g_stats.c_raw_24 - Raw clicks from the past 24 hours
$g_stats.prod_24 - Productivity from the past 24 hours