mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Use twemoji
This commit is contained in:
parent
8f11700738
commit
7d4fa2886b
1 changed files with 3 additions and 3 deletions
|
@ -8,15 +8,15 @@ trait TRichText
|
|||
$emojis = \Emoji\detect_emoji($text);
|
||||
$replaced = []; # OVK-113
|
||||
foreach($emojis as $emoji) {
|
||||
$point = strtolower($emoji["hex_str"]);
|
||||
$point = explode("-", strtolower($emoji["hex_str"]))[0];
|
||||
if(in_array($point, $replaced))
|
||||
continue;
|
||||
else
|
||||
$replaced[] = $point;
|
||||
|
||||
$image = "https://cdn.jsdelivr.net/npm/emojione-assets@4.5.0/png/32/$point.png";
|
||||
$image = "https://abs.twimg.com/emoji/v2/72x72/$point.png";
|
||||
$image = "<img src='$image' alt='$emoji[emoji]' ";
|
||||
$image .= "style='max-height:10pt; padding-left: 2pt; padding-right: 2pt; vertical-align: bottom;' />";
|
||||
$image .= "style='max-height:12px; padding-left: 2pt; padding-right: 2pt; vertical-align: bottom;' />";
|
||||
|
||||
$text = str_replace($emoji["emoji"], $image, $text);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue