Function __global->cns_edit_post
Definitions
sources/cns_posts_action3.php
- Edit a post.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: int
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $post_id | AUTO_LINK | No | No | required parameter | N/A | N/A | The ID of the post that we're editing |
| $validated | ?BINARY | No | No | required parameter | N/A | N/A | Whether the post is validated (null: decide based on permissions) |
| $title | SHORT_TEXT | No | No | required parameter | N/A | N/A | The title of the post (may be blank) |
| $post | LONG_TEXT | No | No | required parameter | N/A | N/A | The post |
| $skip_sig | BINARY | No | No | required parameter | N/A | N/A | Whether to skip showing the posters signature in the post |
| $is_emphasised | BINARY | No | No | required parameter | N/A | N/A | Whether the post is marked emphasised |
| $whisper_to_member | ?MEMBER | No | No | required parameter | N/A | N/A | The member that this post is intended solely for (null: none) |
| $show_as_edited | boolean | No | No | required parameter | N/A | N/A | Whether to show the post as edited |
| $mark_as_unread | boolean | No | No | required parameter | N/A | N/A | Whether to mark the topic as unread by those previous having read this post |
| $reason | LONG_TEXT | No | No | required parameter | N/A | N/A | The reason for this action |
| $check_perms | boolean | No | No | True | N/A | N/A | Whether to check permissions |
| $edit_time | ?TIME | No | No | Null | N/A | N/A | Edit time (null: either means current time, or if $null_is_literal, means reset to to null) |
| $add_time | ?TIME | No | No | Null | N/A | N/A | Add time (null: do not change) |
| $submitter | ?MEMBER | No | No | Null | N/A | N/A | Submitter (null: do not change) |
| $null_is_literal | boolean | No | No | False | N/A | N/A | Determines whether some nulls passed mean 'use a default' or literally mean 'set to null' |
| $run_checks | boolean | No | No | True | N/A | N/A | Whether to run checks |
| $poster_name_if_guest | ?string | No | No | Null | N/A | N/A | The name of the person making the post (null: no change) |
Returns
- The ID of the topic (while this could be known without calling this function, as we've gone to effort and grabbed it from the DB, it might turn out useful for something)
- Type: AUTO_LINK
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Edit a post.
*
* @param AUTO_LINK $post_id The ID of the post that we're editing
* @param ?BINARY $validated Whether the post is validated (null: decide based on permissions)
* @param SHORT_TEXT $title The title of the post (may be blank)
* @param LONG_TEXT $post The post
* @param BINARY $skip_sig Whether to skip showing the posters signature in the post
* @param BINARY $is_emphasised Whether the post is marked emphasised
* @param ?MEMBER $whisper_to_member The member that this post is intended solely for (null: none)
* @param boolean $show_as_edited Whether to show the post as edited
* @param boolean $mark_as_unread Whether to mark the topic as unread by those previous having read this post
* @param LONG_TEXT $reason The reason for this action
* @param boolean $check_perms Whether to check permissions
* @param ?TIME $edit_time Edit time (null: either means current time, or if $null_is_literal, means reset to to null)
* @param ?TIME $add_time Add time (null: do not change)
* @param ?MEMBER $submitter Submitter (null: do not change)
* @param boolean $null_is_literal Determines whether some nulls passed mean 'use a default' or literally mean 'set to null'
* @param boolean $run_checks Whether to run checks
* @param ?string $poster_name_if_guest The name of the person making the post (null: no change)
* @return AUTO_LINK The ID of the topic (while this could be known without calling this function, as we've gone to effort and grabbed it from the DB, it might turn out useful for something)
*/
function cns_edit_post(int $post_id, ?int $validated, string $title, string $post, int $skip_sig, int $is_emphasised, ?int $whisper_to_member, bool $show_as_edited, bool $mark_as_unread, string $reason, bool $check_perms = true, ?int $edit_time = null, ?int $add_time = null, ?int $submitter = null, bool $null_is_literal = false, bool $run_checks = true, ?string $poster_name_if_guest = null) : int
* Edit a post.
*
* @param AUTO_LINK $post_id The ID of the post that we're editing
* @param ?BINARY $validated Whether the post is validated (null: decide based on permissions)
* @param SHORT_TEXT $title The title of the post (may be blank)
* @param LONG_TEXT $post The post
* @param BINARY $skip_sig Whether to skip showing the posters signature in the post
* @param BINARY $is_emphasised Whether the post is marked emphasised
* @param ?MEMBER $whisper_to_member The member that this post is intended solely for (null: none)
* @param boolean $show_as_edited Whether to show the post as edited
* @param boolean $mark_as_unread Whether to mark the topic as unread by those previous having read this post
* @param LONG_TEXT $reason The reason for this action
* @param boolean $check_perms Whether to check permissions
* @param ?TIME $edit_time Edit time (null: either means current time, or if $null_is_literal, means reset to to null)
* @param ?TIME $add_time Add time (null: do not change)
* @param ?MEMBER $submitter Submitter (null: do not change)
* @param boolean $null_is_literal Determines whether some nulls passed mean 'use a default' or literally mean 'set to null'
* @param boolean $run_checks Whether to run checks
* @param ?string $poster_name_if_guest The name of the person making the post (null: no change)
* @return AUTO_LINK The ID of the topic (while this could be known without calling this function, as we've gone to effort and grabbed it from the DB, it might turn out useful for something)
*/
function cns_edit_post(int $post_id, ?int $validated, string $title, string $post, int $skip_sig, int $is_emphasised, ?int $whisper_to_member, bool $show_as_edited, bool $mark_as_unread, string $reason, bool $check_perms = true, ?int $edit_time = null, ?int $add_time = null, ?int $submitter = null, bool $null_is_literal = false, bool $run_checks = true, ?string $poster_name_if_guest = null) : int
