-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy path404.php
More file actions
214 lines (214 loc) · 9.32 KB
/
404.php
File metadata and controls
214 lines (214 loc) · 9.32 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->page404(); ?>
<?php $this->need('includes/header_com.php'); ?>
<div id="web_bg"></div>
<div class="error404" id="body-wrap">
<header class="not-top-img" id="page-header">
<?php $this->need('public/nav.php'); ?>
</header>
<div id="error-wrap"><div class="error-content"><div class="error-img"><img src="https://i.loli.net/2020/05/19/aKOcLiyPl2JQdFD.png" alt="Page not found" class="entered"></div><div class="error-info"><h1 class="error_title">404</h1><div class="error_subtitle">页面没有找到</div></div></div></div></div>
<?php require_once('public/rightside.php');?>
<?php if ($this->options->showFramework == 'off'): ?>
<style>.framework-info{display:none}</style>
<?php endif; ?>
<?php if ($this->options->CursorEffects !== 'off' &&$this->options->CursorEffects == 'heart') : ?>
<script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-heart.min.js" async="async" mobile="false"></script>
<?php elseif ($this->options->CursorEffects !== 'off' &&$this->options->CursorEffects == 'fireworks') : ?>
<canvas class="fireworks"></canvas>
<script id="fireworks" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1.1.0/dist/fireworks.min.js" async="async" mobile="false"></script>
<?php endif; ?>
<?php if ($this->options->ShowLive2D !== 'off' && !isMobile()) : ?>
<?php require_once('public/live2d.php'); ?>
<?php endif; ?>
<script><?php $this->options->CustomScript() ?></script>
<?php $this->options->CustomBodyEnd() ?>
<!--搜索 -->
<div id="local-search">
<div class="search-dialog" style="">
<nav class="search-nav">
<span class="search-dialog-title">本地搜索</span>
<span id="loading-status"></span>
<button class="search-close-button">
<i class="fas fa-times"></i>
</button>
</nav>
<div class="search-wrap" style="display: block;">
<div id="local-search-input">
<form class="local-search-box" method="post" action="<?php $this->options->siteUrl(); ?>" role="search" id="search">
<label for="s" class="sr-only"><?php _e('搜索关键字'); ?></label>
<input type="text" name="s" placeholder="输入至少 2 个字搜索" required="required"></div>
</form>
<hr>
<div id="local-search-results"></div>
</div>
</div>
<div id="search-mask" style=""></div>
</div>
</div>
<!--搜索end -->
<div class="js-pjax">
<?php if ($this->options->NewTabLink == 'on' || $this->options->ExternalLinkConfirm == 'on'): ?>
<script data-pjax>
(function() {
if (typeof ExternalLinkConfirm === 'undefined') {
return;
}
ExternalLinkConfirm.init({
enableNewTab: <?php echo $this->options->NewTabLink == 'on' ? 'true' : 'false'; ?>,
enableConfirm: <?php echo $this->options->ExternalLinkConfirm == 'on' ? 'true' : 'false'; ?>
});
})();
</script>
<?php endif; ?>
<?php if($this->is('index')): ?>
<!--打字-->
<?php if (is_array($this->options->beautifyBlock) && in_array('ShowTopimg',$this->options->beautifyBlock)): ?>
<?php if(!empty($this->options->CustomSubtitle)): ?>
<script>
function subtitleType() {
if (true) {
var typed = new Typed("#subtitle", {
strings: "<?php $this->options->CustomSubtitle()?>".split(","),
startDelay: 300,
typeSpeed: 150,
loop: <?php $this->options->SubtitleLoop() ?>,
backSpeed: 50
})
}
}
"function"==typeof Typed?subtitleType():getScript("https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js")
.then(subtitleType)
</script>
<?php else: ?>
<script>
function subtitleType(){
fetch("https://v1.hitokoto.cn").then(t=>t.json()).then(t=>{
o=0=="".length?new Array:" ".split(",");
o.unshift(t.hitokoto),
new Typed("#subtitle",{
strings:o,
startDelay:300,
typeSpeed:150,
loop: <?php $this->options->SubtitleLoop() ?>,
backSpeed:50
}
)}
)}
"function"==typeof Typed?subtitleType():getScript("https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js")
.then(subtitleType)
</script>
<?php endif ?>
<?php endif?>
<!--打字end-->
<!--判断主页end-->
<?php endif?>
</div>
<!--pjax-->
<?php if($this->options->EnablePjax === 'on') : ?>
<?php if($this->options->StaticFile == 'CDN' && $this->options->CDNURL == ''): ?>
<link rel="stylesheet" href="https://<?php $this->options->jsdelivrLink() ?>/gh/rstacruz/nprogress@master/nprogress.css">
<script src="https://<?php $this->options->jsdelivrLink() ?>/gh/rstacruz/nprogress@master/nprogress.js"></script>
<script src="https://<?php $this->options->jsdelivrLink() ?>/npm/pjax/pjax.min.js"></script>
<?php elseif($this->options->StaticFile == 'CDN' && $this->options->CDNURL !== ''): ?>
<link rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.css">
<script src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.js"></script>
<script src="<?php $this->options->CDNURL() ?>/js/pjax.min.js"></script>
<?php else: ?>
<link rel="stylesheet" href="<?php $this->options->themeUrl('static/css/nprogress.css'); ?>">
<script src="<?php $this->options->themeUrl('static/js/nprogress.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('static/js/pjax.min.js'); ?>"></script>
<?php endif; ?>
<script>
let pjaxSelectors = ["title", "#config-diff", "#config_change", "#body-wrap", "#rightside-config-hide", "#rightside-config-show", ".js-pjax"];
const resetPjaxUiState = () => {
const bodyStyle = document.body.style;
bodyStyle.width = "";
bodyStyle.overflow = "";
bodyStyle.paddingRight = "";
const sidebarMenus = document.getElementById("sidebar-menus");
sidebarMenus && sidebarMenus.classList.remove("open");
};
const executePjaxScripts = () => {
const scripts = [...document.querySelectorAll("script[data-pjax]")];
return scripts.reduce((promise, currentScript) => {
return promise.then(() => new Promise(resolve => {
const parentNode = currentScript.parentNode;
if (!parentNode) {
resolve();
return;
}
const newScript = document.createElement("script");
const scriptContent = currentScript.text || currentScript.textContent || currentScript.innerHTML || "";
Array.from(currentScript.attributes).forEach(attribute => {
newScript.setAttribute(attribute.name, attribute.value);
});
if (newScript.src) {
newScript.async = false;
newScript.onload = () => resolve();
newScript.onerror = () => resolve();
parentNode.replaceChild(newScript, currentScript);
return;
}
newScript.appendChild(document.createTextNode(scriptContent));
parentNode.replaceChild(newScript, currentScript);
resolve();
}));
}, Promise.resolve());
};
var pjax = new Pjax({
elements: 'a:not([target="_blank"])',
selectors: pjaxSelectors,
cacheBust: !1,
analytics: !1,
scrollRestoration: !1});
document.addEventListener("pjax:send", (function() {
resetPjaxUiState();
if (window.removeEventListener("scroll", window.tocScrollFn), window.removeEventListener("scroll", scrollCollect), "object" == typeof preloader && preloader.initLoading(), window.aplayers)
for (let e = 0; e < window.aplayers.length; e++) window.aplayers[e].options.fixed || window.aplayers[e].destroy();"object" == typeof typed && typed.destroy();
const e = document.body.classList;
e.contains("read-mode") && e.remove("read-mode")
NProgress.start();
})),
document.addEventListener("pjax:complete", (function() {
<?php $this->options->PjaxCallBack() ?>
NProgress.done();
executePjaxScripts().then(() => {
<?php if (!empty($this->options->hcaptchaSecretKey) && !empty($this->options->hcaptchaAPIKey)) : ?>
if (typeof hcaptcha !== "undefined" && document.getElementById('h-captcha') && !document.querySelector('#h-captcha iframe')) {
hcaptcha.render('h-captcha', {
sitekey: '<?php $this->options->hcaptchaSecretKey() ?>'
});
}
<?php endif ?>
<?php if (!empty($this->options->turnstileSiteKey) && !empty($this->options->turnstileKey)) : ?>
if (typeof loadTurnstile === "function") {
loadTurnstile();
}
if (typeof setupThemeObserver === "function") {
setupThemeObserver();
}
<?php endif ?>
"function" == typeof window.refreshFn && window.refreshFn(),
"function" == typeof tocCheck && tocCheck(),
GLOBAL_CONFIG.islazyload && window.lazyLoadInstance.update(), "function" == typeof chatBtnFn && chatBtnFn(), "function" == typeof panguInit && panguInit(), "function" == typeof gtag && gtag("config", "",
{page_path: window.location.pathname}),
"object" == typeof _hmt && _hmt.push(["_trackPageview", window.location.pathname]),
"function" == typeof loadMeting && document.getElementsByClassName("aplayer").length && loadMeting(),
"object" == typeof preloader && preloader.endLoading()
})
})),
document.addEventListener("pjax:error", e => {
resetPjaxUiState();
// 404 === e.request.status && pjax.loadUrl("/404");
if(e.request.status === 404){
window.location="/404";
}
if(e.request.status === 403){
window.location=e.request.responseURL
}
})
</script>
<?php endif?>
<!--pjax end-->
</body>
</html>