Initial commit
[2ch-be.git] / dev-test / rewrite / include / test.php
blob12da673fd23ab09a4566d2c6666dfe53048c9281
1 <?php
2 session_start();
3 //error_reporting( E_ALL );
4 //ini_set('display_errors', 1);
5 include ('messaging.class.php');
6 $inbox = new Message;
7 function notification($directory, $inbox) {
8 $i = 0;
9 @chdir($directory);
10 try{
11 $files = glob("*.dat");
12 if(!$files){
13 throw new Exception("0");
14 }else{
15 foreach($files as $filename){
16 $array = file($filename);
17 $value = max($array);
18 $checkUnread = $inbox->within_str($value, "<read>", "</read>");
19 if($checkUnread==0){
20 $i++;
23 return $i;
25 }catch(Exception $e){
26 return $e->getMessage();
29 // print_r($valueTest1);
31 $value = notification($_SESSION['sLoggedDir'], $inbox);
32 echo $value;