diff options
| author | ilotterytea <iltsu@alright.party> | 2025-05-15 01:44:01 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-05-15 01:44:01 +0500 |
| commit | 53a2e84af1ef1f35d835ef439260157038c70a46 (patch) | |
| tree | c1db7d2ec52960909b69a6eb4b56c2367a7f1106 /src | |
| parent | 29337b30b7071cff678a7be54161507f3eb278be (diff) | |
feat: tags
Diffstat (limited to 'src')
| -rw-r--r-- | src/config.sample.php | 5 | ||||
| -rw-r--r-- | src/emote.php | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/config.sample.php b/src/config.sample.php index d6114b5..ed206f6 100644 --- a/src/config.sample.php +++ b/src/config.sample.php @@ -31,6 +31,11 @@ define("EMOTE_MAX_SIZE", [128, 128]); // Max size of emote. define("EMOTE_NAME_REGEX", "/^[A-Za-z0-9_]+$/"); // RegEx filter for emote names. define("EMOTE_STORE_ORIGINAL", true); // Store original uploads of emotes. +// TAGS +define("TAGS_ENABLE", true); // Allow emote tagging. +define("TAGS_CODE_REGEX", "/^[A-Za-z0-9_]+$/"); +define("TAGS_MAX_COUNT", 10); // Maximum tags per emote. Set -1 for unlimited amount. + // EMOTESETS define("EMOTESET_PUBLIC_LIST", true); // Show emotesets public. diff --git a/src/emote.php b/src/emote.php index 8e7da38..ce3b930 100644 --- a/src/emote.php +++ b/src/emote.php @@ -12,7 +12,9 @@ class Emote public string|null $source; - function __construct($id, $code, $ext, $created_at, $uploaded_by, $is_in_user_set, $rating, $visibility, $source) + public array $tags; + + function __construct($id, $code, $ext, $created_at, $uploaded_by, $is_in_user_set, $rating, $visibility, $source, $tags) { $this->id = $id; $this->code = $code; @@ -23,6 +25,7 @@ class Emote $this->rating = $rating; $this->visibility = $visibility; $this->source = $source; + $this->tags = $tags; } function get_id() @@ -69,6 +72,11 @@ class Emote { return $this->source; } + + function get_tags(): array + { + return $this->tags; + } } function html_random_emote(PDO &$db) |
