Initial commit
[2ch-be.git] / dev-test / bak / nav2.php
blobfbc82674d1f78247dc7478f836437de259b54e31
1 <?php
3 $count = new Message;
5 $path = $count->GetPath();
6 $path = $path."/noti.txt";
7 if(file_exists($path)) {
8 $noti = file_get_contents($path);
9 } else {
10 file_put_contents($path, "1");
11 $noti = "1";
14 if($noti == 1)
15 $toggle = "<input type=¥"checkbox¥" name=¥"switch¥" class=¥"onoffswitch-checkbox¥" id=¥"myonoffswitch¥" checked>";
16 else
17 $toggle = "<input type=¥"checkbox¥" name=¥"switch¥" class=¥"onoffswitch-checkbox¥" id=¥"myonoffswitch¥">";
19 function notification($directory, $inbox) {
20 $i = 0;
21 @chdir($directory);
22 try{
23 $files = glob("*.dat");
24 if(!$files){
25 throw new Exception("");
26 }else{
27 foreach($files as $filename){
28 $array = file($filename);
29 $value = max($array);
30 $checkUnread = $inbox->within_str($value, "<read>", "</read>");
31 if($checkUnread==0){
32 $i++;
35 return ($i==0) ? '' : $i;
37 }catch(Exception $e){
38 return $e->getMessage();
41 $value = notification($_SESSION['sLoggedDir'], $count);
44 <nav class="navbar navbar-default" role="navigation">
45 <div class="container-fluid">
46 <div class="navbar-header">
47 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#menu">
48 <span class="sr-only">Toggle navigation</span>
49 <span class="icon-bar"></span>
50 <span class="icon-bar"></span>
51 <span class="icon-bar"></span>
52 </button>
53 </div>
54 <div class="collapse navbar-collapse space" id="menu">
55 <ul class="nav navbar-nav">
56 <li><a href="<?php echo $livesitePath ?>status.php">ステータス</a></li>
57 <li><a href="<?php echo $livesitePath ?>test/p.php?i=<?php echo $uid; ?>">公開プロフィール</a></li>
58 <li><a href="<?php echo $livesitePath ?>inbox.php">受信トレイ <span class="badge"><?=$value; ?></span></a></li>
59 <li><a href="#" onclick="location.reload()">メールをチェック</a></li>
60 <li><a href="#">
61 <div class="btn-group">
62 <button data-toggle="dropdown" class="btn btn-default dropdown-toggle"><span class="caret"></span></button>
63 <ul class="dropdown-menu noclose" style="min-width:0px !important; padding: 3px !important;">
64 <li style="display:inline !important;">電子メール通知:<span class="onoffswitch" style="min-width:50px !important;">
65 <?php echo $toggle; ?>
66 <label class="onoffswitch-label" for="myonoffswitch">
67 <span class="onoffswitch-inner"></span>
68 <span class="onoffswitch-switch"></span>
69 </label>
70 </span></li>
71 <!-- Other items -->
72 </ul>
73 </div>
74 </a>
75 </li>
76 </ul>
77 </div><!-- /.navbar-collapse -->
79 </div><!-- /.container-fluid -->
81 </nav>