Function __global->add_image
Definitions
sources/galleries2.php
- Add an image to a specified gallery.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: int
Parameters
Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
---|---|---|---|---|---|---|---|
$title | mixed | No | No | required parameter | N/A | N/A | Image title (either language string map or string) |
$cat | ID_TEXT | No | No | required parameter | N/A | N/A | The gallery name |
$description | mixed | No | No | required parameter | N/A | N/A | The image description (either language string map or string) |
$url | URLPATH | No | No | required parameter | N/A | N/A | The URL to the actual image |
$validated | BINARY | No | No | required parameter | N/A | N/A | Whether the image has been validated for display on the site |
$allow_rating | BINARY | No | No | required parameter | N/A | N/A | Whether the image may be rated |
$allow_comments | SHORT_INTEGER | No | No | required parameter | N/A | N/A | Whether the image may be commented upon |
$allow_trackbacks | BINARY | No | No | required parameter | N/A | N/A | Whether the image may be trackbacked |
$notes | LONG_TEXT | No | No | required parameter | N/A | N/A | Hidden notes associated with the image |
$submitter | ?MEMBER | No | No | Null | N/A | N/A | The submitter (null: current member) |
$add_date | ?TIME | No | No | Null | N/A | N/A | The time of adding (null: now) |
$edit_date | ?TIME | No | No | Null | N/A | N/A | The time of editing (null: never) |
$views | integer | No | No | 0 | N/A | N/A | The number of views |
$id | ?AUTO_LINK | No | No | Null | N/A | N/A | Force an ID (null: don't force an ID) |
$meta_keywords | ?SHORT_TEXT | No | No | Blank (empty string) | N/A | N/A | Meta keywords for this resource (null: do not edit) (blank: implicit) |
$meta_description | ?LONG_TEXT | No | No | Blank (empty string) | N/A | N/A | Meta description for this resource (null: do not edit) (blank: implicit) |
$regions | array | No | No | [] | N/A | N/A | The regions (empty: not region-limited) |
$watermark | boolean | No | No | True | N/A | N/A | Whether to apply watermarks to this image |
Returns
- The ID of the new entry
- Type: AUTO_LINK
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Add an image to a specified gallery.
*
* @param mixed $title Image title (either language string map or string)
* @param ID_TEXT $cat The gallery name
* @param mixed $description The image description (either language string map or string)
* @param URLPATH $url The URL to the actual image
* @param BINARY $validated Whether the image has been validated for display on the site
* @param BINARY $allow_rating Whether the image may be rated
* @param SHORT_INTEGER $allow_comments Whether the image may be commented upon
* @param BINARY $allow_trackbacks Whether the image may be trackbacked
* @param LONG_TEXT $notes Hidden notes associated with the image
* @param ?MEMBER $submitter The submitter (null: current member)
* @param ?TIME $add_date The time of adding (null: now)
* @param ?TIME $edit_date The time of editing (null: never)
* @param integer $views The number of views
* @param ?AUTO_LINK $id Force an ID (null: don't force an ID)
* @param ?SHORT_TEXT $meta_keywords Meta keywords for this resource (null: do not edit) (blank: implicit)
* @param ?LONG_TEXT $meta_description Meta description for this resource (null: do not edit) (blank: implicit)
* @param array $regions The regions (empty: not region-limited)
* @param boolean $watermark Whether to apply watermarks to this image
* @return AUTO_LINK The ID of the new entry
*/
function add_image($title, string $cat, $description, string $url, int $validated, int $allow_rating, int $allow_comments, int $allow_trackbacks, string $notes, ?int $submitter = null, ?int $add_date = null, ?int $edit_date = null, int $views = 0, ?int $id = null, ?string $meta_keywords = '', ?string $meta_description = '', array $regions = [], bool $watermark = true) : int
* Add an image to a specified gallery.
*
* @param mixed $title Image title (either language string map or string)
* @param ID_TEXT $cat The gallery name
* @param mixed $description The image description (either language string map or string)
* @param URLPATH $url The URL to the actual image
* @param BINARY $validated Whether the image has been validated for display on the site
* @param BINARY $allow_rating Whether the image may be rated
* @param SHORT_INTEGER $allow_comments Whether the image may be commented upon
* @param BINARY $allow_trackbacks Whether the image may be trackbacked
* @param LONG_TEXT $notes Hidden notes associated with the image
* @param ?MEMBER $submitter The submitter (null: current member)
* @param ?TIME $add_date The time of adding (null: now)
* @param ?TIME $edit_date The time of editing (null: never)
* @param integer $views The number of views
* @param ?AUTO_LINK $id Force an ID (null: don't force an ID)
* @param ?SHORT_TEXT $meta_keywords Meta keywords for this resource (null: do not edit) (blank: implicit)
* @param ?LONG_TEXT $meta_description Meta description for this resource (null: do not edit) (blank: implicit)
* @param array $regions The regions (empty: not region-limited)
* @param boolean $watermark Whether to apply watermarks to this image
* @return AUTO_LINK The ID of the new entry
*/
function add_image($title, string $cat, $description, string $url, int $validated, int $allow_rating, int $allow_comments, int $allow_trackbacks, string $notes, ?int $submitter = null, ?int $add_date = null, ?int $edit_date = null, int $views = 0, ?int $id = null, ?string $meta_keywords = '', ?string $meta_description = '', array $regions = [], bool $watermark = true) : int