Initial commit
[2ch-be.git] / dev-test / old_dev / zwitch / resource.php
bloba8c1bd94b50959a5c16f1c6b0df96971790bb4f2
1 <?php
2 include 'config.php';
3 $inbox = new Message;
5 $files = file(DB_PATH."idlist.log");
6 foreach ($files as $key) {
7 // echo $key;
8 $array[0] = explode("<><>", $key);
9 $worldofArray[0] = $array[0][1];
10 // $dir[] = $inbox->loggedEmail($worldofArray[0], MDB_PATH);
11 $dir[] = array('directory' => $inbox->loggedEmail($worldofArray[0], MDB_PATH), 'id' => $array[0][0]);
13 // echo $dir;
15 $countIndex = 0;
16 foreach($dir as $key){
17 if(is_dir($key['directory'])){
19 $count = 0;
20 $hi = explode("/", $key['directory']);
21 $strReplaced = str_replace("-", "@", $hi[5]);
23 foreach (glob($key['directory']."*.dat") as $filename){
24 $count++;
25 $h = explode("/", $filename);
27 $arrayContainer['data'][$countIndex] = array( $key['id'], "<a href=\"conversation.php?em={$strReplaced}\">".$strReplaced."</a>" , $count);
28 $countIndex++;
32 header("Content-type: application/json");
33 echo json_encode($arrayContainer);