Difference between revisions of "Nats decode"
From TMM Wiki
Jump to navigationJump to searchm |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 21: | Line 21: | ||
| '''Any valid linkcode for this NATS installation.''' | | '''Any valid linkcode for this NATS installation.''' | ||
| '''None. This parameter is required | | '''None. This parameter is required | ||
− | | '''<nowiki>nats=" | + | | '''<nowiki>nats="OC4xLjEuMS4wLjAuMC4w"</nowiki>''' |
|- | |- | ||
| assign | | assign | ||
Line 37: | Line 37: | ||
== Output == | == Output == | ||
− | Output is stored in an array with the same structure as the parameters in [[nats_encode]]. | + | Output is stored in an array with the same structure as the parameters in [[nats_encode]]. The data here is stored within the ''$decoded'' array, and contains the following information: |
+ | |||
+ | <pre> | ||
+ | loginid => "2" | ||
+ | programid => "18" | ||
+ | siteid => "3" | ||
+ | tourid => "7" | ||
+ | campaignid => "0" | ||
+ | adtoolid => "0" | ||
+ | subid1 => "0" | ||
+ | subid2 => "0" | ||
+ | promotionalid => "0" | ||
+ | is_unencoded => 0 | ||
+ | networkid => 0 | ||
+ | old_code => 0 | ||
+ | inhouse => "0" | ||
+ | </pre> | ||
+ | |||
+ | The values displayed for each variable in the example above are sample values, which will be replaced with the actual values found in your ''$decoded'' array. | ||
+ | |||
+ | The ''old_code'' variable provided here lets you know whether the code in question was generated in [[NATS3]] or [[NATS4]]. If the code was generated in [[NATS3]], it will be displayed as ''old_code=1'', and code generated in [[NATS4]] will be displayed as ''old_code=0'' | ||
== Notes == | == Notes == | ||
Line 44: | Line 64: | ||
== See Also == | == See Also == | ||
* [[nats_encode]] -- make a NATS linkcode. | * [[nats_encode]] -- make a NATS linkcode. | ||
+ | |||
+ | [[Category:NATS4 Template Functions]] |
Latest revision as of 08:58, 18 November 2021
Applies to NATS 4.0.25 and greater.
nats_decode
Decodes a linkcode into a Smarty array.
Parameters
(Required parameters in bold)
Parameter | Description | Possible Values | Default Value | Example |
---|---|---|---|---|
nats | The linkcode to be decoded. | Any valid linkcode for this NATS installation. | None. This parameter is required | nats="OC4xLjEuMS4wLjAuMC4w" |
assign | Array name to store the decoded linkcode. | Any valid Smarty array name | decoded | assign="myarray" |
assign_prefix | Prefix output variables with this word. (Click link for details) | Any valid Smarty variable name | None. (No prefix is used) | assign_prefix="myvar" |
Output
Output is stored in an array with the same structure as the parameters in nats_encode. The data here is stored within the $decoded array, and contains the following information:
loginid => "2" programid => "18" siteid => "3" tourid => "7" campaignid => "0" adtoolid => "0" subid1 => "0" subid2 => "0" promotionalid => "0" is_unencoded => 0 networkid => 0 old_code => 0 inhouse => "0"
The values displayed for each variable in the example above are sample values, which will be replaced with the actual values found in your $decoded array.
The old_code variable provided here lets you know whether the code in question was generated in NATS3 or NATS4. If the code was generated in NATS3, it will be displayed as old_code=1, and code generated in NATS4 will be displayed as old_code=0
Notes
None.
See Also
- nats_encode -- make a NATS linkcode.