Function __global->add_gallery
Definitions
sources/galleries2.php
- Add a gallery with the specified parameters.
- 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 gallery codename |
$fullname | SHORT_TEXT | No | No | required parameter | N/A | N/A | The full human-readable name of the gallery |
$description | LONG_TEXT | No | No | required parameter | N/A | N/A | The description of the gallery |
$notes | LONG_TEXT | No | No | required parameter | N/A | N/A | Hidden notes associated with the gallery |
$parent_id | ID_TEXT | No | No | required parameter | N/A | N/A | The parent gallery (blank: no parent) |
$accept_images | BINARY | No | No | 1 | N/A | N/A | Whether images may be put in this gallery |
$accept_videos | BINARY | No | No | 1 | N/A | N/A | Whether videos may be put in this gallery |
$is_member_synched | BINARY | No | No | 0 | N/A | N/A | Whether the gallery serves as a container for automatically created member galleries |
$layout_mode | ?ID_TEXT | No | No | Null | N/A | N/A | The layout mode this gallery uses (null: use default mode) |
$rep_image | URLPATH | No | No | Blank (empty string) | N/A | N/A | The representative image of the gallery (blank: none) |
$watermark_top_left | URLPATH | No | No | Blank (empty string) | N/A | N/A | Watermark (blank: none) |
$watermark_top_right | URLPATH | No | No | Blank (empty string) | N/A | N/A | Watermark (blank: none) |
$watermark_bottom_left | URLPATH | No | No | Blank (empty string) | N/A | N/A | Watermark (blank: none) |
$watermark_bottom_right | URLPATH | No | No | Blank (empty string) | N/A | N/A | Watermark (blank: none) |
$gallery_sort | SHORT_TEXT | No | No | Blank (empty string) | N/A | N/A | The sub-gallery sort order (blank: site default) |
$media_sort | SHORT_TEXT | No | No | Blank (empty string) | N/A | N/A | The sort order of media in the gallery (blank: site default) |
$allow_rating | BINARY | No | No | 0 | N/A | N/A | Whether rating are allowed |
$allow_comments | SHORT_INTEGER | No | No | 0 | N/A | N/A | Whether comments are allowed |
$skip_exists_check | boolean | No | No | False | N/A | N/A | Whether to skip the check for whether the gallery exists (useful for importers) |
$add_date | ?TIME | No | No | Null | N/A | N/A | The add time (null: now) |
$g_owner | ?MEMBER | No | No | Null | N/A | N/A | The gallery owner (null: nobody) |
$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) |
$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 gallery with the specified parameters.
*
* @param ID_TEXT $name The gallery codename
* @param SHORT_TEXT $fullname The full human-readable name of the gallery
* @param LONG_TEXT $description The description of the gallery
* @param LONG_TEXT $notes Hidden notes associated with the gallery
* @param ID_TEXT $parent_id The parent gallery (blank: no parent)
* @param BINARY $accept_images Whether images may be put in this gallery
* @param BINARY $accept_videos Whether videos may be put in this gallery
* @param BINARY $is_member_synched Whether the gallery serves as a container for automatically created member galleries
* @param ?ID_TEXT $layout_mode The layout mode this gallery uses (null: use default mode)
* @param URLPATH $rep_image The representative image of the gallery (blank: none)
* @param URLPATH $watermark_top_left Watermark (blank: none)
* @param URLPATH $watermark_top_right Watermark (blank: none)
* @param URLPATH $watermark_bottom_left Watermark (blank: none)
* @param URLPATH $watermark_bottom_right Watermark (blank: none)
* @param SHORT_TEXT $gallery_sort The sub-gallery sort order (blank: site default)
* @param SHORT_TEXT $media_sort The sort order of media in the gallery (blank: site default)
* @param BINARY $allow_rating Whether rating are allowed
* @param SHORT_INTEGER $allow_comments Whether comments are allowed
* @param boolean $skip_exists_check Whether to skip the check for whether the gallery exists (useful for importers)
* @param ?TIME $add_date The add time (null: now)
* @param ?MEMBER $g_owner The gallery owner (null: nobody)
* @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 boolean $uniqify Whether to force the name as unique, if there's a conflict
* @return ID_TEXT The name
*/
function add_gallery(string $name, string $fullname, string $description, string $notes, string $parent_id, int $accept_images = 1, int $accept_videos = 1, int $is_member_synched = 0, ?string $layout_mode = null, string $rep_image = '', string $watermark_top_left = '', string $watermark_top_right = '', string $watermark_bottom_left = '', string $watermark_bottom_right = '', string $gallery_sort = '', string $media_sort = '', int $allow_rating = 0, int $allow_comments = 0, bool $skip_exists_check = false, ?int $add_date = null, ?int $g_owner = null, ?string $meta_keywords = '', ?string $meta_description = '', bool $uniqify = false) : string
* Add a gallery with the specified parameters.
*
* @param ID_TEXT $name The gallery codename
* @param SHORT_TEXT $fullname The full human-readable name of the gallery
* @param LONG_TEXT $description The description of the gallery
* @param LONG_TEXT $notes Hidden notes associated with the gallery
* @param ID_TEXT $parent_id The parent gallery (blank: no parent)
* @param BINARY $accept_images Whether images may be put in this gallery
* @param BINARY $accept_videos Whether videos may be put in this gallery
* @param BINARY $is_member_synched Whether the gallery serves as a container for automatically created member galleries
* @param ?ID_TEXT $layout_mode The layout mode this gallery uses (null: use default mode)
* @param URLPATH $rep_image The representative image of the gallery (blank: none)
* @param URLPATH $watermark_top_left Watermark (blank: none)
* @param URLPATH $watermark_top_right Watermark (blank: none)
* @param URLPATH $watermark_bottom_left Watermark (blank: none)
* @param URLPATH $watermark_bottom_right Watermark (blank: none)
* @param SHORT_TEXT $gallery_sort The sub-gallery sort order (blank: site default)
* @param SHORT_TEXT $media_sort The sort order of media in the gallery (blank: site default)
* @param BINARY $allow_rating Whether rating are allowed
* @param SHORT_INTEGER $allow_comments Whether comments are allowed
* @param boolean $skip_exists_check Whether to skip the check for whether the gallery exists (useful for importers)
* @param ?TIME $add_date The add time (null: now)
* @param ?MEMBER $g_owner The gallery owner (null: nobody)
* @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 boolean $uniqify Whether to force the name as unique, if there's a conflict
* @return ID_TEXT The name
*/
function add_gallery(string $name, string $fullname, string $description, string $notes, string $parent_id, int $accept_images = 1, int $accept_videos = 1, int $is_member_synched = 0, ?string $layout_mode = null, string $rep_image = '', string $watermark_top_left = '', string $watermark_top_right = '', string $watermark_bottom_left = '', string $watermark_bottom_right = '', string $gallery_sort = '', string $media_sort = '', int $allow_rating = 0, int $allow_comments = 0, bool $skip_exists_check = false, ?int $add_date = null, ?int $g_owner = null, ?string $meta_keywords = '', ?string $meta_description = '', bool $uniqify = false) : string