X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2FSmilies.php;h=a2d7637c793d779d9334cf3fe988290e27d77248;hb=e40c3a9d7c980c4287c273bc12d934ceb8b55fc0;hp=92b2063e47db905cfd4b7ef031156c7108eea53c;hpb=85c49060e2b11d9f86fa6a42256d5419f7922bf3;p=friendica.git
diff --git a/include/Smilies.php b/include/Smilies.php
index 92b2063e47..a2d7637c79 100644
--- a/include/Smilies.php
+++ b/include/Smilies.php
@@ -3,9 +3,18 @@
/**
* @file include/Smilies.php
* @brief This file contains the Smilies class which contains functions to handle smiles
+ *
+ * @todo Use the shortcodes from here:
+ * https://github.com/iamcal/emoji-data/blob/master/emoji_pretty.json?raw=true
+ * https://raw.githubusercontent.com/emojione/emojione/master/extras/alpha-codes/eac.json?raw=true
+ * https://github.com/johannhof/emoji-helper/blob/master/data/emoji.json?raw=true
+ *
+ * Have also a look here:
+ * https://www.webpagefx.com/tools/emoji-cheat-sheet/
*/
use Friendica\App;
+use Friendica\Core\System;
/**
* This class contains functions to handle smiles
@@ -86,41 +95,41 @@ class Smilies {
);
$icons = array(
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '~friendica
',
- 'red
matrix',
- 'red
matrix'
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '~friendica
',
+ 'red
matrix',
+ 'red
matrix'
);
$params = array('texts' => $texts, 'icons' => $icons);
@@ -187,11 +196,11 @@ class Smilies {
return $s;
}
- private function encode($m) {
+ private static function encode($m) {
return(str_replace($m[1],base64url_encode($m[1]),$m[0]));
}
- private function decode($m) {
+ private static function decode($m) {
return(str_replace($m[1],base64url_decode($m[1]),$m[0]));
}
@@ -204,12 +213,12 @@ class Smilies {
*
* @todo: Rework because it doesn't work correctly
*/
- private function preg_heart($x) {
+ private static function preg_heart($x) {
if(strlen($x[1]) == 1)
return $x[0];
$t = '';
for($cnt = 0; $cnt < strlen($x[1]); $cnt ++)
- $t .= '
';
+ $t .= '
';
$r = str_replace($x[0],$t,$x[0]);
return $r;
}