/
header.php
122 lines (112 loc) · 4.42 KB
/
header.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
<?php
$home = $tbopt->get('home');
$blog_name = $tbopt->get('blog_name');
?><!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title><?php
if($tbquery->is_home()) {
echo '首页';
} else if(!$tbquery->count) {
echo '404';
} else if($tbquery->is_singular()) {
echo $the->title;
} else if($tbquery->is_category()) {
echo "第{$tbquery->pageno}页 - ";
$names = $tbquery->category['name'];
$names = array_reverse($names);
echo implode(' - ', $names);
} else if($tbquery->is_date()) {
echo "第{$tbquery->pageno}页 - ";
if($tbquery->date->yy >= 1970) echo $tbquery->date->yy,'年';
if($tbquery->date->mm >= 1 && $tbquery->date->mm <= 12) echo $tbquery->date->mm,'月';
} else if($tbquery->is_tag()) {
echo "第{$tbquery->pageno}页 - ";
echo $tbquery->tags;
}
echo ' - ',$blog_name;
?></title>
<?php if($tbquery->is_home()) {
echo '<meta name="keywords" content="', $tbopt->get('keywords'), '" />', PHP_EOL;
} ?>
<link rel="alternate" type="application/rss+xml" title="<?php echo htmlspecialchars($blog_name);?>" href="<?php echo $home,'/rss';?>" />
<link rel="stylesheet" type="text/css" href="/theme/style.css" />
<link rel="stylesheet" type="text/css" href="http://libs.useso.com/js/font-awesome/4.2.0/css/font-awesome.min.css" />
<script type="text/javascript" src="http://libs.useso.com/js/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="/theme/scripts/header.js"></script>
<?php if(!$tbquery->count) {
} else if($tbquery->is_singular()) {?>
<link rel="canonical" href="<?php echo the_link($the);?>" />
<script type="text/javascript">var _post_id = <?php echo $the->id; ?>;</script>
<?php }
apply_hooks('tb_head'); ?>
</head>
<body>
<div id="wrapper">
<header id="header">
<div id="header-wrapper">
<div class="desktop">
<section id="head">
<div class="center">
<img class="me home-a" src="/theme/images/me.png" />
<h6 class="home-a"><?php echo $blog_name; ?></h6>
<div class="social" style="font-size: 2em;">
<span><a title="RSS" target="_blank" href="/rss"><i class="fa fa-rss"></i></a></span>
<span><a title="GitHub" target="_blank" href="https://github.com/movsb"><i class="fa fa-github"></i></a></span>
<span><a title="QQ" target="_blank" href="http://sighttp.qq.com/authd?IDKEY=b19745b9da616a000d2db5731672dd06b575204bf1bbf9c2"><i class="fa fa-qq" style="font-size: 0.8em; position: relative; top: -1px;"></i></a></span>
</div>
</div>
</section>
<div class="footer center" id="footer">
<div class="footer-wrapper">
<div class="column about">
<h3>ABOUT</h3>
<ul>
<li><a href="/about">关于我</a></li>
<li><a href="/blog">博客程序</a></li>
<li><a href="/echo">建议反馈</a></li>
<li><a target="_blank" href="<?php echo $tbopt->get('home'),'/rss'; ?>">订阅博客</a></li>
</ul>
</div>
<?php
$links_json = $tbopt->get('links');
$links_json = '' ? '[]' : $links_json;
$links = json_decode($links_json);
if(count($links)) {?>
<div class="column links">
<h3>LINKS</h3>
<ul><?php
$i = 0;
foreach($links as &$link) {
echo '<li><a title="', $link->title, '" ',
'target="_blank" rel="nofollow" href="', $link->href, '">',
$link->name, '</a></li>', PHP_EOL;
if(++$i >= 5) break;
}
?></ul>
</div>
<?php }
?>
</div>
</div><!-- footer -->
<div class="copy center">
<div class="copyright mb">
<span>© <?php echo date('Y'),' ',$tbopt->get('author'); ?></span>
</div>
</div>
</div>
<div class="mobile">
<img class="me home-a" src="/theme/images/me.png" />
<h6 class="home-a"><?php echo $blog_name; ?></h6>
<div class="social" style="font-size: 2em;">
<span><a title="RSS" target="_blank" href="/rss"><i class="fa fa-rss"></i></a></span>
<span><a title="GitHub" target="_blank" href="https://github.com/movsb"><i class="fa fa-github"></i></a></span>
<span><a title="QQ" target="_blank" href="http://sighttp.qq.com/authd?IDKEY=b19745b9da616a000d2db5731672dd06b575204bf1bbf9c2"><i class="fa fa-qq" style="font-size: 0.78em; position: relative; top: -2px;"></i></a></span>
</div>
</div>
</div>
</header>
<section id="main">
<div id="content">