|
|
@ -121,6 +121,15 @@
|
|
|
|
return array_unique($tags);
|
|
|
|
return array_unique($tags);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function get_tag_classname(): string {
|
|
|
|
|
|
|
|
$tag_type = $this->get_tag_type();
|
|
|
|
|
|
|
|
$classname = "room-label-$tag_type";
|
|
|
|
|
|
|
|
if (CommunityTag::is_showcased_tag($this->text)) {
|
|
|
|
|
|
|
|
$classname .= " room-label-showcased";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return $classname;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function get_tag_type(): string {
|
|
|
|
public function get_tag_type(): string {
|
|
|
|
return match($this->type) {
|
|
|
|
return match($this->type) {
|
|
|
|
TagType::USER_TAG => 'user',
|
|
|
|
TagType::USER_TAG => 'user',
|
|
|
@ -134,6 +143,8 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private const RESERVED_TAGS = ["official", "nsfw", "modded", "not modded"];
|
|
|
|
private const RESERVED_TAGS = ["official", "nsfw", "modded", "not modded"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private const SHOWCASED_TAGS = ["official"];
|
|
|
|
|
|
|
|
|
|
|
|
private const REDUNDANT_TAGS = ["session"];
|
|
|
|
private const REDUNDANT_TAGS = ["session"];
|
|
|
|
|
|
|
|
|
|
|
|
public const NSFW_KEYWORDS = ["nsfw", "porn", "erotic", "18+"];
|
|
|
|
public const NSFW_KEYWORDS = ["nsfw", "porn", "erotic", "18+"];
|
|
|
@ -149,5 +160,8 @@
|
|
|
|
return in_array(strtolower($tag), CommunityTag::RESERVED_TAGS);
|
|
|
|
return in_array(strtolower($tag), CommunityTag::RESERVED_TAGS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static function is_showcased_tag(string $tag): bool {
|
|
|
|
|
|
|
|
return in_array(strtolower($tag), CommunityTag::SHOWCASED_TAGS);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
?>
|