-
Notifications
You must be signed in to change notification settings - Fork 0
/
post.php
177 lines (175 loc) · 5.99 KB
/
post.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
<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
$this->need('header.php');
?>
<script type="text/javascript">
$(function(){
/*鼠标移入和移出事件*/
$('.menu li').hover(function(){
$(this).find('.two').show();
/*鼠标移入和移出事件*/
$('.two li').hover(function(){
var content=$(this).find('.hide li:first small').text();
if(content != null && content.length != 0){
$(this).find('.hide').show();
}
},function(){
$(this).find('.hide').hide();
});
},function(){
$(this).find('.two').hide();
});
});
</script>
<style>
#nav ul.menu li ul{
position: relative;
top: 0px;
background: #fff;
border: 1px solid #eee;
border-radius: 0 0 3px 3px;
}
#nav ul.menu li ul li{
position: relative;
}
#nav ul.menu li ul li .hide{
position: relative;
top: 0px;
left: 0px;
border: 1px solid #eee;
border-radius: 0 0 3px 3px;
}
.two,.hide{
display:none;
}
</style>
<style>
a{
color:#000;
}
.boxes {
width: 180px;
}
.boxes .box {
height: 60px;
color: #eee;
line-height: 60px;
text-align: center;
font-weight: bold;
transition: all .2s ease;
}
.boxes .box img{
width:100%;
height:100%;
}
.boxes .box:hover {
font-size: 250%;
transform: rotate(360deg);
}
.cat-nav{
width:0.9;
margin:0px auto 10px auto;
background-color:#eeeeee;
}
.cat-nav button{
background-color:#eeeeee;
font-size:90%;
}
@media screen and (max-width: 0.9;) {
.cat-nav {width: 100%;}
}
</style>
<div class="am-g am-g-fixed" style="word-wrap:break-word;">
<div class="am-u-md-9 am-u-md-push-3">
<div class="cat-nav am-round" data-am-sticky="{top:60}">
<div data-am-widget="tabs">
<ul class="am-tabs-nav">
<li><a class="am-btn am-radius" href="<?=$this->options ->siteUrl();?>"><small>全部</small></a></li>
<li id="nav" class="am-dropdown" data-am-dropdown>
<a class="am-dropdown-toggle am-btn am-radius" data-am-dropdown-toggle><small>更多</small><span class="am-icon-caret-down"></span></a>
<ul class="am-dropdown-content menu">
<?php
$this->widget('Widget_Metas_Category_List')->to($categories);
while($categories->next()){
if($categories->parent!=0){
continue;
}
?>
<li>
<a href="<?php echo $categories->permalink;?>" title="<?php echo $categories->name;?>"><small><?php echo $categories->name;?></small></a>
<?php
$children = $categories->getAllChildren($categories->mid);
if(count($children)>0){
?>
<ul class="two">
<?php
foreach ($children as $mid) {
$child = $categories->getCategory($mid);
?>
<li>
<a href="<?php echo $child['permalink'];?>" title="<?php echo $child['name'];?>"><small><?php echo $child['name']; ?></small></a>
<ul class="hide">
<?php
$threecate = $categories->getAllChildren($child['mid']);
foreach ($threecate as $three) {
?>
<li><a href="<?php echo $three['permalink'];?>" title="<?php echo $three['name'];?>"><small><?php echo $three['name']; ?></small></a></li>
<?php
}
?>
</ul>
</li>
<?php
}
?>
</ul>
<?php
}
?>
</li>
<?php
}
?>
</ul>
</li>
<li>
<form class="am-fr" id="search-header" method="post" action="<?php $this->options ->siteUrl(); ?>" name="search-header">
<input class="am-form-field am-round am-input-sm" type="text" name="s" placeholder="搜文章" />
</form>
</li>
</ul>
</div>
</div>
<section id="content">
<ol class="am-breadcrumb" style="background-color:#fff;">
<li><a href="<?=$this->options ->siteUrl();?>" class="am-icon-home">首页</a></li>
<li><?php $this->category(','); ?></li>
<li class="am-active"><?php $this->title(); ?></li>
</ol>
<div class="am-cf am-article" style="padding:10px;background-color:#fff;">
<h6><?php $this->title(); ?></h6>
<div>
<small>
<a href="<?php $this->author->permalink(); ?>" rel="author"><?php $this->author(); ?></a> 发布 | <?php $this->date('Y-m-d'); ?> | <?php $this->category(','); ?> | 阅读数:<?php get_post_view($this); ?> | 评论数:<?php $this->commentsNum('0', '1', '%d'); ?> | 标签:<?php $this->tags(',', true, '<a>没有标签</a>'); ?>
</small>
</div>
<p>
<?php parseContent($this); ?>
</p>
<p>
<?php
preg_match_all( "/<img.*?src=[\'|\"](.*?)[\'|\"].*?[\/]?>/", $this->content, $sharematche );
$sharecontent=subString(str_replace('', '', strip_tags($this->content)),0,140);
?>
<small>分享至:</small>
<a href="http://service.weibo.com/share/share.php?url=<?=curPageURL();?>&title=<?php echo $this->title(); ?>" onclick="window.open(this.href, 'share', 'width=550,height=335');return false;" ><img src="<?php $this->options->themeUrl('assets/images/icon_sina.png'); ?>" alt="" /></a>
<a href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=<?=curPageURL();?>&title=<?php echo $this->title(); ?>&site=<?=$this->options ->siteUrl();?>&desc=这是一篇神奇的文章&summary=<?php echo $sharecontent; ?>&pics=<?php if(count($sharematche[1])>0){echo $sharematche[1][0];}?>" onclick="window.open(this.href, 'share', 'width=550,height=335');return false;" ><img src="<?php $this->options->themeUrl('assets/images/icon_qzone.png'); ?>" alt="" /></a>
<a href="http://connect.qq.com/widget/shareqq/index.html?url=<?=curPageURL();?>&title=<?php echo $this->title(); ?>&site=<?=$this->options ->siteUrl();?>&desc=这是一篇神奇的文章&summary=<?php echo $sharecontent; ?>&pics=<?php if(count($sharematche[1])>0){echo $sharematche[1][0];}?>" onclick="window.open(this.href, 'share', 'width=550,height=335');return false;" ><img src="<?php $this->options->themeUrl('assets/images/icon_qq.png'); ?>" alt="" /></a>
</p>
</div>
<?php $this->need('comments.php'); ?>
</section>
</div>
<?php $this->need('sidebar.php'); ?>
</div>
<?php $this->need('footer.php'); ?>