summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.sample.php5
-rw-r--r--src/emote.php10
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)