Nats fhg (NATS3)

From TMM Wiki
Jump to navigationJump to search
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

nats_fhg

fhg retrieves a listing of your hosted adtools you can use in NATS emails to your affiliates. Only the free hosted adtools available to a particular affiliate are sent to that affiliate.

Alias: fhg

Parameters

(Required parameters in bold)

Parameter Description Possible Values Default Value Example
siteid The site I.D. numbers to get adtools for Any comma separated numeric list, ranges okay None. siteid="123"
not_siteid The site I.D. numbers to not get adtools for any comma separated numeric list, ranges okay None. siteid="321"
url The URL to get adtools for Any partial or complete URL None. url="http://example.com/"
name The name of the adtools to get Any part of the name of the adtool None. name="my_adtool"
added_before The last date to get adtools for Any PHP valid date format None. added_before="August"
added_after The first date to get adtools for Any PHP valid date format None. added_after="January"
group The group of adtools to get A comma separated list, no ranges None. group="123"
not_group = comma separated list, no ranges Group of adtools to not get A comma separated list, no ranges None. group="321"
adid The adtool I.D. numbers to get any comma separated numeric list, ranges okay None. adid="123"
not_adid The adtool I.D. numbers to not get Any comma separated numeric list, ranges okay None. not_adid="321"
type The type of adtool to get Any comma separated numeric list, ranges okay (see notes section below) None. type="3"
not_type = any comma separated numeric list The type of adtool to not get Any comma separated numeric list, ranges okay (see notes section below) None. type="6"
thumb2 Filter by second thumb field. Comma separated list, no ranges None. thumb2="123"
not_thumb2 Filter by second thumb field, excluding matches Comma separated list, no ranges None. not_thumb2="123"
thumb3 Filter by third thumb field. Comma separated list, no ranges None. thumb3="123"
not_thumb3 Filter by third thumb field, excluding matches Comma separated list, no ranges None. not_thumb3="123"
thumb4 Filter by fourth thumb field. Comma separated list, no ranges None. thumb4="123"
not_thumb4 Filter by fourth thumb field, excluding matches Comma separated list, no ranges None. not_thumb4="123"
thumb5 Filter by fifth thumb field. Comma separated list, no ranges None. thumb5="123"
not_thumb5 Filter by fifth thumb field, excluding matches Comma separated list, no ranges None. not_thumb5="123"
desc2 Filter by second description field Comma separated list, no ranges None. desc2="123"
not_desc2 = Filter by second description field, excluding matches Comma separated list, no ranges None. not_desc2="123"
desc3 = filter by third description field. comma separated list, no ranges Filter by third description field Comma separated list, no ranges None. desc3="123"
not_desc3 = exclude by third description field. comma separated list, no ranges Filter by third description field, excluding matches Comma separated list, no ranges None. not_desc3="123"
desc4 = filter by fourth description field. comma separated list, no ranges Filter by fourth description field Comma separated list, no ranges None. desc4="123"
not_desc4 = exclude by fourth description field. comma separated list, no ranges Filter by fourth description field, excluding matches Comma separated list, no ranges None. not_desc4="123"
desc5 = filter by fifth description field. comma separated list, no ranges Filter by fifth description field, excluding matches Comma separated list, no ranges None. desc5="123"
not_desc5 = exclude by fifth description field. comma separated list, no ranges Filter by fifth description field, excluding matches Comma separated list, no ranges None. not_desc5="123"
num Limit by the number of items in the gallery Comma separated list of numeric values, ranges okay None. num="100"
order_by How to order the result A comma separated list of any of the following values: siteid, type, date_added, id, url, num, thumb, name, groups plus ASC or DESC None. order_by="siteid ASC, groups DESC"

Output

{$fhg} -- an array of adtools, each with the following sub-fields:

  • id - the adid of the adtool
  • date_added - the date the adtool was added
  • url - the URL of the FHG itself
  • type - the type number of the hosted adtool
  • num - the number of clips in the gallery
  • thumb - the thumbnail url of the adtool
  • name - the primary name of the adtool
  • groups - the group the adtool belongs in
  • description - an extended description of the adtool
  • byo_owner - the owner's loginid (only applies to BYOA module)
  • byo_program - the program the BYOA adtool belongs to (only applies to BYOA module)
  • byo_owner_only - flag that indicates only the BYOA owner can use this adtool
  • desc2 - a second description of the adtool
  • desc3 - third description of the adtool
  • desc4 - fourth description of the adtool
  • desc5 - fifth description of the adtool
  • thumb2 - a second thumbnail for the adtool
  • thumb3 - a third thumbnail for the adtool
  • thumb4 - a fourth thumbnail for the adtool
  • thumb5 - a fifth thumbnail for the adtool
  • siteid - the site this adtool belongs to

Notes

The following numbers represent the following options to the type parameter:

    • 1 = Gallery (Pics)
    • 2 = Gallery (Movies)
    • 3 = Free Site
    • 4 = Console
    • 5 = GB Template (Pics)
    • 6 = GB Template (Movies)
    • 7 = (reserved for future use)
    • 8 = Gallery (Mixed)

Ranges can be specified in the following formats: "1, 2, 7" or "2-5, 23".

Example

{fhg siteid="2, 4-6, 9-13" added_before="april" added_after="2007-10-14" not_adid="250-344"}

The example above retrieves information about all hosted adtools added before April of this year -- but after 10 October 2007. The output is further restricted to adtools that belong to any of the following sites: 2, 4, 5, 6, 9, 10, 11, 12, or 13. Also, any adtool with an adid between 250-344 will be excluded from the results. If you use the Build Your Anything Module (BYOA), this function also considers whether or not the affiliate is authorized to see that particular adtool.

To get the URL of the fifth adtool retrieved by the function, put {$fhg[4].url} in your template.


Extended Example

This code is tabulated to show the flow of the code; if sending text emails, you'll want to remove the tabulation.

Variables in this example:

  • $program the id of the program you want to be used in affiliate link codes
  • $sitelist a comma-delimited list of each site you want to show fhgs for

For each of the sites chosen, this code will show first picture galleries, then movie galleries. For each gallery, it will show the date it was added, and the url (with the affiliate's nats code attached).

{assign var=program value=1} {*program to use for reseller link codes*}
{assign var=sitelist value="1,2,3,4"}{*sites to show*}

{assign var=sites value=$sitelist|explode:','}
{foreach from=$sites item=site}
	{fhg siteid=$site type="1"} {*site $site, picture galleries*}
	{if $fhg && $fhg|@count}
		Picture Galleries
		{foreach item=gallery from=$fhg}
			{$gallery.date_added} {$gallery.url}?nats={$nats_code[$program][$site]}
		{/foreach}
	{/if}
	{fhg siteid=$site type="2"} {*site $site, movie galleries*}
	{if $fhg && $fhg|@count}
		Movie Galleries
		{foreach item=gallery from=$fhg}
			{$gallery.date_added} {$gallery.url}?nats={$nats_code[$program][$site]}
		{/foreach}
	{/if}
{/foreach}