Initial commit
[2ch-be.git] / dev-test / old_dev / include / navj.php
blob03098e6697778fd546ae0b461f4742b244e549c0
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 space">
46 <div class="navbar-header">
47 <button type="button" class="navbar-toggle margrf" 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 navleftpad">
56 <li class="navtop"><a href="<?php echo $livesitePath ?>status.php" class="fixpadd">ステータス</a></li>
57 <li class="navtop"><a href="<?php echo $livesitePath ?>test/p.php?i=<?php echo $uid; ?>" class="fixpadd">公開プロフィール</a></li>
58 <li class="navtop"><a href="<?php echo $livesitePath ?>inbox.php" class="fixpadd">メッセージ<span class="badge"><?=$value; ?></span></a></li>
59 <li class="navtop"><a href="#" onclick="location.reload()" class="fixpadd">メールをチェック</a></li>
60 <li><a href="#" class="fixpadd">
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 dropdownfix pos_absolute">
64 <li class="inline">
65 <table>
66 <tr>
67 <td class="notifdesign">
68 <span class="pull-left">電子メール通知: </spa
69 </td>
70 <td class="notifdesign paddingtop">
71 <div class="onoffswitch pull-left" >
72 <?php echo $toggle; ?>
73 <label class="onoffswitch-label" for="myonoffswitch">
74 <span class="onoffswitch-inner"></span>
75 <span class="onoffswitch-switch buttonfix"></span>
76 </label>
77 </div>
78 </td>
79 </tr>
80 </table>
81 </li>
82 <!-- Other items -->
83 </ul>
84 </div>
85 </a>
86 </li>
87 </ul>
88 </div><!-- /.navbar-collapse -->
90 </div><!-- /.container-fluid -->
92 </nav>