summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-04-21 17:33:46 +0500
committerilotterytea <iltsu@alright.party>2025-04-21 17:33:46 +0500
commit92ea7a326b4430f3dbeb94f150df680e432f5ddf (patch)
tree0fa7d96a4c45837d4c41b5e84b3c7c1aa16286be /src
parent3c97031c879a227018dbdc4189b896a0a8998b06 (diff)
feat: check emote if it has been already added
Diffstat (limited to 'src')
-rw-r--r--src/emote.php9
-rw-r--r--src/emotes/multiple_page.php5
2 files changed, 13 insertions, 1 deletions
diff --git a/src/emote.php b/src/emote.php
index d00886a..2fd30c0 100644
--- a/src/emote.php
+++ b/src/emote.php
@@ -6,14 +6,16 @@ class Emote
public string $ext;
public string|null $uploaded_by;
public int $created_at;
+ public bool $is_in_user_set;
- function __construct($id, $code, $ext, $created_at, $uploaded_by)
+ function __construct($id, $code, $ext, $created_at, $uploaded_by, $is_in_user_set)
{
$this->id = $id;
$this->code = $code;
$this->ext = $ext;
$this->created_at = $created_at;
$this->uploaded_by = $uploaded_by;
+ $this->is_in_user_set = $is_in_user_set;
}
function get_id()
@@ -40,4 +42,9 @@ class Emote
{
return $this->uploaded_by;
}
+
+ function is_added_by_user()
+ {
+ return $this->is_in_user_set;
+ }
}
diff --git a/src/emotes/multiple_page.php b/src/emotes/multiple_page.php
index 8e2b4d7..25c4c9c 100644
--- a/src/emotes/multiple_page.php
+++ b/src/emotes/multiple_page.php
@@ -23,6 +23,11 @@
if (isset($emotes)) {
foreach ($emotes as $e) {
echo "<a class=\"box emote\" href=\"/emotes/" . $e->get_id() . "\">";
+
+ if ($e->is_added_by_user()) {
+ echo '<img src="/static/img/icons/yes.png" class="emote-check" />';
+ }
+
echo "<img src=\"/static/userdata/emotes/" . $e->get_id() . "/2x." . $e->get_ext() . "\" alt=\"" . $e->get_code() . "\"/>";
echo "<p>" . $e->get_code() . "</p>";
echo "</a>";