header("HTTP/1.1 200 OK");
header("Content-Language: JA");
header("Content-Type: text/html; charset=utf-8");
header("Content-Script-Type: text/javascript");
header("content-style-type: text/css");
//インクルード
require('config/all_config.php');
ini_set("include_path", PLAMO_DIR."/libs");
ini_set("display_errors","on");
error_reporting(E_ALL ^ E_NOTICE);
//定数
define('TEMPLATE_LITE_DIR', 'Smarty/src/');
define('PUBLISH_CHARSET', 'UTF-8');
require('Smarty/libs/Smarty.class.php');
if($_GET['archive'] == index){
$page = "全アーカイブ";
$getar = "index";
$pageurl = BLOG_URL."daily/archive_index.html";
}else{
$a[1] = substr($_GET['archive'],0,4)."年";
$a[2] = substr($_GET['archive'],4,6)."月";
$page = join("",$a)."アーカイブ";
$getar = $_GET['archive'];
$pageurl = BLOG_URL."daily/archive_".$_GET['archive'].".html";
}
$pagetitle = SITE_NAME.":".$page;
$cache_id = "archive|".md5($page);
$smarty = new Smarty;
$smarty->caching = true;
$smarty->cache_lifetime = 86400;
$smarty->template_dir = SITE_PATH."/templates";
$smarty->compile_dir = SITE_PATH."/templates_c";
$smarty->cache_dir = SITE_PATH."/cache";
if($smarty->is_cached('archive.html',$cache_id)) {
$smarty->display('archive.html',$cache_id);
}else{
/*
//////////////////////////////////////
//前処理
//////////////////////////////////////
*/
if($getar == index){
function getMonth($month){
return mktime(date("H"),date("i"),date("s"),date("m")-$month,date("d"),date("Y"));
}
$count = 2;
$i = 0;
while($i<=11){
$file = date("Ym",getMonth($i));
if(file_exists("daily/archive_".$file.".php")){
if($count > 4)$count = 4;
$ardata = @join("",@file("daily/archive_".$file.".php"));
$data .= "