-
Notifications
You must be signed in to change notification settings - Fork 0
/
page.archives.php
178 lines (118 loc) · 3.7 KB
/
page.archives.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
178
<?php if ( !defined( 'HABARI_PATH' ) ) { die('No direct access'); } ?>
<?php
$theme->display('header');
?>
<h1><?php echo $page_title; ?></h1>
<div id="archives_page">
<?php
echo '<div class="years span-17 clear last">';
$years_i = 1;
foreach ( $archives as $year => $months ) {
$class = array();
if ( $years_i == 1 ) {
$class[] = 'first-child';
}
if ( $years_i == count( $archives ) ) {
$class[] = 'last-child';
}
$class = implode( ' ', $class );
echo '<span class="year span-1 ' . $class . '">' . $year . '</span>';
echo '<div class="months span-16 last">';
$months_i = 1;
foreach ( $months as $month => $days ) {
$class = array();
if ( $months_i == 1 ) {
$class[] = 'first-child';
}
if ( $months_i == count( $months ) ) {
$class[] = 'last-child';
}
$class = implode( ' ', $class );
echo '<span class="month span-1 ' . $class . '">' . HabariDateTime::date_create()->set_date( $year, $month, 1 )->format('M') . '</span>';
echo '<div class="days span-15 last">';
$days_i = 1;
foreach ( $days as $day => $posts ) {
$class = array();
if ( $days_i == 1 ) {
$class[] = 'first-child';
}
if ( $days_i == count( $days ) ) {
$class[] = 'last-child';
}
$class = implode( ' ', $class );
echo '<span class="day span-1">' . $day . '</span>';
echo '<div class="posts ' . $class . ' span-14 last">';
$posts_i = 1;
foreach ( $posts as $post ) {
$class = array();
if ( $posts_i == 1 ) {
$class[] = 'first-child';
}
if ( $posts_i == count( $posts ) ) {
$class[] = 'last-child';
}
$class = implode( ' ', $class );
echo '<span class="post span-14 ' . $class . '"><a href="' . $post->permalink . '">' . $post->title . '</a></span>';
$posts_i++;
}
echo '</div>';
$days_i++;
}
echo '</div>';
$months_i++;
}
echo '</div>';
$years_i++;
}
echo '</div>';
/*
echo '<ul class="yearslast">';
foreach ( $archives as $year => $months ) {
echo '<li class="year">' . $year;
echo '<ul class="monthslast">';
foreach ( $months as $month => $days ) {
echo '<li class="month">' . HabariDateTime::date_create()->set_date( $year, $month, 1 )->format('M');
echo '<ul class="days">';
$days_i = 1;
foreach ( $days as $day => $posts ) {
$class = array();
if ( $days_i == 1 ) {
$class[] = 'first';
}
if ( $days_i == count( $days ) ) {
$class[] = 'last';
}
$class = implode( ' ', $class );
echo '<li class="day ' . $class . '">' . $day;
echo '<ul class="posts">';
foreach ( $posts as $post_num => $post ) {
$class = array();
if ( $post_num == 0 ) {
$class[] = 'first';
}
if ( $post_num == count( $posts ) - 1 ) {
$class[] = 'last';
}
$class = implode( ' ', $class );
echo '<li class="post ' . $class . '">';
echo '<a href="' . $post->permalink . '" class="' . $class . '">' . $post->title . '</a>';
echo '</li>';
}
echo '</li>';
echo '</ul>';
$days_i++;
}
echo '</li>';
echo '</ul>';
}
echo '</li>';
echo '</ul>';
}
echo '</ul>';
*/
?>
</div>
<?php
$theme->display( 'page_navigation' );
$theme->display('footer');
?>