-
Notifications
You must be signed in to change notification settings - Fork 1
/
sidebar-filter.php
67 lines (67 loc) · 3.12 KB
/
sidebar-filter.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
<div class="post-sidebar-filter">
<div class="post-filter-box">
<div class="filter-header">
<img class="expand-topic-filter expand-filter" src="<?php bloginfo('template_directory'); ?>/images/arrow-expand.png">
<img class="collapse-topic-filter collapse-filter" src="<?php bloginfo('template_directory'); ?>/images/arrow-collapse.png">
按<a href="">专题</a>筛选
</div>
<div class="topic-filter filter-content">
<ul>
<?php
$page_url = preg_replace('/page\/[0-9]+\//','',$_SERVER['REQUEST_URI']);
//echo $page_url;
global $issue_array;
foreach( (array)$issue_array as $key => $issue ) :
echo ' <li><a class="issue-filter-a" href="'.add_query_arg('issue',$issue_array[$key], $page_url).'">'.$issue.'</a></li>';
endforeach;
?>
</ul>
<div class="clear"></div>
<p style="margin-bottom:35px;margin-top:5px;"><a href="<?php echo preg_replace('/(&|\?)(issue=.*)(&|$)/','$3',$page_url); ?>" style="color:#b9b9b9;font-size:12px;float:right;" class="issue-all-a">不限专题</a></p>
</div>
</div>
<div class="post-filter-box">
<div class="filter-header">
<img class="expand-author-filter expand-filter" src="<?php bloginfo('template_directory'); ?>/images/arrow-expand.png">
<img class="collapse-author-filter collapse-filter" src="<?php bloginfo('template_directory'); ?>/images/arrow-collapse.png">
按<a href="">作者</a>筛选
</div>
<div class="author-filter filter-content">
<ul>
<?php
global $authorid_array;
$author_array = array();
foreach ( $authorid_array as $authorid ) {
$user_info = get_userdata($authorid);
array_push( $author_array, $user_info->display_name);
}
foreach( (array)$author_array as $key => $author ) :
echo ' <li><a class="author-filter-a" href="'.add_query_arg('authorid',$authorid_array[$key], $page_url).'">'.$author.'</a></li>';
endforeach;
?>
</ul>
<div class="clear"></div>
<p style="margin-bottom:35px;margin-top:5px;"><a href="<?php echo preg_replace('/(&|\?)authorid=[0-9]+/','',$page_url); ?>" style="color:#B9B9B9;font-size:12px;float:right;" class="author-all-a">所有作者</a></p>
</div>
</div>
<div class="post-filter-box" style="border-bottom: #b9b9b9 dashed 1px;">
<div class="filter-header">
<img class="expand-quarter-filter expand-filter" src="<?php bloginfo('template_directory'); ?>/images/arrow-expand.png">
<img class="collapse-quarter-filter collapse-filter" src="<?php bloginfo('template_directory'); ?>/images/arrow-collapse.png">
按<a href="">季度</a>筛选
</div>
<div class="quarter-filter filter-content">
<ul>
<?php
global $quarter_array;
foreach( $quarter_array as $key => $quarter ) :
echo ' <li><a class="quarter-filter-a" href="'.add_query_arg('quarter',$quarter_array[$key],$page_url).'">'.$quarter.'</a></li>';
endforeach;
?>
</ul>
<div class="clear"></div>
<p style="margin-bottom:35px;margin-top:5px;"><a href="<?php echo preg_replace('/(&|\?)(quarter=[0-9].*)(&|$)/','$3',$page_url); ?>" style="color:#b9b9b9;font-size:12px;float:right;" class="quarter-all-a">全部季度</a></p>
</div>
</div>
</div>
<script type="text/javascript" src="<?php bloginfo('template_directory');?>/js/filter_box.js"></script>