forked from wehaox/Typecho-Butterfly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost_sidebar.php
171 lines (169 loc) · 8.04 KB
/
post_sidebar.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
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<div class="aside-content" id="aside-content" role="complementary">
<div class="card-widget card-info">
<div class="card-info-avatar is-center">
<div class="avatar-img">
<img data-lazy-src="<?php $this->options->logoUrl() ?>" onerror="this.onerror=null;this.src='/usr/themes/butterfly/img/friend_404.gif'" src="<?php echo GetLazyLoad() ?>" alt="avatar">
</div>
<div class="author-info__name">
<?php $this->author(); ?>
</div>
<div class="author-info__description">
<?php $this->options->author_description() ?>
</div>
</div>
<div class="card-info-data">
<div class="card-info-data site-data is-center">
<a href="<?php $this->options->archivelink() ?>">
<div class="headline">文章</div>
<div class="length-num">
<?php Typecho_Widget::widget('Widget_Stat')->to($stat); ?><?php $stat->publishedPostsNum() ?>
</div>
</a>
<a href="<?php $this->options->tagslink() ?>">
<div class="headline">标签</div>
<div class="length-num"><?php echo tagsNum(); ?></div>
</a>
<a href="<?php $this->options->categorylink() ?>">
<div class="headline">
分类
</div>
<div class="length-num">
<?php Typecho_Widget::widget('Widget_Stat')->to($stat); ?><?php $stat->categoriesNum() ?>
</div>
</a>
</div>
</div>
<a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="<?php $this->options->author_site() ?>">
<i class="fas fa-link">
</i>
<span>
<?php $this->options->author_site_description() ?>
</span>
</a>
<?php if($this->options->author_bottom != null) : ?>
<div class="card-info-social-icons is-center"><?php $this->options->author_bottom() ?></div>
<?php elseif(!$this->options->author_bottom) : ?>
<?php endif; ?>
</div>
<div class="card-widget card-announcement"><div class="item-headline">
<i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div>
<div class="announcement_content"><?php $this->options->announcement() ?></div></div>
<?php if (!empty($this->options->AD)): ?>
<div class="card-widget">
<div class="item-headline"><i class="fa-solid fa-rectangle-ad"></i><span>广告</span></div>
<div><?php $this->options->AD() ?></div>
</div>
<?php endif; ?>
<div class="sticky_layout">
<div class="card-widget" id="card-toc">
<div class="item-headline">
<i class="fas fa-stream"></i>
<span>目录</span>
<span class="toc-percentage"></span>
</div>
<div class="toc-content">
<ol class="toc">
<?php getCatalog(); ?>
</ol>
</div>
</div>
<!--微博热搜-->
<?php if (!empty($this->options->PostSidebarBlock) && in_array('ShowWeiboHot', $this->options->PostSidebarBlock)): ?>
<div class="card-widget card-weibo wow animate__zoomIn" data-wow-duration="2s" data-wow-delay="200ms" data-wow-offset="30" data-wow-iteration="1" style="visibility: visible; animation-duration: 2s; animation-delay: 200ms; animation-iteration-count: 1; animation-name: zoomIn;">
<div class="card-content">
<div class="item-headline">
<i class="fab fa-weibo"></i>
<span>微博热搜</span></div>
<div id="weibo-container" style="width:100%;height:150px;font-size:95%">
<style>.weibo-new{background:#ff3852}.weibo-hot{background:#ff9406}.weibo-jyzy{background:#ffc000}.weibo-recommend{background:#00b7ee}.weibo-adrecommend{background:#febd22}.weibo-friend{background:#8fc21e}.weibo-boom{background:#bd0000}.weibo-topic{background:#ff6f49}.weibo-topic-ad{background:#4dadff}.weibo-boil{background:#f86400}#weibo-container{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}#weibo-container::-webkit-scrollbar{display:none}.weibo-list-item{display:flex;flex-direction:row;justify-content:space-between;flex-wrap:nowrap}.weibo-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:auto}.weibo-num{float:right}.weibo-hotness{display:inline-block;padding:0 6px;transform:scale(.8) translateX(-3px);color:#fff;border-radius:8px}</style>
<div class="weibo-list">
<?php echo weibohot() ?>
</div>
</div>
</div>
</div>
<?php endif ?>
<!--微博热搜end-->
<?php if (!empty($this->options->PostSidebarBlock) && in_array('ShowRecentPosts', $this->options->PostSidebarBlock)): ?>
<div class="card-widget card-recent-post">
<div class="item-headline">
<i class="fas fa-history"></i><span><?php _e('最新文章'); ?></span>
</div>
<div class="aside-list">
<?php $this->widget('Widget_Contents_Post_Recent')->to($contents); ?>
<?php while($contents->next()): ?>
<div class="aside-list-item">
<a class="thumbnail" href="<?php $contents->permalink() ?>" title="<?php $contents->title() ?>" >
<img onerror="this.onerror=null;this.src='https://tva1.sinaimg.cn/large/007X0Rdyly1gpaaf55n1rj30ic09u0sw.jpg'" data-lazy-src="<?php GetRandomThumbnail($contents); ?> " src="<?php echo GetLazyLoad() ?>"
alt="<?php $contents->title() ?>">
</a>
<div class="content">
<a class="title" href="<?php $contents->permalink() ?>"><?php $contents->title() ?></a>
<time datetime="<?php $this->date(); ?>" title="发表于 <?php $this->date(); ?>">
<?php $contents->date() ?></time>
</div>
</div>
<?php endwhile; ?>
</div>
</div>
<?php endif; ?>
<?php if (!empty($this->options->PostSidebarBlock) && in_array('ShowWebinfo', $this->options->PostSidebarBlock)): ?>
<div class="card-widget card-webinfo">
<div class="item-headline">
<i class="fas fa-chart-line"></i>
<span>网站资讯</span></div>
<div class="webinfo">
<div class="webinfo-item">
<div class="item-name">文章数目 :</div>
<div class="item-count">
<?php Typecho_Widget::widget('Widget_Stat')->to($stat); ?><?php $stat->publishedPostsNum() ?>
</div></div>
<div class="webinfo-item">
<div class="item-name">已运行时间 :</div>
<div class="item-count" id="runtimeshows" data-publishdate="">
<?php echo RunTime()?>
</div></div>
<div class="webinfo-item">
<div class="item-name">本站总字数 :</div>
<div class="item-count">
<?php allOfCharacters(); ?>
</div></div>
<?php if ($this->options->ShowOnlinePeople == 'on'): ?>
<div class="webinfo-item">
<div class="item-name">当前在线人数 :</div>
<div class="item-count" >
<?php onlinePeople();?>
</div></div>
<?php endif; ?>
<div class="webinfo-item">
<div class="item-name">本站总访问量 :</div>
<div class="item-count" >
<?php theAllViews();?>
</div></div>
<div class="webinfo-item">
<div class="item-name">最后更新时间 :</div>
<div class="item-count" >
<?php get_last_update(); ?>
</div></div>
</div>
</div>
<?php endif; ?>
<?php if (!empty($this->options->PostSidebarBlock) && in_array('ShowOther', $this->options->PostSidebarBlock)): ?>
<div class="card-widget">
<div class="item-headline">
<i class="fas fa-user"></i><span><?php _e('用户'); ?></span></div>
<div class="widget-list">
<?php if($this->user->hasLogin()): ?>
<div class="last"><a href="<?php $this->options->adminUrl(); ?>"><?php _e('进入后台'); ?> (<?php $this->user->screenName(); ?>)</a></div >
<div class="last"><a href="<?php $this->options->logoutUrl(); ?>"><?php _e('退出'); ?></a></div >
<?php else: ?>
<div class="last"><a href="<?php $this->options->adminUrl('login.php'); ?>"><?php _e('登录'); ?></a></div >
<?php endif; ?>
<div class="last"><a href="<?php $this->options->feedUrl(); ?>"><?php _e('文章 RSS'); ?></a></div >
<div class="last"><a href="<?php $this->options->commentsFeedUrl(); ?>"><?php _e('评论 RSS'); ?></a></div >
</div >
</div>
<?php endif; ?>
</div>
</div><!-- end #sidebar -->