« $title »"; echo ""; //echo ""; if($_GET["link"] != ""){ echo ""; }else{ 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 = ""; } */ if($cm == $this_month && $d==$this_day){//「本日」の場合 $tag1 = ""; $tag2 = ""; }else{ $tag1 = ""; $tag2 = ""; } echo "\n"; } echo "\n"; } echo "
« $title »
« $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"; } //文字列ハンドラ function CharacterHandler($parser,$text){ global $buffer; $buffer .= $text; } //開始ハンドラ function StartHandler($parser,$name,$attrib){ global $itemcnt; if($name == "channel"){ $channelcnt = 0; } if($name == "item"){ $itemcnt = $itemcnt + 1; } } //終了ハンドラ function EndHandler($parser,$name){ global $buffer,$itemcnt,$data; $buffer = mb_convert_encoding($buffer,"SJIS","UTF-8"); switch($name){ case "title":$data['title'][$itemcnt]=$buffer;break; case "link":$data['url'][$itemcnt]=$buffer;break; case "description":$data['desc'][$itemcnt]=$buffer;break; case "dc:date":$data['date'][$itemcnt]=$buffer;break; case "dc:subject":$data['subject'][$itemcnt]=$buffer;break; case "content:encoded":$data['content'][$itemcnt]=$buffer;break; default :break; } $buffer = ""; } //ヘッダー function showheader(){ global $channelcnt,$channel; $op = explode("#S#",$channel[$channelcnt]); echo "
$op[2]
"; } //リンク function showlink(){ $fn = "link.txt"; $lines = file($fn); echo "

rss links

"; echo ""; } //エントリー function showentry($key=""){ global $itemcnt,$items; echo "

recent entries

"; echo ""; } //概要 function showdesc($no,$key=""){ global $itemcnt,$items; if($no != ""){//該当エントリーのナンバリング指定あり $op = explode("#S#",$items[$no]); //$link = "$op[2]"; $link = "$op[2]"; if($op[4] != ""){//時間情報 $str = << $link
$op[4] $op[3] EOL; }else{ $str = << $link $op[3] EOL; } if($key != ""){ if(mbereg($key,$str)){ echo "$str"; } }else{ echo "$str"; } }else{//該当エントリーのナンバリング指定なし for($j=1; $j<=$itemcnt; $j++){ $op = explode("#S#",$items[$j]); //$link = "$op[2]"; $link = "$op[2]"; if($op[4] != ""){ $str = << $link
$op[4] $op[3] EOL; }else{ $str = << $link $op[3] EOL; } if($key != ""){ if(mbereg($key,$str)){ echo "$str"; } }else{ echo "$str"; } } } } /*コンテンツ function showcontent($c=1,$key=""){ global $itemcnt,$items; $op = explode("#S#",$items[$c]); $str = << $op[1] - $op[2]
$op[4] $op[5] EOL; if($key != ""){ $str = mb_ereg_replace($key,"$key",$str); } echo "$str"; } */ //初期化 session_start(); //$file = "http://aprilsnow.ciao.jp/blog/index.rdf"; //リンク if($_GET["link"] != ""){ $file = $_GET["link"]; }else{ $file = "http://aprilsnow.ciao.jp/blog/index.rdf"; } $parser = xml_parser_create(); xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,false);//大文字変換無効化 xml_set_element_handler($parser,"StartHandler","EndHandler");//開始 & 終了ハンドラのセット xml_set_character_data_handler($parser,"CharacterHandler");//文字データハンドラのセット if(!($fp = fopen($file,'r'))){ echo "ファイルが開けません"; exit(); } while($strbuf = fread($fp,3000)){ xml_parse($parser,$strbuf,feof($fp)); } fclose($fp); xml_parser_free($parser); //チャンネル、アイテム $str = ""; $str .= "{$data['url'][$channelcnt]}#S#{$data['date'][$channelcnt]}#S#"; $str .= "{$data['title'][$channelcnt]}#S#{$data['desc'][$channelcnt]}#S#"; $channel[$channelcnt] = $str; for($j=1; $j<=$itemcnt; $j++){ $str = ""; $str .= "{$data['url'][$j]}#S#{$data['subject'][$j]}#S#"; $str .= "{$data['title'][$j]}#S#{$data['desc'][$j]}#S#"; $str .= "{$data['date'][$j]}#S#{$data['content'][$j]}"; $items[$j] = $str; } //表示記事番号 if($_GET["no"] != ""){ $no = $_GET["no"]; }else{ //$no = 1; $no = ""; } //検索語 if($_GET["cmd"] != ""){ $key = $_GET["key"]; $_SESSION['key'] = $key; }else{ //$key = $_SESSION['key']; unset($_SESSION['key']); } $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