113 lines
3.1 KiB
Markdown
113 lines
3.1 KiB
Markdown
# News Configuration
|
|
|
|
This page explains all configuration options for the news system in codem-phone.
|
|
|
|
---
|
|
|
|
## Overview
|
|
|
|
The news system allows authorized players (e.g., reporters) to create and publish news articles that all players can read. Features include media attachments, content moderation, and automatic cleanup of old articles.
|
|
|
|
---
|
|
|
|
## Configuration
|
|
|
|
```lua
|
|
return {
|
|
AutoDeleteEnabled = true,
|
|
AutoDeleteDays = 30,
|
|
EnableBlackWord = true,
|
|
DefaultPageLimit = 10,
|
|
MaxSearchResults = 20,
|
|
MaxMediaPerPost = 10,
|
|
Permissions = {
|
|
CreateNews = "reporter",
|
|
EditOwnNews = true,
|
|
DeleteOwnNews = true
|
|
}
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## Settings
|
|
|
|
### Auto Delete
|
|
|
|
| Option | Type | Default | Description |
|
|
| ------------------- | ------- | ------- | ----------------------------------------- |
|
|
| `AutoDeleteEnabled` | boolean | `true` | Enable automatic deletion of old articles |
|
|
| `AutoDeleteDays` | number | `30` | Delete articles older than X days |
|
|
|
|
### Content Moderation
|
|
|
|
| Option | Type | Default | Description |
|
|
| ----------------- | ------- | ------- | ---------------------------------------------- |
|
|
| `EnableBlackWord` | boolean | `true` | Filter inappropriate content in titles/content |
|
|
|
|
### Pagination
|
|
|
|
| Option | Type | Default | Description |
|
|
| ------------------ | ------ | ------- | ------------------------- |
|
|
| `DefaultPageLimit` | number | `10` | Default articles per page |
|
|
| `MaxSearchResults` | number | `20` | Maximum search results |
|
|
|
|
### Media
|
|
|
|
| Option | Type | Default | Description |
|
|
| ----------------- | ------ | ------- | ------------------------------- |
|
|
| `MaxMediaPerPost` | number | `10` | Maximum media files per article |
|
|
|
|
### Permissions
|
|
|
|
| Option | Type | Default | Description |
|
|
| --------------- | ------- | ------------ | ------------------------------------------------------ |
|
|
| `CreateNews` | string | `"reporter"` | Job required to create news (use `"all"` for everyone) |
|
|
| `EditOwnNews` | boolean | `true` | Allow users to edit their own articles |
|
|
| `DeleteOwnNews` | boolean | `true` | Allow users to delete their own articles |
|
|
|
|
---
|
|
|
|
## Permission Examples
|
|
|
|
### Only Reporters Can Create News
|
|
|
|
```lua
|
|
Permissions = {
|
|
CreateNews = "reporter",
|
|
EditOwnNews = true,
|
|
DeleteOwnNews = true
|
|
}
|
|
```
|
|
|
|
### Any Job Can Create News
|
|
|
|
```lua
|
|
Permissions = {
|
|
CreateNews = "all",
|
|
EditOwnNews = true,
|
|
DeleteOwnNews = true
|
|
}
|
|
```
|
|
|
|
### Only Police Can Create News
|
|
|
|
```lua
|
|
Permissions = {
|
|
CreateNews = "police",
|
|
EditOwnNews = true,
|
|
DeleteOwnNews = true
|
|
}
|
|
```
|
|
|
|
## Discord Logging
|
|
|
|
If Discord logging is enabled, new articles are automatically logged with:
|
|
|
|
- Article ID
|
|
- Author name
|
|
- Author phone number
|
|
- Title
|
|
- Content
|
|
- Media attachments
|