NATS4 Join Page Variables

From TMM Wiki
Jump to navigationJump to search
NATS 4
Members Admin
The Members Admin
View Member Details
Add Member
MySQL Auth
Mod Authn DB
Multisite Access
Member Logging
Member Password Retrieval
OpenID Connect
Mod Auth OpenIDC
ID Numbers
Skins and Templates Admin
The Skins and Templates Admin
Skins
Templates
Site Templates
Language Skins
Language Files
custom_errors.php
Join Page Variables
Skipping NATS Join Form
Post URL Variables
Member Usernames & Passwords
Form Validation
Username Recommendations
Password Retrieval
Post-Biller Templates
Geo-Target Join Options
Random Usernames and Passwords
Smarty
Smarty print array
Smarty Plugins
Available Smarty Functions
Affiliate Support Template
Adding a Verification Image
Custom Program and Campaign Selection Pages
Output An Affiliate's Last Paid Date
Affiliate Signup Email
Affiliate Join Page Linkcodes
Approval/Upgrade/Denial Variables
Approval/Upgrade/Denial Template Variables
CSS Theme Builder

NATS4 offers a great deal of flexibility and customization to the NATS join form, as well as your link codes. For example, you can customize your join form to display options in different ways, or take the minimum information required by NATS. The following article describes some examples of customizing your join forms and link codes.

Editing Your Join Form

You can customize your NATS join forms by editing its template. To do so, go to the Sites Admin.

In the Sites Admin, locate the site you wish to edit your join forms for, and click the "Edit Site Templates" action icon.

On the Site Templates page, locate your "join" template. Once you have located it, duplicate your template by clicking the "Copy" action icon, marked by two sheets of paper. We recommend that you duplicate your join template so that you can retain your original form if you need to quickly revert to it.

Once you have duplicated your join template, click the "Edit" action icon, marked by a pencil, to begin customizing it.

Radio Buttons

You can choose between using radio buttons or drop-down menus to specify member payment types or membership join options.

To display your available join options as radio buttons instead of a drop-down menu, replace the following code:

<TR><TD class="join_name">Membership:</TD><TD class="join_value">
			<select name="signup[optionid]" class="join_select">
				{html_options options=$join_options selected=$vars.optionid}
			</select>{if $errors.optionid}<span class="join_error"><br>{$errors.optionid}</span>{/if}
		</TD></TR>

with

<TR><TD class="join_name">Membership:</TD><TD class="join_value">
			{*<select name="signup[optionid]" class="join_select">
				{html_options options=$join_options selected=$vars.optionid}
			</select>*}
{html_radios name="signup[optionid]" options=$join_options selected=$vars.optionid separator="<br>"}
{if $errors.optionid}<span class="join_error"><br>{$errors.optionid}</span>{/if}
		</TD></TR>

The join options you have made available to your members should now display as radio buttons.

Minimal Join Forms

NATS4 also allows you to edit your join forms to take the least amount of user information required by NATS-- the join option and cascade. You can also edit the join form to take any amount of information you wish, as long as the join option and cascade are defined.

For example, you can simply remove default code such as the following:

<TR><TD class="join_name">Password:</tD><TD class="join_value">
			<input class="join_input" type="text" name="signup[password:1:6:16:::password_check]" value="{$vars.password}">{if $errors.password}<span class="join_error"><br>{$errors.password}</span>{/if}
		</TD></TR>
<TR><TD class="join_name">E-Mail:</TD><TD class="join_value">
			<input class="join_input" type="text" name="signup[email:1:1:128:::email_check]" value="{$vars.email}">{if $errors.email}<span class="join_error"><br>{$errors.email}</span>{/if}
		</TD></TR>

The above code puts a required Password and E-Mail field in your NATS join form.

If you wish to simply use a minimal join form, remove the code for each field in your template, so the required fields in your join form template should be the following:

<TR><TD class="join_name">Membership:</TD><TD class="join_value">
			{*<select name="signup[optionid]" class="join_select">
				{html_options options=$join_options selected=$vars.optionid}
			</select>*}
{html_radios name="signup[optionid]" options=$join_options selected=$vars.optionid separator="<br>"}
{if $errors.optionid}<span class="join_error"><br>{$errors.optionid}</span>{/if}
		</TD></TR>
		<TR><TD class="join_name">Payment Type:</TD><TD class="join_value">
<select name="cascade">
{html_options options=$payment_options selected=$cascade}
			{*{html_radios name="cascade" options=$payment_options selected=$cascade separator="<br>"}*}
</select>
{if $errors.cascade}<span class="join_error"><br>{$errors.cascade}</span>{/if}
		</TD></TR>

Random Usernames and Passwords on Join Forms

If you want to use a minimal join form, you should set the member's username and password to be automatically generated by NATS. You can do so by inputting the following code:

<input type="hidden" name="signup[random_userpass]" value="10:1:5">
  • The first parameter sets the character length for both the username and password field.
  • The second parameter can be set to either 0 to allow for uppercase, lowercase letters, and numbers, or 1 to allow only lowercase letters and numbers.
  • The third parameter sets the number of attempts to generate the random username and password.
  • The above example would specify a random username and password that are 10 characters long, allowing only lowercase letters and numbers, over 5 attempts.

