Functions

Add a banner to the database, and return the new ID of that banner in the database.

add_banner(\ID_TEXT $name, \URLPATH $imgurl, \SHORT_TEXT $title_text, \SHORT_TEXT $caption, \LONG_TEXT $direct_code, \?integer $campaignremaining, \URLPATH $site_url, integer $importancemodulus, \LONG_TEXT $notes, \SHORT_INTEGER $the_type, \?TIME $expiry_date, \?MEMBER $submitter, \BINARY $validated, \ID_TEXT $b_type, \?TIME $time, integer $hits_from, integer $hits_to, integer $views_from, integer $views_to, \?TIME $edit_date) 

range 0 max
range 1 max
set 0 1 2

Parameters

$name

\ID_TEXT

The name of the banner

$imgurl

\URLPATH

The URL to the banner image

$title_text

\SHORT_TEXT

The title text for the banner (only used for text banners, and functions as the 'trigger text' if the banner type is shown inline)

$caption

\SHORT_TEXT

The caption of the banner

$direct_code

\LONG_TEXT

Complete HTML/PHP for the banner

$campaignremaining

\?integer

The number of hits the banner may have (NULL: not applicable for this banner type)

$site_url

\URLPATH

The URL to the site the banner leads to

$importancemodulus

integer

The banners "importance modulus"

$notes

\LONG_TEXT

Any notes associated with the banner

$the_type

\SHORT_INTEGER

The type of banner (0=permanent, 1=campaign, 2=default)

$expiry_date

\?TIME

The banner expiry date (NULL: never)

$submitter

\?MEMBER

The banners submitter (NULL: current member)

$validated

\BINARY

Whether the banner has been validated

$b_type

\ID_TEXT

The banner type (can be anything, where blank means 'normal')

$time

\?TIME

The time the banner was added (NULL: now)

$hits_from

integer

The number of return hits from this banners site

$hits_to

integer

The number of banner hits to this banners site

$views_from

integer

The number of return views from this banners site

$views_to

integer

The number of banner views to this banners site

$edit_date

\?TIME

The banner edit date (NULL: never)

Add a banner type.

add_banner_type(\ID_TEXT $id, \BINARY $is_textual, integer $image_width, integer $image_height, integer $max_file_size, \BINARY $comcode_inline) 

Parameters

$id

\ID_TEXT

The ID of the banner type

$is_textual

\BINARY

Whether this is a textual banner

$image_width

integer

The image width (ignored for textual banners)

$image_height

integer

The image height (ignored for textual banners)

$max_file_size

integer

The maximum file size for the banners (this is a string length for textual banners)

$comcode_inline

\BINARY

Whether the banner will be automatically shown via Comcode hot-text (this can only happen if banners of the title are given title-text)

Show a banner according to GET parameter specification.

banners_script(boolean $ret, \?string $type, \?string $dest, \?string $b_type, \?string $source) : \?tempcode

set "click" ""

Parameters

$ret

boolean

Whether to return a result rather than outputting

$type

\?string

Whether we are displaying or click-processing (NULL: get from URL param)

$dest

\?string

Specific banner to display (NULL: get from URL param) (blank: randomise)

$b_type

\?string

Banner type to display (NULL: get from URL param)

$source

\?string

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)

Returns

