Initial commit
[2ch-be.git] / include / nav.php
blob58943249696ab3c75a4b2849acfbf7f6e015ebde
1 <?php
3 $count = new Message;
4 $uid = $count->GetID($_COOKIE['DMDM'],$id_mail_path);
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">ƒXƒe�[ƒ^ƒX</a></li>
57 <?php if(detect_device2($_SERVER['HTTP_USER_AGENT']) == "PLSDISPLAY") { ?>
58 <li class="navtop"><a href="<?php echo $livesitePath ?>test/p.php?i=<?php echo $uid; ?>" class="fixpadd">ŒöŠJƒvƒ�ƒtƒB�[ƒ‹</a></li>
59 <?php } ?>
60 <li class="navtop"><a href="<?php echo $livesitePath ?>inbox.php" class="fixpadd">ƒ�ƒbƒZ�[ƒW<span class="badge"><?=$value; ?></span></a></li>
61 <?php
62 if(\detect_device($_SERVER['HTTP_USER_AGENT'])){
63 echo "
64 <li><a href=\"#\" onclick=\"location.reload()\" class=\"fixpadd\">ƒ��[ƒ‹‚ðƒ`ƒFƒbƒN</a></li>
68 <li><a href="#" class="fixpadd">
69 <div class="btn-group">
70 <button data-toggle="dropdown" class="btn btn-default dropdown-toggle"><span class="caret"></span></button>
71 <ul class="dropdown-menu noclose dropdownfix pos_absolute">
72 <li class="inline">
73 <span class="pull-left paddingtop">“dŽqƒ��[ƒ‹’Ê’m: </span>
74 <div class="onoffswitch pull-left" >
75 <?php echo $toggle; ?>
76 <label class="onoffswitch-label" for="myonoffswitch">
77 <span class="onoffswitch-inner"></span>
78 <span class="onoffswitch-switch buttonfix"></span>
79 </label>
80 </div>
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>