Function __global->edit_news
Definitions
sources/news2.php
- Edit a news entry.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $id | AUTO_LINK | No | No | required parameter | N/A | N/A | The ID of the news to edit |
| $title | SHORT_TEXT | No | No | required parameter | N/A | N/A | The news title |
| $news | LONG_TEXT | No | No | required parameter | N/A | N/A | The news summary (or if not an article, the full news) |
| $author | ID_TEXT | No | No | required parameter | N/A | N/A | The news author (possibly, a link to an existing author in the system, but does not need to be) |
| $validated | BINARY | No | No | required parameter | N/A | N/A | Whether the news has been validated |
| $allow_rating | BINARY | No | No | required parameter | N/A | N/A | Whether the news may be rated |
| $allow_comments | SHORT_INTEGER | No | No | required parameter | N/A | N/A | Whether comments are allowed (0=no, 1=yes, 2=review style) |
| $allow_trackbacks | BINARY | No | No | required parameter | N/A | N/A | Whether the news may have trackbacks |
| $notes | LONG_TEXT | No | No | required parameter | N/A | N/A | Notes for the news |
| $news_article | LONG_TEXT | No | No | required parameter | N/A | N/A | The news entry (blank means no entry) |
| $main_news_category | ?AUTO_LINK | No | No | required parameter | N/A | N/A | The primary news category (null: personal) |
| $news_categories | ?array | No | No | required parameter | N/A | N/A | The IDs of the news categories that this is in (null: do not change) |
| $meta_keywords | SHORT_TEXT | No | No | required parameter | N/A | N/A | Meta keywords |
| $meta_description | LONG_TEXT | No | No | required parameter | N/A | N/A | Meta description |
| $image | ?URLPATH | No | No | required parameter | N/A | N/A | URL to the image for the news entry (blank: use cat image) (null: don't delete existing) |
| $add_time | ?TIME | No | No | Null | N/A | N/A | Add time (null: do not change) |
| $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) |
| $views | ?integer | No | No | Null | N/A | N/A | Number of views (null: do not change) |
| $submitter | ?MEMBER | No | No | Null | N/A | N/A | Submitter (null: do not change) |
| $regions | array | No | No | [] | N/A | N/A | The regions (empty: not region-limited) |
| $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' |
Preview
Code (PHP)
/**
* Edit a news entry.
*
* @param AUTO_LINK $id The ID of the news to edit
* @param SHORT_TEXT $title The news title
* @param LONG_TEXT $news The news summary (or if not an article, the full news)
* @param ID_TEXT $author The news author (possibly, a link to an existing author in the system, but does not need to be)
* @param BINARY $validated Whether the news has been validated
* @param BINARY $allow_rating Whether the news may be rated
* @param SHORT_INTEGER $allow_comments Whether comments are allowed (0=no, 1=yes, 2=review style)
* @param BINARY $allow_trackbacks Whether the news may have trackbacks
* @param LONG_TEXT $notes Notes for the news
* @param LONG_TEXT $news_article The news entry (blank means no entry)
* @param ?AUTO_LINK $main_news_category The primary news category (null: personal)
* @param ?array $news_categories The IDs of the news categories that this is in (null: do not change)
* @param SHORT_TEXT $meta_keywords Meta keywords
* @param LONG_TEXT $meta_description Meta description
* @param ?URLPATH $image URL to the image for the news entry (blank: use cat image) (null: don't delete existing)
* @param ?TIME $add_time Add time (null: do not change)
* @param ?TIME $edit_time Edit time (null: either means current time, or if $null_is_literal, means reset to to null)
* @param ?integer $views Number of views (null: do not change)
* @param ?MEMBER $submitter Submitter (null: do not change)
* @param array $regions The regions (empty: not region-limited)
* @param boolean $null_is_literal Determines whether some nulls passed mean 'use a default' or literally mean 'set to null'
*/
function edit_news(int $id, string $title, string $news, string $author, int $validated, int $allow_rating, int $allow_comments, int $allow_trackbacks, string $notes, string $news_article, ?int $main_news_category, ?array $news_categories, string $meta_keywords, string $meta_description, ?string $image, ?int $add_time = null, ?int $edit_time = null, ?int $views = null, ?int $submitter = null, array $regions = [], bool $null_is_literal = false)
* Edit a news entry.
*
* @param AUTO_LINK $id The ID of the news to edit
* @param SHORT_TEXT $title The news title
* @param LONG_TEXT $news The news summary (or if not an article, the full news)
* @param ID_TEXT $author The news author (possibly, a link to an existing author in the system, but does not need to be)
* @param BINARY $validated Whether the news has been validated
* @param BINARY $allow_rating Whether the news may be rated
* @param SHORT_INTEGER $allow_comments Whether comments are allowed (0=no, 1=yes, 2=review style)
* @param BINARY $allow_trackbacks Whether the news may have trackbacks
* @param LONG_TEXT $notes Notes for the news
* @param LONG_TEXT $news_article The news entry (blank means no entry)
* @param ?AUTO_LINK $main_news_category The primary news category (null: personal)
* @param ?array $news_categories The IDs of the news categories that this is in (null: do not change)
* @param SHORT_TEXT $meta_keywords Meta keywords
* @param LONG_TEXT $meta_description Meta description
* @param ?URLPATH $image URL to the image for the news entry (blank: use cat image) (null: don't delete existing)
* @param ?TIME $add_time Add time (null: do not change)
* @param ?TIME $edit_time Edit time (null: either means current time, or if $null_is_literal, means reset to to null)
* @param ?integer $views Number of views (null: do not change)
* @param ?MEMBER $submitter Submitter (null: do not change)
* @param array $regions The regions (empty: not region-limited)
* @param boolean $null_is_literal Determines whether some nulls passed mean 'use a default' or literally mean 'set to null'
*/
function edit_news(int $id, string $title, string $news, string $author, int $validated, int $allow_rating, int $allow_comments, int $allow_trackbacks, string $notes, string $news_article, ?int $main_news_category, ?array $news_categories, string $meta_keywords, string $meta_description, ?string $image, ?int $add_time = null, ?int $edit_time = null, ?int $views = null, ?int $submitter = null, array $regions = [], bool $null_is_literal = false)

