@@ -9901,31 +9901,31 @@ |
||
9901 | 9901 | # functions to convert incoming data into the unified format |
9902 | 9902 | # |
9903 | 9903 | |
9904 | - function emoji_docomo_to_unified( $text){ return emoji_convert($text, 'docomo_to_unified'); } |
|
9905 | - function emoji_kddi_to_unified( $text){ return emoji_convert($text, 'kddi_to_unified'); } |
|
9906 | - function emoji_softbank_to_unified( $text){ return emoji_convert($text, 'softbank_to_unified'); } |
|
9907 | - function emoji_google_to_unified( $text){ return emoji_convert($text, 'google_to_unified'); } |
|
9904 | + function emoji_docomo_to_unified($text) { return emoji_convert($text, 'docomo_to_unified'); } |
|
9905 | + function emoji_kddi_to_unified($text) { return emoji_convert($text, 'kddi_to_unified'); } |
|
9906 | + function emoji_softbank_to_unified($text) { return emoji_convert($text, 'softbank_to_unified'); } |
|
9907 | + function emoji_google_to_unified($text) { return emoji_convert($text, 'google_to_unified'); } |
|
9908 | 9908 | |
9909 | 9909 | |
9910 | 9910 | # |
9911 | 9911 | # functions to convert unified data into an outgoing format |
9912 | 9912 | # |
9913 | 9913 | |
9914 | - function emoji_unified_to_docomo( $text){ return emoji_convert($text, 'unified_to_docomo'); } |
|
9915 | - function emoji_unified_to_kddi( $text){ return emoji_convert($text, 'unified_to_kddi'); } |
|
9916 | - function emoji_unified_to_softbank( $text){ return emoji_convert($text, 'unified_to_softbank'); } |
|
9917 | - function emoji_unified_to_google( $text){ return emoji_convert($text, 'unified_to_google'); } |
|
9918 | - function emoji_unified_to_html( $text){ return emoji_convert($text, 'unified_to_html'); } |
|
9919 | - function emoji_html_to_unified( $text){ return emoji_convert($text, 'html_to_unified'); } |
|
9914 | + function emoji_unified_to_docomo($text) { return emoji_convert($text, 'unified_to_docomo'); } |
|
9915 | + function emoji_unified_to_kddi($text) { return emoji_convert($text, 'unified_to_kddi'); } |
|
9916 | + function emoji_unified_to_softbank($text) { return emoji_convert($text, 'unified_to_softbank'); } |
|
9917 | + function emoji_unified_to_google($text) { return emoji_convert($text, 'unified_to_google'); } |
|
9918 | + function emoji_unified_to_html($text) { return emoji_convert($text, 'unified_to_html'); } |
|
9919 | + function emoji_html_to_unified($text) { return emoji_convert($text, 'html_to_unified'); } |
|
9920 | 9920 | |
9921 | 9921 | |
9922 | 9922 | |
9923 | - function emoji_convert($text, $map){ |
|
9923 | + function emoji_convert($text, $map) { |
|
9924 | 9924 | |
9925 | 9925 | return str_replace(array_keys($GLOBALS['emoji_maps'][$map]), $GLOBALS['emoji_maps'][$map], $text); |
9926 | 9926 | } |
9927 | 9927 | |
9928 | - function emoji_get_name($unified_cp){ |
|
9928 | + function emoji_get_name($unified_cp) { |
|
9929 | 9929 | |
9930 | 9930 | return $GLOBALS['emoji_maps']['names'][$unified_cp] ? $GLOBALS['emoji_maps']['names'][$unified_cp] : '?'; |
9931 | 9931 | } |
@@ -7,10 +7,10 @@ discard block |
||
7 | 7 | class LaravelEmoji extends Controller { |
8 | 8 | |
9 | 9 | static public function covertEmojiToName($data) { |
10 | - $data = emoji_docomo_to_unified($data); # DoCoMo devices |
|
11 | - $data = emoji_kddi_to_unified($data); # KDDI & Au devices |
|
10 | + $data = emoji_docomo_to_unified($data); # DoCoMo devices |
|
11 | + $data = emoji_kddi_to_unified($data); # KDDI & Au devices |
|
12 | 12 | $data = emoji_softbank_to_unified($data); # Softbank & (iPhone) Apple devices |
13 | - $data = emoji_google_to_unified($data); # Google Android devices |
|
13 | + $data = emoji_google_to_unified($data); # Google Android devices |
|
14 | 14 | $data = emoji_unified_to_name($data); |
15 | 15 | $data = emoji_unified_to_key($data); |
16 | 16 | return $data; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | static public function textWithEmoji($data) { |
49 | - if($data=="") return false; |
|
49 | + if ($data == "") return false; |
|
50 | 50 | |
51 | 51 | $data = LaravelEmoji::covertEmojiToName($data); |
52 | 52 | $data = LaravelEmoji::covertNameToEmoji($data); |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | $n = 0; |
57 | 57 | |
58 | 58 | $strLen = mb_strlen($data, 'UTF-8'); |
59 | - for($i=0; $i<$strLen; $i++) { |
|
59 | + for ($i = 0; $i < $strLen; $i++) { |
|
60 | 60 | $char = mb_substr($data, $i, 1, 'UTF-8'); |
61 | 61 | $charCode = LaravelEmoji::uniChrCode($char); |
62 | 62 | |
63 | - if($charCode>1000) { |
|
63 | + if ($charCode > 1000) { |
|
64 | 64 | |
65 | 65 | /*if ( $charCode < 0 || $charCode > 0xFFFF ) { |
66 | 66 | $CPString .= 'Error1 ' . strtolower(dechex($charCode)) . '!'; |
@@ -68,22 +68,22 @@ discard block |
||
68 | 68 | |
69 | 69 | |
70 | 70 | if ($haut != 0) { |
71 | - if (0xDC00 <= $charCode&& $charCode<= 0xDFFF) { |
|
72 | - $CPString .= ' imgFront'. strtolower(dechex(0x10000 + (($haut - 0xD800) << 10) + ($charCode - 0xDC00))) . 'imgBack '; |
|
71 | + if (0xDC00 <= $charCode && $charCode <= 0xDFFF) { |
|
72 | + $CPString .= ' imgFront' . strtolower(dechex(0x10000 + (($haut - 0xD800) << 10) + ($charCode - 0xDC00))) . 'imgBack '; |
|
73 | 73 | $haut = 0; |
74 | 74 | continue; |
75 | 75 | } |
76 | 76 | else { |
77 | - $CPString .= 'Error2' . strtolower(dechex($haut)) . '!'; |
|
77 | + $CPString .= 'Error2' . strtolower(dechex($haut)) . '!'; |
|
78 | 78 | $haut = 0; |
79 | 79 | } |
80 | 80 | } |
81 | 81 | |
82 | - if (0xD800 <= $charCode && $charCode <= 0xDBFF) { |
|
82 | + if (0xD800 <= $charCode && $charCode <= 0xDBFF) { |
|
83 | 83 | $haut = $charCode; |
84 | 84 | } |
85 | 85 | else { |
86 | - $CPString .= ' imgFront'. strtolower(dechex($charCode)) . 'imgBack '; |
|
86 | + $CPString .= ' imgFront' . strtolower(dechex($charCode)) . 'imgBack '; |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 | else { |