On older NATS versions, you can only use this if you want both a random username and a random password generated for the member. On NATS versions 4.1.10.1 and above, if either username or password is blank on the join page submit and signup[random_userpass] was used, NATS will generate random values for the field that is blank.

Nostore

If you name your field signup[nostore_XXX:1], NATS will check to make sure that field is entered but will not save it into one of our database fields. This is useful for any field where you want to require the member to fill, such as checkboxes that are required to be checked. A common use of nostore is an "Agree with Terms" checkbox. Checkbox input fields are not submitted unless checked, so if they are not, the verification fails. To get this to work properly, you need to use a trick with having a hidden input field with the same name. In the example below, we have named the field "terms", but you may change the name to whatever you wish.

<input type="hidden" name="signup[nostore_terms:1]" value="">
<input type="checkbox" style="width:25px;" name="signup[nostore_terms:1]" value="1" {if $vars.nostore_terms}checked{/if}>
{if $errors.nostore_terms}<span class="error" style="padding-left:0"> You should agree with Terms </span>{/if}

This coding creates the checkbox and requires it to be checked. {if $vars.nostore_terms}checked{/if} also checks to make sure that the box remains checked if the member reloads the page, etc. The last line, {if $errors.nostore_terms}, throws an error message to the member-- in this case, "You should agree with Terms"-- if the member did not check the box and the verification failed.

Editing Your Join Links

NATS4 also allows for a great deal of customization regarding join form links. You can append various parameters to the end of an affiliate link code in order to skip the NATS join form and automatically define required information through the URL.

Bypassing the NATS Join Form

For example, you can create a join link that bypasses the NATS join form while creating a random username and password for the member, defining their first name, join option, and cascade.

Please note, should this submit fail for any reason, the surfer will be redirected to the NATS prejoin form with an error message. We recommend at a minimum updating your NATS join template to match your external page in the event a submit does fail.

http://demo.nats4.com/signup/signup.php?nats=MC4wLjEuMS4wLjAuMC4wLjA&step=2&signup[random_userpass]=10:1:5&signup[firstname]=Mike&signup[optionid]=4&cascade=3

&signup[random_userpass]=10:1:5 gives the member a random 10 character username that is all lowercase. This also sets NATS to attempt to generate a random username 5 times before failing. For more information on setting the "random_userpass" function, please see our Random Usernames and Passwords wiki article.

&signup[firstname]=Mike&signup[optionid]=4&cascade=3 defines the user's first name as "Mike", sets the join option ID as "4", and the cascade ID as "3".

This function can be useful for putting join links on a Free Hosted Gallery, for example. Instead of having to go through the standard NATS pre-join form, you can automatically direct surfers straight to the biller page.

Affiliate Link Codes

You can perform the above actions for any affiliate link codes. To do so, simply append your desired parameters to the URL after:

http://<linkdomain>/track/<track code>/join

Simply replace "<linkdomain>" in the above example with your site's linkdomain, and "<track code>" with your affiliate's NATS Code. For more information on NATS Codes, please see our Getting The NATSCode wiki article.

One Step Joins

NATS4 also supports one page joins for gateway forms, which combine required information for both NATS and the chosen biller. This allows members to only have to go through one step in order to join.

For more information on this feature, please see our Gateway One Step Join wiki article.

Possible Prejoin Variables

  • cascade - Required cascade ID
  • signup[optionid] - Required join option ID
  • signup[username] - Max 64 characters
  • signup[password] - Max 255 characters
  • signup[email] - Max 128 characters
  • signup[mailok] - Either 1 or 0
  • signup[firstname] - Max 255 characters
  • signup[lastname] - Max 255 characters
  • signup[address1] - Max 128 characters
  • signup[address2] - Max 128 characters
  • signup[zip] - Max 16 characters
  • signup[city] - Max 32 characters
  • signup[country] - 2 letter country ISO
  • signup[state] - Max 32 characters
  • signup[shipping_firstname] - Max 64 characters
  • signup[shipping_lastname] - Max 64 characters
  • signup[shipping_address1] - Max 128 characters
  • signup[shipping_address2] - Max 128 characters
  • signup[shipping_zip] - Max 16 characters
  • signup[shipping_city] - Max 32 characters
  • signup[shipping_country] - 2 letter country ISO
  • signup[shipping_state] - Max 32 characters
  • signup[phone] - Max 16 characters
  • signup[custom1] - Max 255 characters
  • signup[custom2] - Max 255 characters
  • signup[custom3] - Max 255 characters
  • signup[custom4] - Max 255 characters
  • signup[custom5] - Max 255 characters
  • signup[custom6] - Max 255 characters
  • signup[custom7] - Max 255 characters
  • signup[custom8] - Max 255 characters
  • signup[custom9] - Max 255 characters
  • signup[custom10] - Max 255 characters