<?php
/*
+--------------------------------------------------------+
| O-BLOG - PHP Blog System                               |
| Copyright (c) 2004 phpBlog.CN                          |
| Support : http://www.phpBlog.cn                        |
| Author : ShiShiRui (shishirui@163.com)                 |
|--------------------------------------------------------+
*/
//error_reporting(7);
include_once("admin/cache.php");


if (!defined('BLOG')) {	die('Access Denied');}

if (!file_exists("cache/archive_t.php"))
{
	cache_archive_t();
}

require("cache/archive_t.php");

$archive_data = "<ul>";
foreach($archive_t as $year => $months)
{
	$year_n = 0;
	$month_str = ($year == date('Y'))?"<ul>":"<ul style='display:none'>";
	foreach($months as $month => $num)
	{
		$month_z = ($month < 10)?'0'.$month:$month;
		$month_str .= "<li class='month'><a href='{$blogurl}index.php?date={$year}{$month_z}'>$month 月($num)</a></li>";
		$year_n+=$num;
	}
	$month_str .="</ul>";
	$archive_data.= "<li class='year'><a href='javascript:void(0);' onclick='open_child(this)'>$year 年($year_n)</a>$month_str</li>";
}
$archive_data .= "</ul>";
?>