From c200602b81a8f89059ed4442f2b30727966fab23 Mon Sep 17 00:00:00 2001 From: SpeedyD Date: Mon, 28 Oct 2024 16:04:18 +0100 Subject: [PATCH 01/14] Adding Uri's Item parsing --- app/Helpers/Helpers.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/app/Helpers/Helpers.php b/app/Helpers/Helpers.php index a9eefbafc9..1166ddde59 100644 --- a/app/Helpers/Helpers.php +++ b/app/Helpers/Helpers.php @@ -136,6 +136,7 @@ function parse($text, &$pings = null) { $text = parseCharacters($text, $characters); $text = parseCharacterThumbs($text, $characters); $text = parseGalleryThumbs($text, $submissions); + $text = parseItems($text, $items); if ($pings) { $pings = ['users' => $users, 'characters' => $characters]; } @@ -305,6 +306,33 @@ function parseCharacterThumbs($text, &$characters) { return $text; } +/** + * Parses a piece of user-entered text to match item mentions + * and replace with a thumbnail link. + * + * @param string $text + * @param mixed $items + * + * @return string + */ +function parseItems($text, &$items) { + $matches = null; + $items = []; + $count = preg_match_all('/\[item=([^\[\]&<>?"\']+)\]/', $text, $matches); + if ($count) { + $matches = array_unique($matches[1]); + foreach ($matches as $match) { + $item = App\Models\Item\Item::where('id', $match)->first(); + if ($item) { + $items[] = $item; + $text = preg_replace('/\[item='.$match.'\]/', ''.$item->name.'', $text); + } + } + } + + return $text; +} + /** * Parses a piece of user-entered text to match gallery submission thumb mentions * and replace with a link. From 2de83944ed6c49d00bd82674660ea3b32a6aaf4a Mon Sep 17 00:00:00 2001 From: SpeedyD Date: Mon, 28 Oct 2024 16:05:01 +0100 Subject: [PATCH 02/14] Trait thumbnail parsing (as in-use on one of my sites) --- app/Helpers/Helpers.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/app/Helpers/Helpers.php b/app/Helpers/Helpers.php index 1166ddde59..824b3b15cc 100644 --- a/app/Helpers/Helpers.php +++ b/app/Helpers/Helpers.php @@ -137,6 +137,7 @@ function parse($text, &$pings = null) { $text = parseCharacterThumbs($text, $characters); $text = parseGalleryThumbs($text, $submissions); $text = parseItems($text, $items); + $text = parseTraitThumbs($text, $traits); if ($pings) { $pings = ['users' => $users, 'characters' => $characters]; } @@ -333,6 +334,35 @@ function parseItems($text, &$items) { return $text; } +/** + * Parses a piece of user-entered text to match trait mentions + * and replace with the trait thumbnail. + * + * @param string $text + * @param mixed $traits + * + * @return string + */ +function parseTraitThumbs($text, &$traits) { + $matches = null; + $traits = []; + $count = preg_match_all('/\[traitthumb=([^\[\]&<>?"\']+)\]/', $text, $matches); + if ($count) { + $matches = array_unique($matches[1]); + foreach ($matches as $match) { + $trait = App\Models\Feature\Feature::where('id', $match)->first(); + if ($trait) { + $traits[] = $trait; + $trait_hasimg = $trait->has_image ? ''.$trait->name.'' : ''; + $traitbg = $trait->rarity->color ? 'background-color:#'.$trait->rarity->color : ''; + $text = preg_replace('/\[traitthumb='.$match.'\]/', '

'.$trait_hasimg.''.$trait->name.'

', $text); + } + } + } + + return $text; +} + /** * Parses a piece of user-entered text to match gallery submission thumb mentions * and replace with a link. From bae0fe9f7b2119cb7d6600636354b6bd52954436 Mon Sep 17 00:00:00 2001 From: SpeedyD Date: Mon, 28 Oct 2024 16:11:08 +0100 Subject: [PATCH 03/14] Item thumbs --- app/Helpers/Helpers.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/app/Helpers/Helpers.php b/app/Helpers/Helpers.php index 824b3b15cc..2b1fbe3ae9 100644 --- a/app/Helpers/Helpers.php +++ b/app/Helpers/Helpers.php @@ -138,6 +138,7 @@ function parse($text, &$pings = null) { $text = parseGalleryThumbs($text, $submissions); $text = parseItems($text, $items); $text = parseTraitThumbs($text, $traits); + $text = parseItemThumbs($text, $items); if ($pings) { $pings = ['users' => $users, 'characters' => $characters]; } @@ -363,6 +364,34 @@ function parseTraitThumbs($text, &$traits) { return $text; } +/** + * Parses a piece of user-entered text to match item mentions + * and replace with the item thumbnail. + * + * @param string $text + * @param mixed $items + * + * @return string + */ +function parseItemThumbs($text, &$items) { + $matches = null; + $items = []; + $count = preg_match_all('/\[itemthumb=([^\[\]&<>?"\']+)\]/', $text, $matches); + if ($count) { + $matches = array_unique($matches[1]); + foreach ($matches as $match) { + $item = App\Models\Item\Item::where('id', $match)->first(); + if ($item) { + $items[] = $item; + $item_hasimg = $item->has_image ? ''.$item->name.'' : ''; + $text = preg_replace('/\[itemthumb='.$match.'\]/', '

'.$item_hasimg.''.$item->name.'

', $text); + } + } + } + + return $text; +} + /** * Parses a piece of user-entered text to match gallery submission thumb mentions * and replace with a link. From e74d7659198cfd9a7aae8333fdc87273d8c9a08d Mon Sep 17 00:00:00 2001 From: SpeedyD Date: Mon, 28 Oct 2024 16:12:18 +0100 Subject: [PATCH 04/14] Prompt thumbs + bonus idUrl attribute in the model --- app/Helpers/Helpers.php | 29 +++++++++++++++++++++++++++++ app/Models/Prompt/Prompt.php | 9 +++++++++ 2 files changed, 38 insertions(+) diff --git a/app/Helpers/Helpers.php b/app/Helpers/Helpers.php index 2b1fbe3ae9..dda0f7f64e 100644 --- a/app/Helpers/Helpers.php +++ b/app/Helpers/Helpers.php @@ -139,6 +139,7 @@ function parse($text, &$pings = null) { $text = parseItems($text, $items); $text = parseTraitThumbs($text, $traits); $text = parseItemThumbs($text, $items); + $text = parsePromptThumbs($text, $prompts); if ($pings) { $pings = ['users' => $users, 'characters' => $characters]; } @@ -392,6 +393,34 @@ function parseItemThumbs($text, &$items) { return $text; } +/** + * Parses a piece of user-entered text to match prompt mentions + * and replace with the prompt thumbnail. + * + * @param string $text + * @param mixed $prompts + * + * @return string + */ +function parsePromptThumbs($text, &$prompts) { + $matches = null; + $prompts = []; + $count = preg_match_all('/\[promptthumb=([^\[\]&<>?"\']+)\]/', $text, $matches); + if ($count) { + $matches = array_unique($matches[1]); + foreach ($matches as $match) { + $prompt = App\Models\Prompt\Prompt::where('id', $match)->first(); + if ($prompt) { + $prompts[] = $prompt; + $prompt_hasimg = $prompt->has_image ? ''.$prompt->name.'' : ''; + $text = preg_replace('/\[promptthumb='.$match.'\]/', '

'.$prompt_hasimg.''.$prompt->name.'

', $text); + } + } + } + + return $text; +} + /** * Parses a piece of user-entered text to match gallery submission thumb mentions * and replace with a link. diff --git a/app/Models/Prompt/Prompt.php b/app/Models/Prompt/Prompt.php index bd78af27ef..0bf8fd2e3b 100644 --- a/app/Models/Prompt/Prompt.php +++ b/app/Models/Prompt/Prompt.php @@ -288,6 +288,15 @@ public function getImageUrlAttribute() { public function getUrlAttribute() { return url('prompts/prompts?name='.$this->name); } + + /** + * Gets the URL of the individual prompts's page, by ID. + * + * @return string + */ + public function getIdUrlAttribute() { + return url('prompts/'.$this->id); + } /** * Gets the prompt's asset type for asset management. From fe5d75dab82d630a010c2c24c2a4d4836205d376 Mon Sep 17 00:00:00 2001 From: SpeedyD Date: Mon, 28 Oct 2024 16:15:51 +0100 Subject: [PATCH 05/14] Adding Prompts similar to Uri's Items --- app/Helpers/Helpers.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/app/Helpers/Helpers.php b/app/Helpers/Helpers.php index dda0f7f64e..01785e13ad 100644 --- a/app/Helpers/Helpers.php +++ b/app/Helpers/Helpers.php @@ -139,6 +139,7 @@ function parse($text, &$pings = null) { $text = parseItems($text, $items); $text = parseTraitThumbs($text, $traits); $text = parseItemThumbs($text, $items); + $text = parsePrompts($text, $prompts); $text = parsePromptThumbs($text, $prompts); if ($pings) { $pings = ['users' => $users, 'characters' => $characters]; @@ -393,6 +394,34 @@ function parseItemThumbs($text, &$items) { return $text; } +/** + * Parses a piece of user-entered text to match prompt mentions + * and replace with the prompt image. + * + * @param string $text + * @param mixed $prompts + * + * @return string + */ +function parsePrompts($text, &$prompts) { + $matches = null; + $prompts = []; + $count = preg_match_all('/\[prompt=([^\[\]&<>?"\']+)\]/', $text, $matches); + if ($count) { + $matches = array_unique($matches[1]); + foreach ($matches as $match) { + $prompt = App\Models\Prompt\Prompt::where('id', $match)->first(); + if ($prompt) { + $prompts[] = $prompt; + $prompt_hasimg = $prompt->has_image ? ''.$prompt->name.'' : ''; + $text = preg_replace('/\[prompt='.$match.'\]/', ''.$prompt->name.'', $text); + } + } + } + + return $text; +} + /** * Parses a piece of user-entered text to match prompt mentions * and replace with the prompt thumbnail. From 01d6863526862657bd1208adf2a193537c3f6125 Mon Sep 17 00:00:00 2001 From: SpeedyD Date: Mon, 28 Oct 2024 15:36:13 +0000 Subject: [PATCH 06/14] refactor: fix PHP styling --- app/Models/Prompt/Prompt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Prompt/Prompt.php b/app/Models/Prompt/Prompt.php index 0bf8fd2e3b..dd7b17d922 100644 --- a/app/Models/Prompt/Prompt.php +++ b/app/Models/Prompt/Prompt.php @@ -288,7 +288,7 @@ public function getImageUrlAttribute() { public function getUrlAttribute() { return url('prompts/prompts?name='.$this->name); } - + /** * Gets the URL of the individual prompts's page, by ID. * From e1a5ff5141bffa072a2186298d423c1b20a23b6d Mon Sep 17 00:00:00 2001 From: SpeedyD Date: Mon, 28 Oct 2024 16:39:42 +0100 Subject: [PATCH 07/14] (Forgot I don't need this line here lol) --- app/Helpers/Helpers.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Helpers/Helpers.php b/app/Helpers/Helpers.php index 01785e13ad..1002de884d 100644 --- a/app/Helpers/Helpers.php +++ b/app/Helpers/Helpers.php @@ -413,7 +413,6 @@ function parsePrompts($text, &$prompts) { $prompt = App\Models\Prompt\Prompt::where('id', $match)->first(); if ($prompt) { $prompts[] = $prompt; - $prompt_hasimg = $prompt->has_image ? ''.$prompt->name.'' : ''; $text = preg_replace('/\[prompt='.$match.'\]/', ''.$prompt->name.'', $text); } } From e79c74c0dca7679c64c51157f2d040d73bdb2f5b Mon Sep 17 00:00:00 2001 From: SpeedyD Date: Wed, 30 Oct 2024 15:32:26 +0100 Subject: [PATCH 08/14] Setup for the new config file. --- config/lorekeeper/mentions.php | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 config/lorekeeper/mentions.php diff --git a/config/lorekeeper/mentions.php b/config/lorekeeper/mentions.php new file mode 100644 index 0000000000..fefc5cf360 --- /dev/null +++ b/config/lorekeeper/mentions.php @@ -0,0 +1,63 @@ + [ + 'enable' => 1, + 'show_text' => 1, + ], + + +]; From a78619e21cf2412770e988a1365fdee9ba7138ee Mon Sep 17 00:00:00 2001 From: SpeedyD Date: Wed, 30 Oct 2024 14:36:23 +0000 Subject: [PATCH 09/14] refactor: fix PHP styling --- config/lorekeeper/mentions.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/config/lorekeeper/mentions.php b/config/lorekeeper/mentions.php index fefc5cf360..315bb2bef7 100644 --- a/config/lorekeeper/mentions.php +++ b/config/lorekeeper/mentions.php @@ -54,10 +54,9 @@ | This option has been enabled by default for backwards compatability. | */ - 'user_mention' => [ - 'enable' => 1, - 'show_text' => 1, + 'user_mention' => [ + 'enable' => 1, + 'show_text' => 1, ], - ]; From facb39e2a21458d42832e842d664c72c43aba052 Mon Sep 17 00:00:00 2001 From: SpeedyD Date: Wed, 30 Oct 2024 16:13:20 +0100 Subject: [PATCH 10/14] Updated config file up until all mentions covered in Extended Mentions and prior, as well as minor edits. --- config/lorekeeper/mentions.php | 134 ++++++++++++++++++++++++++++++++- 1 file changed, 131 insertions(+), 3 deletions(-) diff --git a/config/lorekeeper/mentions.php b/config/lorekeeper/mentions.php index 315bb2bef7..e9ea5e3123 100644 --- a/config/lorekeeper/mentions.php +++ b/config/lorekeeper/mentions.php @@ -44,17 +44,145 @@ |-------------------------------------------------------------------------- | | This is the original method of mentioning a user. This is used to link - | directly to a user's profile page, and give the name the appropriate + | directly to a user's profile page, giving the name the appropriate | rank icon and coloration. | | Usage: | @username | - Replace username with the user's username. | - | This option has been enabled by default for backwards compatability. + | This option has been enabled by default for backwards compatibility. | */ - 'user_mention' => [ + 'user_mention' => [ + 'enable' => 1, + 'show_text' => 1, + ], + + /* + |-------------------------------------------------------------------------- + | User and Avatar Mentions + |-------------------------------------------------------------------------- + | + | This is a newer method of mentioning a user. This is used to link + | directly to a user's profile page, giving the name the appropriate + | rank icon and coloration, and adds the user's avatar in front. + | + | Usage: + | %username + | - Replace username with the user's username. + | + | This option has been enabled by default for backwards compatibility. + | + */ + 'user_and_avatar_mention' => [ + 'enable' => 1, + 'show_text' => 1, + ], + + /* + |-------------------------------------------------------------------------- + | User Permalinks + |-------------------------------------------------------------------------- + | + | The previous methods are affected negatively by username changes. + | This method has the same end result, but instead use a bbcode-like tag + | with the user's id to create permanent links. + | This is used to link directly to a user's profile page, + | giving the name the appropriate rank icon and coloration. + | + | Usage: + | [user=id] + | - Replace id with the user's id. + | + | This option has been enabled by default for backwards compatibility. + | + */ + 'user_permalink' => [ + 'enable' => 1, + 'show_text' => 1, + ], + + /* + |-------------------------------------------------------------------------- + | User Avatar Permalinks + |-------------------------------------------------------------------------- + | + | Similar to the User Permalinks, this method uses a bbcode-like tag + | with the user's id to create permanent links. + | This method only displays the user's avatar. + | + | Usage: + | [userav=id] + | - Replace id with the user's id. + | + | This option has been enabled by default for backwards compatibility. + | + */ + 'user_avatar_permalink' => [ + 'enable' => 1, + 'show_text' => 1, + ], + + /* + |-------------------------------------------------------------------------- + | Character Permalinks + |-------------------------------------------------------------------------- + | + | This mention is to link to specific characters using their slug. + | This is used to link directly to a character's masterlist entry, + | displaying the slug and name of the character. + | + | Usage: + | [character=slug] + | - Replace slug with the character's slug. + | + | This option has been enabled by default for backwards compatibility. + | + */ + 'character_permalink' => [ + 'enable' => 1, + 'show_text' => 1, + ], + + /* + |-------------------------------------------------------------------------- + | Character Thumbnail Permalinks + |-------------------------------------------------------------------------- + | + | Similar to the Character Permalinks, this is used to link to the + | character's masterlist entry, instead of the slug and name, however, + | it displays the character's thumbnail image. + | + | Usage: + | [charthumb=slug] + | - Replace slug with the character's slug. + | + | This option has been enabled by default for backwards compatibility. + | + */ + 'character_thumb_permalink' => [ + 'enable' => 1, + 'show_text' => 1, + ], + + /* + |-------------------------------------------------------------------------- + | Gallery Thumbnail Permalinks + |-------------------------------------------------------------------------- + | + | A method to display the thumbnail for gallery submissions. + | This displays either a thumbnail for the submission's image or, if it + | has no image, displays a short version of the written text instead. + | + | Usage: + | [thumb=id] + | - Replace id with the gallery submission's id. + | + | This option has been enabled by default for backwards compatibility. + | + */ + 'gallery_thumb_permalink' => [ 'enable' => 1, 'show_text' => 1, ], From d5dcc7058b46e8d49e07cf7c562d4c87d7fd8cec Mon Sep 17 00:00:00 2001 From: SpeedyD Date: Wed, 30 Oct 2024 15:17:07 +0000 Subject: [PATCH 11/14] refactor: fix PHP styling --- config/lorekeeper/mentions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/lorekeeper/mentions.php b/config/lorekeeper/mentions.php index e9ea5e3123..86d0eda1f7 100644 --- a/config/lorekeeper/mentions.php +++ b/config/lorekeeper/mentions.php @@ -165,7 +165,7 @@ 'enable' => 1, 'show_text' => 1, ], - + /* |-------------------------------------------------------------------------- | Gallery Thumbnail Permalinks From 68852b0cc74e8f945eed853d4262e87dc5e7d88b Mon Sep 17 00:00:00 2001 From: SpeedyD Date: Wed, 30 Oct 2024 16:59:06 +0100 Subject: [PATCH 12/14] As per @itinerare's suggestions. --- app/Models/Prompt/Prompt.php | 2 +- config/lorekeeper/mentions.php | 64 +++++++++------------------------- 2 files changed, 17 insertions(+), 49 deletions(-) diff --git a/app/Models/Prompt/Prompt.php b/app/Models/Prompt/Prompt.php index dd7b17d922..02d44fbc2a 100644 --- a/app/Models/Prompt/Prompt.php +++ b/app/Models/Prompt/Prompt.php @@ -290,7 +290,7 @@ public function getUrlAttribute() { } /** - * Gets the URL of the individual prompts's page, by ID. + * Gets the URL of the individual prompt's page, by ID. * * @return string */ diff --git a/config/lorekeeper/mentions.php b/config/lorekeeper/mentions.php index 86d0eda1f7..79933c7408 100644 --- a/config/lorekeeper/mentions.php +++ b/config/lorekeeper/mentions.php @@ -6,33 +6,16 @@ |-------------------------------------------------------------------------- | | These are settings that affect, specifically, how mentions are used. -| Mentions are basically shorthand codes mainly for staff to quickly -| refer to a user, a character or a galleryimage. +| Mentions are basically shorthand codes mainly for staff to refer +| to users, characters, gallery submissions and more in the WYSIWYG editor. | -| Over time, these mentions have expanded to encompass quite a few items, -| and in this current update, the sheer number of items that can be -| 'mentioned' well over doubled, and this may cause annoyances for staff. -| As such, a seperate configuration file was made for staff to choose, or -| rather, mix and match effectively, which they want to use and which they -| want displayed on site. +| Each mention has an 'enable' setting which decides if the mention +| functions and a 'show_text' setting which whether the "Mention This" +| block is displayed on-site. Use 0 to disable and 1 to enable. | -| These are not expected to be changed often or on short schedule and are -| therefore separate from the settings modifiable in the admin panel. -| -| Each setting has an 'enable' and a 'show_text' option. -| 'enable' turns the option on if set to 1. (To turn it off, set it to 0.) -| 'show_text' displays the "Mention This" block on-site if turned on. -| (The same 0 for off and 1 for on applies there, too.) -| -| Note that 'show_text' is ignored if 'enable' is set to 0, as it makes -| no sense to display how to use the function if you cannot use it. -| -| Finally, please note that changing any of these settings require you to -| re-edit text blocks in which they are used, as the mentions are generated -| upon hitting the final submit button. -| -| This means that disabling an older function will NOT automatically -| remove previous instances of it being used, either. +| Please note that these settings are not retroactive, and mentions will +| only be applied to (or removed from) areas in which they are used when +| the text is next edited. | */ @@ -43,9 +26,7 @@ | User Mentions |-------------------------------------------------------------------------- | - | This is the original method of mentioning a user. This is used to link - | directly to a user's profile page, giving the name the appropriate - | rank icon and coloration. + | Links to the mentioned user, includes icon and coloration of user's rank. | | Usage: | @username @@ -64,9 +45,8 @@ | User and Avatar Mentions |-------------------------------------------------------------------------- | - | This is a newer method of mentioning a user. This is used to link - | directly to a user's profile page, giving the name the appropriate - | rank icon and coloration, and adds the user's avatar in front. + | Links to the mentioned user, includes user's avatar as well as the icon + | and coloration of user's rank. | | Usage: | %username @@ -85,11 +65,7 @@ | User Permalinks |-------------------------------------------------------------------------- | - | The previous methods are affected negatively by username changes. - | This method has the same end result, but instead use a bbcode-like tag - | with the user's id to create permanent links. - | This is used to link directly to a user's profile page, - | giving the name the appropriate rank icon and coloration. + | Links to the mentioned user, includes icon and coloration of user's rank. | | Usage: | [user=id] @@ -108,9 +84,7 @@ | User Avatar Permalinks |-------------------------------------------------------------------------- | - | Similar to the User Permalinks, this method uses a bbcode-like tag - | with the user's id to create permanent links. - | This method only displays the user's avatar. + | Displays the mentioned user's avatar. | | Usage: | [userav=id] @@ -129,9 +103,7 @@ | Character Permalinks |-------------------------------------------------------------------------- | - | This mention is to link to specific characters using their slug. - | This is used to link directly to a character's masterlist entry, - | displaying the slug and name of the character. + | Links to the mentioned character. | | Usage: | [character=slug] @@ -150,9 +122,7 @@ | Character Thumbnail Permalinks |-------------------------------------------------------------------------- | - | Similar to the Character Permalinks, this is used to link to the - | character's masterlist entry, instead of the slug and name, however, - | it displays the character's thumbnail image. + | Displays the mentioned character's thumbnail. | | Usage: | [charthumb=slug] @@ -171,9 +141,7 @@ | Gallery Thumbnail Permalinks |-------------------------------------------------------------------------- | - | A method to display the thumbnail for gallery submissions. - | This displays either a thumbnail for the submission's image or, if it - | has no image, displays a short version of the written text instead. + | Display the mentioned gallery submission's thumbnail. | | Usage: | [thumb=id] From 66aeec8e2f7825f1b8ed0b929ce04fdd60fde4ed Mon Sep 17 00:00:00 2001 From: SpeedyD Date: Wed, 30 Oct 2024 17:11:25 +0100 Subject: [PATCH 13/14] Further edits as per @itinerare's suggestions. --- config/lorekeeper/mentions.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/lorekeeper/mentions.php b/config/lorekeeper/mentions.php index 79933c7408..e78cc0518c 100644 --- a/config/lorekeeper/mentions.php +++ b/config/lorekeeper/mentions.php @@ -28,6 +28,8 @@ | | Links to the mentioned user, includes icon and coloration of user's rank. | + | If the mentioned user changes usernames, mentions using this method break. + | | Usage: | @username | - Replace username with the user's username. @@ -48,6 +50,8 @@ | Links to the mentioned user, includes user's avatar as well as the icon | and coloration of user's rank. | + | If the mentioned user changes usernames, mentions using this method break. + | | Usage: | %username | - Replace username with the user's username. @@ -67,6 +71,9 @@ | | Links to the mentioned user, includes icon and coloration of user's rank. | + | Mentions using this method persist even if the mentioned user changes + | usernames, but will not update to the new username until edited again. + | | Usage: | [user=id] | - Replace id with the user's id. @@ -86,6 +93,9 @@ | | Displays the mentioned user's avatar. | + | Mentions using this method persist even if the mentioned user changes + | usernames, but will not update to the new username until edited again. + | | Usage: | [userav=id] | - Replace id with the user's id. From dd82a8ac9c1e2cc9d7c033bb3d9b66fa566ac5f9 Mon Sep 17 00:00:00 2001 From: SpeedyD Date: Wed, 30 Oct 2024 17:15:14 +0100 Subject: [PATCH 14/14] Placeholder for the additional functions coming soon --- app/Helpers/Helpers.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Helpers/Helpers.php b/app/Helpers/Helpers.php index 1002de884d..70c2f308fa 100644 --- a/app/Helpers/Helpers.php +++ b/app/Helpers/Helpers.php @@ -141,6 +141,15 @@ function parse($text, &$pings = null) { $text = parseItemThumbs($text, $items); $text = parsePrompts($text, $prompts); $text = parsePromptThumbs($text, $prompts); + // $text = parseRarityThumbs($text, $rarities); + // $text = parseSpeciesThumbs($text, $specieses); + // $text = parseSubtypeThumbs($text, $subtypes); + // $text = parseShopThumbs($text, $shops); + // $text = parseCurrencyThumbs($text, $currencies); + // $text = parseCharacterCategoryThumbs($text, $charactercategories); + // $text = parsePromptCategoryThumbs($text, $promptcategories); + // $text = parseTraitCategoryThumbs($text, $traitcategories); + // $text = parseItemCategoryThumbs($text, $itemcategories); if ($pings) { $pings = ['users' => $users, 'characters' => $characters]; }