Difference between revisions of "Get programs"

From TMM Wiki
Jump to navigationJump to search
m
 
(No difference)

Latest revision as of 11:13, 18 December 2008

NATS 3
  Template Functions
nats_apache_note
nats_convert_bytes
nats_decode
nats_encode
nats_fhg
nats_helper_row_fill
nats_get_gateway_token
nats_list_campaigns
nats_list_programs
nats_list_sites
nats_my_decode_entities
nats_my_encode_entities
nats_smarty_function_ajax_box
nats_smarty_function_amount_owed
nats_smarty_function_gateway_xsell
nats_smarty_function_getbonus
nats_smarty_function_get_paid_date
nats_smarty_rebuild_link
nats_smarty_rebuild_query
nats_smarty_function_reseller_ajax_box
nats_tooltip
nats_tour_report
nats_wmref_list
Template Shortcuts
ajax_box
amount_owed
apache_note
convert_bytes
fhg
gateway_xsell
get_loginid_from_campaignid
get_gateway_token
get_paid_date
list_campaigns
list_programs
list_sites
new_gateway_xsell
rebuild_link
rebuild_query
reseller_ajax_box
reward_points
tooltip
tour_report
wmref_list
Common Parameters
assign
assign_prefix
count
data_only
display_on_assign
start
tpl

get_programs

Retrieve programs available for a specified login

  • array get_programs(integer loginid[[[, bool loop=FALSE], bool detailed=FALSE], bool hidden=FALSE])

Retrieves an array of all programs the member with this loginid can access. The loop parameter determines how the array is built; the detailed parameter determines how much info about each program to include; the hidden parameter determines if hidden programs are added or not.

Output

If loop is FALSE, get_programs returns an array in the following form.

{
    programid => "Program Name [Payout]"
    ...
}

If loop is TRUE but detailed is FALSE, get_programs returns an array in the following form.

{
    0 => {
                'id' => programid,
                'name' => "Program Name [Payout]"
             }
    ...
}

If loop is TRUE and detailed is TRUE, get_programs returns an array in the following form.

{
    0 => {
                'id' => programid,
                'name' => "Program Name [Payout]",
                ... all other fields from programs table ...
             }
    ...
}