forked from dnartz/mylist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
posts_table.php
61 lines (59 loc) · 1.18 KB
/
posts_table.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
<?php
function posts_table($arcresults, $title = '所有文章')
{
global $wp_locale;
?><h2><b><?= $title ?></b></h2>
<table id="arc"><?php
if ($arcresults)
{
$last_year = 0;
$last_month = 0;
foreach ($arcresults as $arcresult)
{
$year = $arcresult->year;
$month = $arcresult->month;
if ($year != $last_year)
{
$last_year = $year;
$last_month = 0;
?>
<tr class=year>
<th>
<br/><?php echo $arcresult->year; ?>
</th>
</tr>
<?php
}
if ($month != $last_month)
{
$last_month = $month;
?>
<tr class=archive>
<th><?php echo $wp_locale->get_month($arcresult->month); ?></th>
<td></td>
</tr>
<?php
}
?>
<tr class=archive>
<th><?php echo $arcresult->dayofmonth; ?></th>
<td id=p <?php echo $arcresult->ID; ?>><a
href="<?php bloginfo('url');
echo
'/' .
$arcresult->ID .
'/' .
$arcresult->post_name; ?>"><?php echo strip_tags(apply_filters('the_title',
$arcresult->post_title)); ?></a>
</td>
</tr>
<?php
}
echo '</table>';
}
else
{
echo '<h3>无</h3>';
}
}
?>