-
Notifications
You must be signed in to change notification settings - Fork 36
/
categories.php
98 lines (69 loc) · 4.4 KB
/
categories.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
<?php
/**
* categories
*
* @package custom
*
*/
$this->need('header.php');
?>
<div id="main" data-behavior="<?php $this->options->css(); ?>"
class="
hasCoverMetaIn
">
<div id="categories-archives" class="main-content-wrap">
<?php Typecho_Widget::widget('Widget_Stat')->to($stat); ?>
<h4 class="archive-result text-color-base text-xlarge"> </h4>
<section>
<?php $this->widget('Widget_Metas_Category_List')->to($categorys); ?>
<?php while($categorys->next()): ?>
<?php if ($categorys->levels === 0): ?>
<?php $children = $categorys->getAllChildren($categorys->mid); ?>
<?php if (empty($children)) { ?>
<a href="#posts-list-<?php $categorys->slug(); ?>" class="tag tag--primary tag--small t-link" data-category="<?php $categorys->name(); ?>" ><?php $categorys->name(); ?>(<?php $categorys->count(); ?>)
</a>
<?php } ?>
<?php endif; ?>
<?php endwhile; ?>
<?php $this->widget('Widget_Metas_Category_List')->to($categorys); ?>
<?php while($categorys->next()): ?>
<?php if ($categorys->levels === 0): ?>
<?php $children = $categorys->getAllChildren($categorys->mid); ?>
<?php if (empty($children)) { ?>
<?php } else { ?>
<br>
<a class="tag tag--primary tag--small t-link" data-category="<?php $categorys->name(); ?>" onclick="var fu = document.getElementById('<?php $categorys->name(); ?>'); if (fu.style.display === 'none') {fu.style.display='inline';} else {fu.style.display='none'}" target="_blank"><?php $categorys->name(); ?> <i class="fa fa-chevron-circle-right"></i>
</a>
<div id="<?php $categorys->name(); ?>" style="display: none;">
<?php foreach ($children as $mid) { ?>
<?php $child = $categorys->getCategory($mid); ?>
<a href="#posts-list-<?php echo $child['slug']; ?> " class="tag tag--primary tag--small t-link" data-category="<?php echo $child['name']; ?>" ><?php echo $child['name']; ?>(<?php echo $child['count']; ?>)</a>
<?php } ?>
</div>
<?php } ?>
<?php endif; ?>
<?php endwhile; ?>
</section>
<section class="boxes" id="disqus_thread">
<?php $this->widget('Widget_Metas_Category_List')->to($categories); ?>
<?php while ($categories->next()): ?>
<?php if(count($categories->children) === 0): ?>
<?php $this->widget('Widget_Archive@category-' . $categories->mid, 'pageSize=10000&type=category', 'mid=' . $categories->mid)->to($posts); ?>
<div id="posts-list-<?php $categories->name(); ?>" class="archive box" data-category="<?php $categories->name(); ?>">
<h4 class="archive-title">
<a href="<?php $categories->permalink(); ?>" class="link-unstyled" id="posts-list-<?php $categories->slug(); ?>"><?php $categories->name(); ?></a>
</h4>
<ul class="archive-posts">
<?php while ($posts->next()): ?>
<li class="archive-post">
<a class="archive-post-title" href="<?php $posts->permalink(); ?>"><?php $posts->title(40); ?></a>
<span class="archive-post-date"><?php $posts->date('M d,Y'); ?></span>
</li>
<?php endwhile; ?>
</ul>
</div>
<?php else: ?>
<?php endif; ?>
<?php endwhile; ?>
</section>
</div> <?php $this->need('footer.php');?>