Nats list campaigns
From TMM Wiki
Jump to navigationJump to searchApplies to NATS 4.0.25 and greater.
nats_list_campaigns
Obtains a list of available campaigns for an affiliate.
Alias: list_campaigns
Parameters
(Required parameters in bold)
Parameter | Description | Possible Values | Default Value | Example |
---|---|---|---|---|
userid | the loginid of the affiliate whose campaigns should be listed. | The I.D. user viewing the page. | Any integer greater than zero | userid=123 |
details | Set to 1 to provide more details about the campaigns in the output. See note below. | 0 or 1 (exclusive) | 0 | details=1 |
show_hidden | Set to 1 to include details about hidden campaigns in the output. | 0 or 1 (exclusive) | 0 | show_hidden=1 |
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
Outputs an array called $campaign. The arguments above determine the array's structure.
If details is not set or are set to "0", $campaign will have one-dimension with the numeric campaignid as the key and the campaign's text description as the value:
Array campaign ( [59] => "Main campaign used by default.", [276] => "My second campaign." )
If details is set to "1", all information about each campaign will be listed in a multi-dimensional array. For example:
Array campaign( [59] => Array( [campaignid] => 59, [loginid] => 45, [name] => "Default", [description] => "Main campaign used by default.", [created_date] => 1209634033, [hide] => 0, [old_campaignid] => 0 ), [276] => Array( [campaignid] => 276, [loginid] => 45, [name] => "Second Campaign", [description] => "John Smith Special Campaign", [created_date] => 1209664102, [hide] => 0, [old_campaignid] => 0 ), )
Notes
None.
See Also
- nats_list_sites -- lists all sites in a particular program.
- nats_list_tours -- lists all sites in a particular program and site.