HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

ocPortal Developer's Guide: Banners

» Return to Contents



sources/banners.php

Global_functions_banners.php

Function summary

void init__banners ()
?tempcode banners_script (boolean ret, ?string type, ?string dest, ?string b_type, ?integer internal_only, ?string source)
tempcode nice_get_banner_types (?ID_TEXT it)
tempcode show_banner (ID_TEXT name, SHORT_TEXT title_text, tempcode caption, URLPATH img_url, ID_TEXT source, URLPATH url, ID_TEXT b_type)
tempcode nice_get_banners (?AUTO_LINK it, ?MEMBER only_owned)

void init__banners()

Standard code module initialisation function.

Parameters…

(No return value)


Return to the function index for this class Expand: View the source code to this function

?tempcode banners_script(boolean ret, ?string type, ?string dest, ?string b_type, ?integer internal_only, ?string source)

Show a banner according to GET parameter specification.

Parameters…

Name ret
Description Whether to return a result rather than outputting
Default value boolean-false
Type boolean

Name type
Description Whether we are displaying or click-processing (NULL: get from URL param)
Default value
Type ?string
Values restricted to "click" ""

Name dest
Description Specific banner to display (NULL: get from URL param) (blank: randomise)
Default value
Type ?string

Name b_type
Description Banner type to display (NULL: get from URL param)
Default value
Type ?string

Name internal_only
Description Whether we are only showing our own banners, rather than allowing external rotation ones (NULL: get from URL param)
Default value
Type ?integer

Name source
Description The banner advertisor who is actively displaying the banner (calling up this function) and hence is rewarded (NULL: get from URL param) (blank: our own site)
Default value
Type ?string

Returns…

Description Result (NULL: we weren't asked to return the result)
Type ?tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode nice_get_banner_types(?ID_TEXT it)

Get a nice, formatted XHTML list to select a banner type

Parameters…

Name it
Description The currently selected licence (NULL: none selected)
Default value
Type ?ID_TEXT

Returns…

Description The list of categories
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode show_banner(ID_TEXT name, SHORT_TEXT title_text, tempcode caption, URLPATH img_url, ID_TEXT source, URLPATH url, ID_TEXT b_type)

Get the tempcode for the display of the defined banner.

Parameters…

Name name
Description The name of the banner
Type ID_TEXT

Name title_text
Description The title text of the banner (displayed for a text banner only)
Type SHORT_TEXT

Name caption
Description The caption of the banner
Type tempcode

Name img_url
Description The URL to the banner image
Type URLPATH

Name source
Description The name of the banner for the site that will get the return-hit
Type ID_TEXT

Name url
Description The URL to the banner's target
Type URLPATH

Name b_type
Description The banner type
Type ID_TEXT

Returns…

Description The rendered banner
Type tempcode

Return to the function index for this class Expand: View the source code to this function

tempcode nice_get_banners(?AUTO_LINK it, ?MEMBER only_owned)

Get a list of banners.

Parameters…

Name it
Description The ID of the banner selected by default (NULL: no specific default)
Default value
Type ?AUTO_LINK

Name only_owned
Description Only show banners owned by the member (NULL: no such restriction)
Default value
Type ?MEMBER

Returns…

Description The list
Type tempcode

Return to the function index for this class Expand: View the source code to this function