Function __global->add_calendar_event
Definitions
sources/calendar2.php
- Add a calendar event.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: int
Parameters
Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
---|---|---|---|---|---|---|---|
$type | AUTO_LINK | No | No | required parameter | N/A | N/A | The event type |
$recurrence | SHORT_TEXT | No | No | required parameter | N/A | N/A | The recurrence code (set to 'none' for no recurrences) |
$recurrences | ?integer | No | No | required parameter | N/A | N/A | The number of recurrences (null: none/infinite) |
$seg_recurrences | BINARY | No | No | required parameter | N/A | N/A | Whether to segregate the comment-topics/rating/trackbacks per-recurrence |
$title | SHORT_TEXT | No | No | required parameter | N/A | N/A | The title of the event |
$content | LONG_TEXT | No | No | required parameter | N/A | N/A | The full text describing the event |
$priority | integer | No | No | required parameter | N/A | 1 5 | The priority |
$start_year | integer | No | No | required parameter | N/A | N/A | The year the event starts at |
$start_month | integer | No | No | required parameter | N/A | N/A | The month the event starts at |
$start_day | integer | No | No | required parameter | N/A | N/A | The day the event starts at |
$start_monthly_spec_type | ID_TEXT | No | No | required parameter | day_of_month day_of_month_backwards dow_of_month dow_of_month_backwards | N/A | In-month specification type for start date |
$start_hour | ?integer | No | No | required parameter | N/A | N/A | The hour the event starts at (null: all day) |
$start_minute | ?integer | No | No | required parameter | N/A | N/A | The minute the event starts at (null: all day) |
$end_year | ?integer | No | No | Null | N/A | N/A | The year the event ends at (null: not a multi day event) |
$end_month | ?integer | No | No | Null | N/A | N/A | The month the event ends at (null: not a multi day event) |
$end_day | ?integer | No | No | Null | N/A | N/A | The day the event ends at (null: not a multi day event) |
$end_monthly_spec_type | ID_TEXT | No | No | day_of_month | day_of_month day_of_month_backwards dow_of_month dow_of_month_backwards | N/A | In-month specification type for end date |
$end_hour | ?integer | No | No | Null | N/A | N/A | The hour the event ends at (null: not a multi day event) |
$end_minute | ?integer | No | No | Null | N/A | N/A | The minute the event ends at (null: not a multi day event) |
$timezone | ?ID_TEXT | No | No | Null | N/A | N/A | The timezone for the event (null: current user's timezone) |
$do_timezone_conv | BINARY | No | No | 1 | N/A | N/A | Whether the time should be presented in the viewer's own timezone |
$member_calendar | ?MEMBER | No | No | Null | N/A | N/A | The member's calendar it will be on (null: not on a specific member's calendar) |
$validated | BINARY | No | No | 1 | N/A | N/A | Whether the event has been validated |
$allow_rating | BINARY | No | No | 1 | N/A | N/A | Whether the event may be rated |
$allow_comments | SHORT_INTEGER | No | No | 1 | N/A | N/A | Whether comments are allowed (0=no, 1=yes, 2=review style) |
Returns
- The ID of the event
- Type: AUTO_LINK
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Add a calendar event.
*
* @param AUTO_LINK $type The event type
* @param SHORT_TEXT $recurrence The recurrence code (set to 'none' for no recurrences)
* @param ?integer $recurrences The number of recurrences (null: none/infinite)
* @param BINARY $seg_recurrences Whether to segregate the comment-topics/rating/trackbacks per-recurrence
* @param SHORT_TEXT $title The title of the event
* @param LONG_TEXT $content The full text describing the event
* @param integer $priority The priority
* @range 1 5
* @param integer $start_year The year the event starts at
* @param integer $start_month The month the event starts at
* @param integer $start_day The day the event starts at
* @param ID_TEXT $start_monthly_spec_type In-month specification type for start date
* @set day_of_month day_of_month_backwards dow_of_month dow_of_month_backwards
* @param ?integer $start_hour The hour the event starts at (null: all day)
* @param ?integer $start_minute The minute the event starts at (null: all day)
* @param ?integer $end_year The year the event ends at (null: not a multi day event)
* @param ?integer $end_month The month the event ends at (null: not a multi day event)
* @param ?integer $end_day The day the event ends at (null: not a multi day event)
* @param ID_TEXT $end_monthly_spec_type In-month specification type for end date
* @set day_of_month day_of_month_backwards dow_of_month dow_of_month_backwards
* @param ?integer $end_hour The hour the event ends at (null: not a multi day event)
* @param ?integer $end_minute The minute the event ends at (null: not a multi day event)
* @param ?ID_TEXT $timezone The timezone for the event (null: current user's timezone)
* @param BINARY $do_timezone_conv Whether the time should be presented in the viewer's own timezone
* @param ?MEMBER $member_calendar The member's calendar it will be on (null: not on a specific member's calendar)
* @param BINARY $validated Whether the event has been validated
* @param BINARY $allow_rating Whether the event may be rated
* @param SHORT_INTEGER $allow_comments Whether comments are allowed (0=no, 1=yes, 2=review style)
* @return AUTO_LINK The ID of the event
*/
function add_calendar_event(int $type, string $recurrence, ?int $recurrences, int $seg_recurrences, string $title, string $content, int $priority, int $start_year, int $start_month, int $start_day, string $start_monthly_spec_type, ?int $start_hour, ?int $start_minute, ?int $end_year = null, ?int $end_month = null, ?int $end_day = null, string $end_monthly_spec_type = 'day_of_month', ?int $end_hour = null, ?int $end_minute = null, ?string $timezone = null, int $do_timezone_conv = 1, ?int $member_calendar = null, int $validated = 1, int $allow_rating = 1, int $allow_comments = 1) : int
* Add a calendar event.
*
* @param AUTO_LINK $type The event type
* @param SHORT_TEXT $recurrence The recurrence code (set to 'none' for no recurrences)
* @param ?integer $recurrences The number of recurrences (null: none/infinite)
* @param BINARY $seg_recurrences Whether to segregate the comment-topics/rating/trackbacks per-recurrence
* @param SHORT_TEXT $title The title of the event
* @param LONG_TEXT $content The full text describing the event
* @param integer $priority The priority
* @range 1 5
* @param integer $start_year The year the event starts at
* @param integer $start_month The month the event starts at
* @param integer $start_day The day the event starts at
* @param ID_TEXT $start_monthly_spec_type In-month specification type for start date
* @set day_of_month day_of_month_backwards dow_of_month dow_of_month_backwards
* @param ?integer $start_hour The hour the event starts at (null: all day)
* @param ?integer $start_minute The minute the event starts at (null: all day)
* @param ?integer $end_year The year the event ends at (null: not a multi day event)
* @param ?integer $end_month The month the event ends at (null: not a multi day event)
* @param ?integer $end_day The day the event ends at (null: not a multi day event)
* @param ID_TEXT $end_monthly_spec_type In-month specification type for end date
* @set day_of_month day_of_month_backwards dow_of_month dow_of_month_backwards
* @param ?integer $end_hour The hour the event ends at (null: not a multi day event)
* @param ?integer $end_minute The minute the event ends at (null: not a multi day event)
* @param ?ID_TEXT $timezone The timezone for the event (null: current user's timezone)
* @param BINARY $do_timezone_conv Whether the time should be presented in the viewer's own timezone
* @param ?MEMBER $member_calendar The member's calendar it will be on (null: not on a specific member's calendar)
* @param BINARY $validated Whether the event has been validated
* @param BINARY $allow_rating Whether the event may be rated
* @param SHORT_INTEGER $allow_comments Whether comments are allowed (0=no, 1=yes, 2=review style)
* @return AUTO_LINK The ID of the event
*/
function add_calendar_event(int $type, string $recurrence, ?int $recurrences, int $seg_recurrences, string $title, string $content, int $priority, int $start_year, int $start_month, int $start_day, string $start_monthly_spec_type, ?int $start_hour, ?int $start_minute, ?int $end_year = null, ?int $end_month = null, ?int $end_day = null, string $end_monthly_spec_type = 'day_of_month', ?int $end_hour = null, ?int $end_minute = null, ?string $timezone = null, int $do_timezone_conv = 1, ?int $member_calendar = null, int $validated = 1, int $allow_rating = 1, int $allow_comments = 1) : int