3 date_default_timezone_set("Asia/Tokyo");
5 function Encrypt($str, $key = "your_key") {
6 return enc_dec_wkey("encrypt", $str, $key);
8 function Decrypt($str, $key = "your_key") {
9 return enc_dec_wkey("decrypt", $str, $key);
11 function enc_dec_wkey($mode, $str, $key='') {
12 if($key==='') return $str;
13 if($mode=== "decrypt") $str = base64_decode($str);
14 $key = str_replace(chr(32),'',$key);
15 if(strlen($key) < 8) exit('key error');
16 $kl = strlen($key) < 32 ?
strlen($key) : 32;
18 for ($i = 0; $i < $kl; $i++
) $k[$i] = ord($key{$i}) & 0x1F;
20 for($i = 0; $i < strlen($str); $i++
) {
22 $str{$i} = $e & 0xE0 ?
chr($e^
$k[$j]): chr($e);
24 $j = $j == $kl ?
0 : $j;
26 if($mode == "encrypt")
27 return base64_encode($str);
32 function within_str($subject, $lsearch, $rsearch) {
33 $data = strstr($subject, $lsearch);
34 $data = str_replace($lsearch, "", $data);
35 $trim = strstr($data, $rsearch);
37 return(str_replace($trim, "", $data));
40 function loggedEmail($email, $directory){
41 $strReplaced = $email;
42 $firstChar = substr($email, 0, 1);
43 $secondChar = substr($email, 1, 1);
44 $directory = $directory.$firstChar."/".$secondChar."/".$strReplaced."/";
48 function detect_device2($value){
50 $iPod = preg_match("/iPod/i", $value);
51 $iPhone = preg_match("/iPhone/i", $value);
52 $iPad = preg_match("/iPad/i", $value);
53 // $Android = stripos($value,"Android");
54 $webOS = (preg_match("/Safari/i",$value)) ?
2 : 0;
55 //do something with this information
56 $finalBreaker = $breaker+
$webOS+
$iPhone+
$iPod+
$iPad;
65 $livesitePath = "http" . (isset($_SERVER['HTTPS']) ?
's' : '')."://".$_SERVER['HTTP_HOST']."/";
66 $livesitePath2 = "http" . (isset($_SERVER['HTTPS']) ?
's' : '')."://".$_SERVER['HTTP_HOST'];
67 define('AKEY', "KungAnoAnoLang123456789");
68 define('ADB_PATH', "/home/adb/");
69 define('AFORGOT', "0._{_forgot_}_.0");