文章归档

-

- 共有 to($stat);?>publishedPostsNum() ?> 篇文章, 文字 -

+ to($stat);?>publishedPostsNum() ?> 篇文章, 文字。 +
widget('Widget_Contents_Post_Recent', 'pageSize=10000')->to($archives); - $year = 0; - $mon = 0; - $i = 0; - $j = 0; + $year = 0; $mon = 0; while ($archives->next()): - if (empty($archives->title) || $archives->title == " ") continue; - $year_tmp = date('Y',$archives->created); - $mon_tmp = date('m',$archives->created); - $y = $year; - $m = $mon; - if ($mon != $mon_tmp && $mon > 0) $output .= ''; - if ($year != $year_tmp && $year > 0) $output .= ''; - if ($year != $year_tmp) { - $year = $year_tmp; - $output .= '

'. $year .'

    '; - //输出年份 - } - $output .= '
  • '. $archives->title .''; - if ($archives->commentsNum != 0): $output .= ' '.$archives->commentsNum.''; endif; - $output .= '
  • '; - //输出文章日期和标题 + if (empty($archives->title) || $archives->title == " ") continue; + $year_tmp = date('Y',$archives->created); + $mon_tmp = date('m',$archives->created); + if ($year != $year_tmp && $year > 0) $output .= '
'; + if ($year != $year_tmp): + $year = $year_tmp; + $output .= '

'. $year.'

    '; + endif; + $output .= '
  • '. $archives->title .''; + if ($archives->commentsNum > 0) $output .= ' '.$archives->commentsNum.''; + $output .= '
  • '; endwhile; - $output .= '
'; + $output .= ''; echo $output; ?>