2 include('encrypt.php');
3 setlocale(LC_ALL
, 'ja_JP.EUC-JP');
5 $uid = $inbox->GetID($_COOKIE['DMDM'],$id_mail_path);
7 $user = $inbox->FindUser($uid,$id_mail_path);
10 $start = $_GET['start'];
11 $total = $_GET['total'];
12 function specificMDB($user, $dat, $turn) {
13 // Turn is yung incrementation.
15 $fdir = substr($user, 0, 1);
16 $sdir = substr($user, 1, 1);
17 $udir = str_replace("@", "-", $user);
18 $path = MDB_PATH
."{$fdir}/{$sdir}/{$udir}";
23 if(file_exists($path."/{$dat}.dat")){
25 $messages = file("{$path}/{$dat}.dat");
26 $count = sizeof($messages);
27 $total = $count-$turn;
28 $start = $total-$turn;
31 return array($messages, TRUE, $total, 0);
33 return array($messages, FALSE, $total, $start);
40 $d = strip_tags(addslashes(trim($d)));
41 $messages = specificMDB($user, $d, $l);
43 $returnValues['breaker'] = $messages[1];
44 $returnValues["total"] = abs($messages[2]);
45 $returnValues['start'] = abs($messages[3]);
48 for ($i=$start; $i < $total; $i++
) {
50 $leftRightCounter = ($inbox->within_str($messages[0][$i], "<from>", "</from>")==$uid) ?
"r mdes panel panel-default pull-left txt" : "s mdes panel panel-default pull-right txt";
51 $returnValues["array"][] =
53 "<div class=\"".$leftRightCounter."\">". mb_convert_encoding(urldecode($inbox->within_str($messages[0][$i], "<msg>", "</msg>")), "UTF-8", "SHIFT-JIS").
54 "<br><small class=\"d pull-right\">".
55 date("Y-m-d g:i a",urldecode($inbox->within_str($messages[0][$i], "<id>", "</id>"))) ."</small></div> <div class='clearfix'></div>";
56 // echo "<div class=\"".$leftRightCounter."\">". urldecode($inbox->within_str($messages[0][$i], "<msg>", "</msg>")) . "<br><small class=\"d pull-right\">". date("Y-m-d g:i a",urldecode($inbox->within_str($messages[0][$i], "<id>", "</id>"))) ."</small></div> <div class='clearfix'></div>";
58 // utf8_encode($returnValues);
60 // print_r($returnValues);
63 // if(isset($returnValues["array"])){
64 echo json_encode($returnValues)."<br />xxx";
65 // echo json_last_error();
66 // echo json_encode("ƒXƒe[ƒ^ƒX
72 // ƒ[ƒ‹‚ðƒ`ƒFƒbƒN");