« $title »"; echo ""; //echo ""; echo ""; echo "\n"; for($x=0; $x<7; $x++){ echo ""; } echo "\n"; for($y=0; $y<6; $y++){ echo ""; for($x=0; $x<7; $x++){ $d = $y*7+$x+1-$wday;//日付け /* if($cm == $this_month && $d==$this_day){ $quote1 = "["; $quote2 = "]"; }else{ $quote1 = ""; $quote2 = ""; } */ $aim = $year.$month; $path = "./data"; $dir_name = dir($path); while($file_name = $dir_name->read()){ $files[] = $file_name; } rsort($files); foreach($files as $file){ if(strstr($file,$aim) != ""){ $list[] .= $file;//ファイル名 $days[] .= substr($file,6,2);//投稿日(二桁表記)。ファイル名より抽出... } } $d2 = sprintf("%02d",$d);//「投稿日」との比較のため、二桁表記の「日付け」も準備する。 $path = sprintf("entry.php?path=./data/%04d%02d%02d.txt",$year,$month,$d);//permalink url if(($cm == $this_month && $d==$this_day) && (is_array($days) && in_array($d2,$days))){//「本日」かつ「投稿日」の場合 $tag1 = ""; $tag2 = ""; }elseif($cm == $this_month && $d==$this_day){//「本日」の場合 $tag1 = ""; $tag2 = ""; }elseif(is_array($days) && in_array($d2,$days)){//「投稿日」の場合 $tag1 = ""; $tag2 = ""; }else{//「本日」以外、かつ「投稿日」以外、の場合 $tag1 = ""; $tag2 = ""; } echo "\n"; } echo "\n"; } echo "
« $title »
« $title »
$wtxt[$x]
"; $param = sprintf("date=%04d%02d%02d",$cy,$cm,$d); $addr = sprintf("%s?%s",$self,$param); if($d>0 && $d<($maxd+1)){ //echo "{$quote1}{$d}{$quote2}"; echo "{$tag1}{$d}{$tag2}"; }else{echo " ";}; echo "
\n"; } /*トップページのみ、「1ページ表示件数」を指定する場合 function listup($year,$month){ $num = 10;//1ページ表示件数 $now = date("Y").date("m");//現、「年月」 $aim = $year.$month;//表示、「年月」 $path = "./data"; $dir_name = dir($path); while($file_name = $dir_name->read()){ $files[] = $file_name; } rsort($files); if($now != $aim){//今月以外の表示の場合 foreach($files as $file){ if(strstr($file,$aim) != "" && strstr($file,"txt") != ""){ $list[] .= $file; } } }else{//今月の表示の場合 $i = 0; foreach($files as $file){ if(strstr($file,"txt") != ""){ $list[] .= $file; $i++; if($i == $num){ break; } } } } */ function listup($year,$month){ $num = 10;//1ページ表示件数 $now = date("Y").date("m");//現、「年月」 $aim = $year.$month;//表示、「年月」 $path = "./data"; $dir_name = dir($path); while($file_name = $dir_name->read()){ $files[] = $file_name; } rsort($files); foreach($files as $file){ if(strstr($file,$aim) != "" && strstr($file,"txt") != ""){ $list[] .= $file; } } if($list != ""){ for($i=0; $i".$title.""; echo "

".$content."


"; } }else{ $month = date("n",mktime(0,0,0,$month,1,$year));//月(1桁) echo "Not found"; echo "

{$month}月の投稿はありません。


"; } } function archives(){ $path = "./data"; $dir_name = dir($path); while($file_name = $dir_name->read()){ if(strstr($file_name,".txt") != ""){ $files[] = $file_name; } } rsort($files); foreach($files as $file){ $archive = substr($file,0,6); $list[] .= $archive; } $list = array_unique($list);//重複する要素を排除し、 $list = array_values($list);//連番のインデックスに再設定... echo "

archives

"; echo ""; } function recent_entries(){ $path = "./data"; $dir_name = dir($path); while($file_name = $dir_name->read()){ if(strstr($file_name,".txt") != ""){ $files[] = $file_name; } } rsort($files); foreach($files as $file){ $list[] .= $file; } echo "

recent entries

"; echo ""; } $self = $HTTP_SERVER_VARS['PHP_SELF']; if($_GET['date'] == ""){ $year = date("Y"); $month = date("m"); $date = date("d"); }else{ $year = substr($_GET['date'],0,4); $month = substr($_GET['date'],4,2); $date = substr($_GET['date'],6,2); } $fn = "summary.txt"; $all = file_get_contents($fn); $parts = explode("###",$all); $mytitle = $parts[0]; $myurl = $parts[1]; $mydescription = $parts[2]; $link1 = sprintf("%s?date=%04d%02d%02d",$self,$year,$month-1,$date); $link2 = sprintf("%s?date=%04d%02d%02d",$self,$year,$month+1,$date); ?>
skip to content
skip to navigation