-
Notifications
You must be signed in to change notification settings - Fork 260
/
footer.php
256 lines (251 loc) · 10.3 KB
/
footer.php
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<footer id="footer" class="footer <?php if (isset($this->___fields()['archive'])): ?>bg-white<?php elseif($this->is('archive')&&($this->options->colorBgPosts == 'defaultColor')): ?>bg-white<?php elseif($this->is('archive')&&($this->options->colorBgPosts == 'customColor')): ?>bg-grey<?php elseif($this->is('single')): ?>bg-white<?php endif; ?>">
<div class="footer-social">
<div class="footer-container clearfix">
<div class="social-list">
<?php if ($this->options->socialweibo): ?>
<a class="social weibo" target="blank" href="<?php $this->options->socialweibo(); ?>">WEIBO</a>
<?php endif; ?>
<?php if ($this->options->socialzhihu): ?>
<a class="social zhihu" target="blank" href="<?php $this->options->socialzhihu(); ?>">ZHIHU</a>
<?php endif; ?>
<a class="social rss" target="blank" href="<?php $this->options->siteUrl(); ?>feed/">RSS</a>
<?php if ($this->options->socialgithub): ?>
<a class="social github" target="blank" href="<?php $this->options->socialgithub(); ?>">GITHUB</a>
<?php endif; ?>
<?php if ($this->options->socialtwitter): ?>
<a class="social twitter" target="blank" href="<?php $this->options->socialtwitter(); ?>">TWITTER</a>
<?php endif; ?>
</div>
</div>
</div>
<div class="footer-meta">
<div class="footer-container">
<div class="meta-item meta-copyright">
<div class="meta-copyright-info">
<a href="<?php $this->options->siteUrl(); ?>" class="info-logo">
<?php if($this->options->footerLogoUrl): ?>
<img src="<?php $this->options->footerLogoUrl();?>" alt="<?php $this->options->title() ?>" />
<?php else : ?>
<?php $this->options->title() ?>
<?php endif; ?>
</a>
<div class="info-text">
<p>Theme is <a href="https://github.com/chakhsu/pinghsu" target="blank">Pinghsu</a> by <a href="https://www.linpx.com/" target="_blank">Chakhsu</a></p>
<?php if ($this->options->ICPRecordNumber): ?>
<p><a href="https://beian.miit.gov.cn/" target="blank" ><?php $this->options->ICPRecordNumber(); ?></a></p>
<?php endif; ?>
<p>© <?php echo date('Y'); ?> <a href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title(); ?></a></p>
</div>
</div>
</div>
<div class="meta-item meta-posts">
<h3 class="meta-title">RECENT POSTS</h3>
<?php getRecentPosts($this,8); ?>
</div>
<div class="meta-item meta-tags">
<h3 class="meta-title">HOT TAGS</h3>
<?php getHotTags($this,20); ?>
</div>
</div>
</footer>
<?php if (($this->options->tableOfContents == 'able') && ($this->is('post'))): ?>
<div id="directory-content" class="directory-content">
<nav class="toc js-toc"></nav>
</div>
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/tocbot/4.18.2/tocbot.min.js"></script>
<?php endif; ?>
<?php if(($this->is('single')) && ($this->allow('comment'))): ?>
<script>
(function () {
window.TypechoComment = {
dom : function (id) {
return document.getElementById(id);
},
create : function (tag, attr) {
var el = document.createElement(tag);
for (var key in attr) {
el.setAttribute(key, attr[key]);
}
return el;
},
reply : function (cid, coid) {
var comment = this.dom(cid), parent = comment.parentNode,
response = this.dom('<?php echo $this->respondId(); ?>'),
input = this.dom('comment-parent'),
form = 'form' == response.tagName ? response : response.getElementsByTagName('form')[0],
textarea = response.getElementsByTagName('textarea')[0];
if (null == input) {
input = this.create('input', {
'type' : 'hidden',
'name' : 'parent',
'id' : 'comment-parent'
});
form.appendChild(input);
}
input.setAttribute('value', coid);
if (null == this.dom('comment-form-place-holder')) {
var holder = this.create('div', {
'id' : 'comment-form-place-holder'
});
response.parentNode.insertBefore(holder, response);
}
comment.appendChild(response);
this.dom('cancel-comment-reply-link').style.display = '';
if (null != textarea && 'text' == textarea.name) {
textarea.focus();
}
return false;
},
cancelReply : function () {
var response = this.dom('<?php echo $this->respondId(); ?>'),
holder = this.dom('comment-form-place-holder'),
input = this.dom('comment-parent');
if (null != input) {
input.parentNode.removeChild(input);
}
if (null == holder) {
return true;
}
this.dom('cancel-comment-reply-link').style.display = 'none';
holder.parentNode.insertBefore(response, holder);
return false;
}
};
})();
<?php if(!$this->user->hasLogin()): ?>
function getCommentCookie(name){
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
if (arr=document.cookie.match(reg)) {
return unescape(decodeURI(arr[2]));
} else {
return null;
}
}
function addCommentInputValue(){
document.getElementById('author').value = getCommentCookie('<?php echo md5($this->request->getUrlPrefix()); ?>__typecho_remember_author');
document.getElementById('mail').value = getCommentCookie('<?php echo md5($this->request->getUrlPrefix()); ?>__typecho_remember_mail');
document.getElementById('url').value = getCommentCookie('<?php echo md5($this->request->getUrlPrefix()); ?>__typecho_remember_url');
}
addCommentInputValue();
<?php endif; ?>
</script>
<?php endif; ?>
<?php $this->footer(); ?>
<script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/headroom/0.12.0/headroom.min.js"></script>
<?php if ($this->options->useHighline == 'able'): ?>
<script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/highlight.js/11.4.0/highlight.min.js"></script>
<?php endif; ?>
<?php if ($this->options->pjaxSet == 'able'): ?>
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/instantclick/3.1.0/instantclick.min.js"></script>
<?php endif; ?>
<?php if ($this->options->fastClickSet == 'able'): ?>
<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/fastclick/1.0.6/fastclick.min.js"></script>
<?php endif; ?>
<script>
<?php if (($this->options->tableOfContents == 'able') && ($this->is('post'))): ?>
var postDirectory = new Headroom(document.getElementById("directory-content"), {
tolerance: 0,
<?php if ($this->options->postshowthumb == 'able'): ?>
offset : 280,<?php else: ?>
offset : 90,<?php endif; ?>
classes: {
initial: "initial",
pinned: "pinned",
unpinned: "unpinned"
}
});
postDirectory.init();
tocbot.init({
tocSelector: '.toc',
contentSelector: '.post-content',
headingSelector: 'h1, h2, h3, h4, h5',
collapseDepth: 2,
scrollSmooth: true,
scrollSmoothDuration: 600,
scrollSmoothOffset: -80,
headingsOffset: 80,
});
<?php endif; ?>
<?php if($this->is('post')): ?>
var postSharer = new Headroom(document.getElementById("post-bottom-bar"), {
tolerance: 0,
offset : 70,
classes: {
initial: "animated",
pinned: "pinned",
unpinned: "unpinned"
}
});
postSharer.init();
<?php endif; ?>
var header = new Headroom(document.getElementById("header"), {
tolerance: 0,
offset : 70,
classes: {
initial: "animated",
pinned: "slideDown",
unpinned: "slideUp"
}
});
header.init();
<?php if (($this->options->pjaxSet == 'disable') && ($this->options->useHighline == 'able') && ($this->is('post'))): ?>
hljs.highlightAll();
<?php endif; ?>
<?php if ($this->options->fastClickSet == 'able'): ?>
if ('addEventListener' in document) {
document.addEventListener('DOMContentLoaded', function() {
FastClick.attach(document.body);
}, false);
}
<?php endif; ?>
</script>
<?php if ($this->options->useMathjax == 'able'): ?>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
showProcessingMessages: false,
messageStyle: "none",
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre','code','a'],
ignoreClass:"comment-content"
},
"HTML-CSS": {
availableFonts: ["STIX","TeX"],
showMathMenu: false
}
});
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
</script>
<script src="//cdn.bootcss.com/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<?php endif; ?>
<?php if($this->options->GoogleAnalytics): ?>
<?php $this->options->GoogleAnalytics(); ?>
<?php endif; ?>
<?php if ($this->options->pjaxSet == 'able'): ?>
<script data-no-instant>
InstantClick.on('change', function(isInitialLoad){
<?php if ($this->options->useHighline == 'able'): ?>
var blocks = document.querySelectorAll('pre code');
for (var i = 0; i < blocks.length; i++) {
hljs.highlightBlock(blocks[i]);
}
<?php endif; ?>
if (isInitialLoad === false) {
<?php if($this->options->GoogleAnalytics): ?>
if (typeof ga !== 'undefined') ga('send', 'pageview', location.pathname + location.search);
<?php endif; ?>
<?php if($this->options->useMathjax == 'able'): ?>
if (typeof MathJax !== 'undefined'){MathJax.Hub.Queue(["Typeset",MathJax.Hub]);}
<?php endif; ?>
}
});
InstantClick.init('mousedown');
</script>
<?php endif; ?>
</body>
</html>
<?php if ($this->options->htmlCompress == 'able'): $html_source = ob_get_contents(); ob_clean(); print compressHtml($html_source); ob_end_flush(); endif; ?>