Repository navigation
Expand file tree
/
Copy pathmaintenance.php
More file actions
executable file
·126 lines (109 loc) · 3.92 KB
/
Copy pathmaintenance.php
File metadata and controls
executable file
·126 lines (109 loc) · 3.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
//We suppose you got the autoload function.
$userrole = new UserRoles($connection);
$roles_arr = $userrole->getUserRole(@$_SESSION["id"]);
$maintenance = new Maintenance($connection);
if(($maintenance->checkIfMaintaining() === false) || $roles_arr['rights'] >= $maintenance->getMinUserRights()){
//return;
}
$maintain_arr = $maintenance->getMaintenance();
if(file_exists(get_template_dir() . '/page-maintenance.php')){
include get_template_dir() . '/page-maintenance.php';
die;
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/bootstrap@5.0.0-alpha1/dist/css/bootstrap.min.css">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Maintenance</title>
</head>
<style>
.logo.svg{
fill: #fff;
}
</style>
<body style="background-color:#005cff; color: white">
<div class="container" >
<div class="d-flex justify-content-center align-items-center vh-100">
<div class="maintenance-container" style="max-width: 500px">
<img class="p-4 w-100 logo svg" src="<?php echo BASE_URL . '/assets/product_logo.svg' ?>" alt="Labforum Logo">
<h1 class="h5 text-center">The site is undergoing maintenance.</h1>
<div class="py-5">
<article>
<p>
Due to the reason of <?php echo strlen($maintain_arr['reason'])? $maintain_arr['reason'] : 'Unknown Reasons'?>, our site is currently unavailable.
</p>
</article>
<div>
<div><b>Please come back in <?php echo $maintain_arr['e_date'] ?></b>. Sorry for any inconvenience that might cause.</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://unpkg.com/jquery@3.5.1/dist/jquery.min.js"></script>
<script src="https://unpkg.com/bootstrap@5.0.0-alpha1/dist/js/bootstrap.min.js"></script>
</body>
<script>
$('img.svg').each(function (){
var self = $(this);
var src = $(this).attr('src');
var id = $(this).attr('id');
var class_name = $(this).attr('class');
$.get(src, function(data){
var svg_tag = $(data).find('svg');
if(id !== undefined){
svg_tag = svg_tag.attr('id', id);
}
if(class_name !== undefined){
svg_tag = svg_tag.attr('class', class_name + ' replaced_svg');
}
svg_tag = svg_tag.removeAttr('xmlns:a');
self.replaceWith(svg_tag);
});
})
</script>
</html>
<!--
<html>
<head>
<style>
body{
margin: 0;
background-color: #00c5ff;
text-align: center;
color:white;
}
a{
text-decoration: none;
color:white;
}
</style>
<Title>論壇正在更新</Title>
</head>
<?php
?>
<body>
<h1 style='font-size: 40px; margin-top: 280px; '>升級中 UPDATING</h1></br>
<h1 style='text-align: center; font-size: 20px; margin-top: 40px;color:white;'>
對唔住,Forum 正在更新中...</br>
由於<?php echo $maintain_arr['reason']?>,因此論壇暫時無法使用</br>
等陣見
</br>
</br>
更新時間: <?php echo $maintain_arr['s_date']."-".$maintain_arr['e_date']; ?>
<br/>
<br/>
<br/>
</h1>
<a href="../login.php?target=forum">以特別身份登入...</a>
</body>
</html>
-->
<?php
die;