Beispiel #1
0
 private function Emojify($data)
 {
     $data = emoji_docomo_to_unified($data);
     # DoCoMo devices
     $data = emoji_kddi_to_unified($data);
     # KDDI & Au devices
     $data = emoji_softbank_to_unified($data);
     # Softbank & (iPhone) Apple devices
     $data = emoji_google_to_unified($data);
     # Google Android devices
     return emoji_unified_to_html($data);
 }
Beispiel #2
0
 public static function covertEmojiToName($data)
 {
     $data = emoji_docomo_to_unified($data);
     # DoCoMo devices
     $data = emoji_kddi_to_unified($data);
     # KDDI & Au devices
     $data = emoji_softbank_to_unified($data);
     # Softbank & (iPhone) Apple devices
     $data = emoji_google_to_unified($data);
     # Google Android devices
     $data = emoji_unified_to_name($data);
     $data = emoji_unified_to_key($data);
     return $data;
 }
Beispiel #3
0
 public static function removeEmoji($data)
 {
     require_once Application::getInstance()->getBasePath() . '/php-emoji/emoji.php';
     $data = emoji_docomo_to_unified($data);
     # DoCoMo devices
     $data = emoji_kddi_to_unified($data);
     # KDDI & Au devices
     $data = emoji_softbank_to_unified($data);
     # Softbank & pre-iOS6 Apple devices
     $data = emoji_google_to_unified($data);
     # Google Android devices
     $data = emoji_unified_to_html($data);
     $data = preg_replace('/[^а-яa-z0-9 _\\-\\+\\&\\.\\,\\!@#\\$\\n\\t<>=\\/"\\(\\)\\*:]/ui', '', $data);
     return $data;
 }
Beispiel #4
0
echo "#------------------\n";
is(emoji_unified_to_html($test_unified), $test_html, "Unified -> HTML");
is(emoji_html_to_unified($test_html), $test_unified, "HTML -> Unified");
echo "#------------------\n";
#
# some emoji (e-82C thru e-837 and others) use 2 codepoints in the
# unified mode, but just one in phone modes. test that it works as
# expected
#
$test_unified = "Hello " . utf8_bytes(0x36) . utf8_bytes(0x20e3);
$test_iphone = "Hello " . utf8_bytes(0xe221);
$test_docomo = "Hello " . utf8_bytes(0xe6e7);
$test_kddi = "Hello " . utf8_bytes(0xe527);
$test_google = "Hello " . utf8_bytes(0xfe833);
$test_html = "Hello <span class=\"emoji emoji3620e3\"></span>";
is(emoji_docomo_to_unified($test_docomo), $test_unified, "DoCoMo -> Unified");
is(emoji_kddi_to_unified($test_kddi), $test_unified, "KDDI -> Unified");
is(emoji_softbank_to_unified($test_iphone), $test_unified, "Softbank -> Unified");
is(emoji_google_to_unified($test_google), $test_unified, "Google -> Unified");
echo "#------------------\n";
is(emoji_unified_to_docomo($test_unified), $test_docomo, "Unified -> DoCoMo");
is(emoji_unified_to_kddi($test_unified), $test_kddi, "Unified -> KDDI");
is(emoji_unified_to_softbank($test_unified), $test_iphone, "Unified -> Softbank");
is(emoji_unified_to_google($test_unified), $test_google, "Unified -> Google");
echo "#------------------\n";
is(emoji_unified_to_html($test_unified), $test_html, "Unified -> HTML");
is(emoji_html_to_unified($test_html), $test_unified, "HTML -> Unified");
echo "#------------------\n";
#
# names are accessed by the unified codepoint (which makes it tricky for 2-codepoint unicode symbols)
#
Beispiel #5
0
                    $userInfo = $db->getInfo($weObj->getRevFrom());
                    $db->disconnect();
                    switch ($userInfo['state']) {
                        case 0:
                            $weObj->text("您目前处于未认证状态,请先认证!\n\n<a href='" . $authURI . "'>点此开始你的" . WX_TITLE . "!</a>")->reply();
                            break;
                        case 1:
                            $weObj->text("<a href='{$authURI2}'>确认借车                                           </a>")->reply();
                            break;
                        case 2:
                            $weObj->text("您目前处于已借车状态,不能再次借车!\n\n<a href='" . $authURI . "'>点此开始你的" . WX_TITLE . "!</a>")->reply();
                            break;
                        case 3:
                            $weObj->text("您目前处于被禁用状态!\n\n<a href='" . $authURI . "'>点此查看原因</a>")->reply();
                            break;
                    }
                } else {
                    if (substr($scan, 0, 5) == "prizea") {
                        // Prize
                        $redirectURI3 = urlencode("http://" . WX_URL . "/main.php?a=prize");
                        $authURI3 = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" . WX_APPID . "&redirect_uri=" . $redirectURI3 . "&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
                        $weObj->text("<a href='{$authURI3}'>点此抽奖~</a>")->reply();
                    }
                }
                break;
        }
        break;
}
$weObj->checkAuth();
$weObj->createMenu(array('button' => array(0 => array('name' => '慈善商店', 'type' => 'view', 'url' => 'http://www.imall365.org/'), 1 => array('name' => WX_TITLE . emoji_docomo_to_unified(utf8_bytes(0x1f6b2)), 'type' => 'view', 'url' => $authURI))));