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;
$this->rating = $rating;
$this->visibility = $visibility;
$this->source = $source;
$this->tags = $tags;
}
function get_id()
{
return $this->id;
}
function get_code()
{
return $this->code;
}
function get_ext()
{
return $this->ext;
}
function get_created_at()
{
return $this->created_at;
}
function get_uploaded_by()
{
return $this->uploaded_by;
}
function is_added_by_user()
{
return $this->is_in_user_set;
}
function get_rating()
{
return $this->rating;
}
function get_visibility()
{
return $this->visibility;
}
function get_source()
{
return $this->source;
}
function get_tags(): array
{
return $this->tags;
}
}
function html_random_emote(PDO &$db)
{
$stmt = $db->prepare("SELECT id, code FROM emotes WHERE visibility = 1 ORDER BY RAND() LIMIT 1");
$stmt->execute();
if ($row = $stmt->fetch()) {
echo ''
?>
prepare("SELECT e.id, e.code FROM emotes e
INNER JOIN emote_sets es ON es.is_featured = TRUE
INNER JOIN emote_set_contents esc ON es.id = esc.emote_set_id
WHERE e.visibility = 1 AND e.id = esc.emote_id ORDER BY esc.added_at DESC LIMIT 1");
$stmt->execute();
if ($row = $stmt->fetch()) {
echo ''
?>