\?tempcodeResult (NULL: we weren't asked to return the result)

Check the uploaded banner is valid.

check_banner(\SHORT_TEXT $title_text, \LONG_TEXT $direct_code, \ID_TEXT $b_type, string $url_param_name, string $file_param_name) : array

Parameters

$title_text

\SHORT_TEXT

The title text for the banner (only used for text banners, and functions as the 'trigger text' if the banner type is shown inline)

$direct_code

\LONG_TEXT

Complete HTML/PHP for the banner

$b_type

\ID_TEXT

The banner type (can be anything, where blank means 'normal')

$url_param_name

string

Param name for possible URL field

$file_param_name

string

Param name for possible upload field

Returns

arrayA pair: The URL, and the title text

Delete a banner.

delete_banner(\ID_TEXT $name) 

Parameters

$name

\ID_TEXT

The name of the banner

Delete a banner type.

delete_banner_type(\ID_TEXT $id) 

Parameters

$id

\ID_TEXT

The ID of the banner type

Edit a banner.

edit_banner(\ID_TEXT $old_name, \ID_TEXT $name, \URLPATH $imgurl, \SHORT_TEXT $title_text, \SHORT_TEXT $caption, \LONG_TEXT $direct_code, \?integer $campaignremaining, \URLPATH $site_url, integer $importancemodulus, \LONG_TEXT $notes, \SHORT_INTEGER $the_type, \?TIME $expiry_date, \MEMBER $submitter, \BINARY $validated, \ID_TEXT $b_type) 

range 0 max
range 1 max
set 0 1 2

Parameters

$old_name

\ID_TEXT

The current name of the banner

$name

\ID_TEXT

The new name of the banner

$imgurl

\URLPATH

The URL to the banner image

$title_text

\SHORT_TEXT

The title text for the banner (only used for text banners, and functions as the 'trigger text' if the banner type is shown inline)

$caption

\SHORT_TEXT

The caption of the banner

$direct_code

\LONG_TEXT

Complete HTML/PHP for the banner

$campaignremaining

\?integer

The number of hits the banner may have (NULL: not applicable for this banner type)

$site_url

\URLPATH

The URL to the site the banner leads to

$importancemodulus

integer

The banners "importance modulus"

$notes

\LONG_TEXT

Any notes associated with the banner

$the_type

\SHORT_INTEGER

The type of banner (0=permanent, 1=campaign, 2=default)

$expiry_date

\?TIME

The banner expiry date (NULL: never)

$submitter

\MEMBER

The banners submitter

$validated

\BINARY

Whether the banner has been validated

$b_type

\ID_TEXT

The banner type (can be anything, where blank means 'normal')

Edit a banner type.

edit_banner_type(\ID_TEXT $old_id, \ID_TEXT $id, \BINARY $is_textual, integer $image_width, integer $image_height, integer $max_file_size, \BINARY $comcode_inline) 

Parameters

$old_id

\ID_TEXT

The original ID of the banner type

$id

\ID_TEXT

The ID of the banner type

$is_textual

\BINARY

Whether this is a textual banner

$image_width

integer

The image width (ignored for textual banners)

$image_height

integer

The image height (ignored for textual banners)

$max_file_size

integer

The maximum file size for the banners (this is a string length for textual banners)

$comcode_inline

\BINARY

Whether the banner will be automatically shown via Comcode hot-text (this can only happen if banners of the title are given title-text)

Get the tempcode for the form to add a banner, with the information passed along to it via the parameters already added in.

get_banner_form_fields(boolean $simplified, \ID_TEXT $name, \URLPATH $image_url, \URLPATH $site_url, \SHORT_TEXT $caption, \LONG_TEXT $direct_code, \LONG_TEXT $notes, integer $importancemodulus, \?integer $campaignremaining, \SHORT_INTEGER $the_type, \?TIME $expiry_date, \?MEMBER $submitter, \BINARY $validated, \ID_TEXT $b_type, \SHORT_TEXT $title_text) : array

range 1 max
range 0 max
set 0 1 2

Parameters

$simplified

boolean

Whether to simplify the banner interface (for the Point Store buy process)

$name

\ID_TEXT

The name of the banner

$image_url

\URLPATH

The URL to the banner image

$site_url

\URLPATH

The URL to the site the banner leads to

$caption

\SHORT_TEXT

The caption of the banner

$direct_code

\LONG_TEXT

Complete HTML/PHP for the banner

$notes

\LONG_TEXT

Any notes associated with the banner

$importancemodulus

integer

The banners "importance modulus"

$campaignremaining

\?integer

The number of hits the banner may have (NULL: not applicable for this banner type)

$the_type

\SHORT_INTEGER

The type of banner (0=permanent, 1=campaign, 2=default)

$expiry_date

\?TIME

The banner expiry date (NULL: never expires)

$submitter

\?MEMBER

The banners submitter (NULL: current member)

$validated

\BINARY

Whether the banner has been validated

$b_type

\ID_TEXT

The banner type (can be anything, where blank means 'normal')

$title_text

\SHORT_TEXT

The title text for the banner (only used for text banners, and functions as the 'trigger text' if the banner type is shown inline)

Returns

arrayA pair: The input field tempcode, Javascript code

Standard code module initialisation function.

init__banners() 

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

nice_get_banner_types(\?ID_TEXT $it) : \tempcode

Parameters

$it

\?ID_TEXT

The currently selected licence (NULL: none selected)

Returns

\tempcodeThe list of categories

Get a list of banners.

nice_get_banners(\?AUTO_LINK $it, \?MEMBER $only_owned) : \tempcode

Parameters

$it

\?AUTO_LINK

The ID of the banner selected by default (NULL: no specific default)

$only_owned

\?MEMBER

Only show banners owned by the member (NULL: no such restriction)

Returns

\tempcodeThe list

Get the tempcode for the display of the defined banner.

show_banner(\ID_TEXT $name, \SHORT_TEXT $title_text, \tempcode $caption, \LONG_TEXT $direct_code, \URLPATH $img_url, \ID_TEXT $source, \URLPATH $url, \ID_TEXT $b_type, \MEMBER $submitter) : \tempcode

Parameters

$name

\ID_TEXT

The name of the banner

$title_text

\SHORT_TEXT

The title text of the banner (displayed for a text banner only)

$caption

\tempcode

The caption of the banner

$direct_code

\LONG_TEXT

The full HTML/PHP for the banner

$img_url

\URLPATH

The URL to the banner image

$source

\ID_TEXT

The name of the banner for the site that will get the return-hit

$url

\URLPATH

The URL to the banner's target

$b_type

\ID_TEXT

The banner type

$submitter

\MEMBER

The submitting user

Returns

\tempcodeThe rendered banner

Constants