NATS3 Custom Program and Campaign Selection Pages

From TMM Wiki
Skins & Templates Admin
Smarty Plugins
Editing Skins
Creating Skins
Switching Skins
Affiliate Stats Template
Affiliate Support Template
Affiliate Login Template
custom errors.php
Template Array Variable
Detailed Stats
NATS Variables
Dialer Statistics
Affiliate Signup
Post URL Variables
Member Usernames & Passwords
Output An Affiliate's Last Paid Date
Custom Program and Campaign Selection Pages
Username Recommendations
Password Retrieval
Post-Biller Templates
Geo-Target Join Options
Template Caching
Random Usernames and Passwords
Base Templates
Protecting Template Data
Mail Reseller Signup Template Variable Names
Smarty print array
News Section Templating
Affiliate Signup Email
Getting The NATSCode
Checking for Usernames on All Sites
Adding Stats to Affiliate Pages
Affiliate Join Page Linkcodes

New pages in NATS can let affiliates select a program, campaign and site and provide the corresponding NATS link code. They will act similar to the the adtools page or linkcodes page. Use the following template functions to configure the pages.


Returns a set of campaigns in the {$campaigns} variable that you can use to build a drop down box. For example:

<select name="campaignid">{html_options options=$campaigns}</select>


Return a set of programs for the affiliate in into the {$programs} variable that you can use to build a drop down box. For example:

<select name="programid">{html_options options=$programs}</select>

{list_sites program=$smarty.request.programid}

Requires the numeric ID number of a program be passed to the program parameter. Returns the variable, {$sites}, with a set of sites in that program. You can loop through sites with the following example code.

{foreach from=$sites item="site"}
{$} :: {$}

{nats_encode campaignid=$smarty.request.campaignid programid=$smarty.request.programid siteid=$}

Requires three parameters: campaignid, programid and siteid. Returns the encoded NATS link code in the {$encoded} variable.


A sample template using all three template functions:

<form method="get" action="internal.php">
<input type="hidden" name="page" value="thispage">
Select Campaign: <select name="campaignid">{html_options options=$campaigns}</select> <input type="submit" value=" Go ">
{if $smarty.request.campaignid}
<form method="get" action="internal.php">
<input type="hidden" name="page" value="thispage">
<input type="hidden" name="campaignid" value="{$smarty.request.campaignid}">
Select Programid: <select name="programid">{html_options options=$programs}</select> <input type="submit" value=" Go ">
{if $smarty.request.programid}
{list_sites program=$smarty.request.programid}
{foreach from=$sites item="site"}
{nats_encode programid=$smarty.request.programid siteid=$ campaignid=$smarty.request.campaignid}
{$} :: {$} :: {$encoded}

The NATS linkcode code is inside the {foreach} ... {/foreach} loop; change the code to display the linkcode however you'd like.