need('header.php'); ?>
publishedPostsNum)->to($archives); $year = 0; $mon = 0; $output = ''; while ($archives->next()) { $year_tmp = date('Y', $archives->created); $mon_tmp = date('m', $archives->created); $day_tmp = date('d', $archives->created); // 检查是否需要新的时间线项目 if ($year != $year_tmp || $mon != $mon_tmp) { // 如果不是第一个项目,先关闭之前的ul if ($year > 0 && $mon > 0) { $output .= '
'; } $year = $year_tmp; $mon = $mon_tmp; // 开始新的时间线项目 $output .= '
'; $output .= '
'; $output .= '
'; $output .= '

' . $year . '-' . $mon . '

'; $output .= '
'; } echo $output; ?>
need('footer.php'); ?>