Function __global->add_banner

Definitions

sources/banners2.php

  • Add a banner to the database, and return the new ID of that banner in the database.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$name ID_TEXT No No required parameter N/A N/A The name of the banner
$imgurl URLPATH No No required parameter N/A N/A The URL to the banner image
$title_text SHORT_TEXT No No required parameter N/A N/A 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 No No required parameter N/A N/A The caption of the banner
$direct_code LONG_TEXT No No required parameter N/A N/A Complete HTML/PHP for the banner
$campaign_remaining ?integer No No required parameter N/A 0 max The number of hits the banner may have (null: not applicable for this banner type)
$site_url URLPATH No No required parameter N/A N/A The URL to the site the banner leads to
$display_likelihood integer No No required parameter N/A 1 max The banner's "Display likelihood"
$notes LONG_TEXT No No required parameter N/A N/A Any notes associated with the banner
$deployment_agreement SHORT_INTEGER No No required parameter 0 1 2 N/A The type of banner (a BANNER_* constant)
$expiry_date ?TIME No No required parameter N/A N/A The banner expiry date (null: never)
$submitter ?MEMBER No No required parameter N/A N/A The banners submitter (null: current member)
$validated BINARY No No 0 N/A N/A Whether the banner has been validated
$b_type ID_TEXT No No Blank (empty string) N/A N/A The banner type (can be anything, where blank means 'normal')
$b_types array No No [] N/A N/A The secondary banner types (empty: no secondary banner types)
$regions array No No [] N/A N/A The regions (empty: not region-limited)
$time ?TIME No No Null N/A N/A The time the banner was added (null: now)
$hits_from integer No No 0 N/A N/A The number of return hits from this banners site
$hits_to integer No No 0 N/A N/A The number of banner hits to this banners site
$views_from integer No No 0 N/A N/A The number of return views from this banners site
$views_to integer No No 0 N/A N/A The number of banner views to this banners site
$edit_date ?TIME No No Null N/A N/A The banner edit date (null: never)
$uniqify boolean No No False N/A N/A Whether to force the name as unique, if there's a conflict

Returns

  • The name
  • Type: ID_TEXT
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Add a banner to the database, and return the new ID of that banner in the database.
 *
 * @param  ID_TEXT $name The name of the banner
 * @param  URLPATH $imgurl The URL to the banner image
 * @param  SHORT_TEXT $title_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)
 * @param  SHORT_TEXT $caption The caption of the banner
 * @param  LONG_TEXT $direct_code Complete HTML/PHP for the banner
 * @param  ?integer $campaign_remaining The number of hits the banner may have (null: not applicable for this banner type)
 * @range 0 max
 * @param  URLPATH $site_url The URL to the site the banner leads to
 * @param  integer $display_likelihood The banner's "Display likelihood"
 * @range 1 max
 * @param  LONG_TEXT $notes Any notes associated with the banner
 * @param  SHORT_INTEGER $deployment_agreement The type of banner (a BANNER_* constant)
 * @set 0 1 2
 * @param  ?TIME $expiry_date The banner expiry date (null: never)
 * @param  ?MEMBER $submitter The banners submitter (null: current member)
 * @param  BINARY $validated Whether the banner has been validated
 * @param  ID_TEXT $b_type The banner type (can be anything, where blank means 'normal')
 * @param  array $b_types The secondary banner types (empty: no secondary banner types)
 * @param  array $regions The regions (empty: not region-limited)
 * @param  ?TIME $time The time the banner was added (null: now)
 * @param  integer $hits_from The number of return hits from this banners site
 * @param  integer $hits_to The number of banner hits to this banners site
 * @param  integer $views_from The number of return views from this banners site
 * @param  integer $views_to The number of banner views to this banners site
 * @param  ?TIME $edit_date The banner edit date (null: never)
 * @param  boolean $uniqify Whether to force the name as unique, if there's a conflict
 * @return ID_TEXT The name
 */

function add_banner(string $name, string $imgurl, string $title_text, string $caption, string $direct_code, ?int $campaign_remaining, string $site_url, int $display_likelihood, string $notes, int $deployment_agreement, ?int $expiry_date, ?int $submitter, int $validated = 0, string $b_type = '', array $b_types = [], array $regions = [], ?int $time = null, int $hits_from = 0, int $hits_to = 0, int $views_from = 0, int $views_to = 0, ?int $edit_date = null, bool $uniqify = false) : string