<?php
require_once __DIR__ . '/maikitt_compat/bootstrap.php';
//基本公開設定を取得
$d_01_array = file('./data/config_01.dat');
foreach($d_01_array as $d_01_array);
$d_01_array = explode("&&",($d_01_array ?? ''));
//
//indexページ設定を取得
$index_ini_array = file('./data/index_config.dat');
foreach($index_ini_array as $index_ini_array);
$index_ini_array = explode("&&",($index_ini_array ?? ''));
//
// ドメイン名をpathより取得して設定する。
$domain = file('./hidden/path.dat');
foreach($domain as $domain);
//
//-------------------------------------------------------------------------------------------------------------------------------// 
echo"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";

echo"<feed version=\"0.3\" xmlns=\"http://purl.org/atom/ns#\"\n";
echo"xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n";
echo"xmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\"\n";
echo"xml:lang=\"ja\">\n";	
echo"<title>".$index_ini_array[10]."の更新情報／".$d_01_array[4]."</title>\n";
echo"<link rel=\"alternate\" type=\"text/html\" href=\"http://".$domain."\" />\n";
echo"<author>\n<name>".$d_01_array[4]."</name>\n</author>\n";
//////////////////////////////////////////////////////////////////////
$Data=file('./data/index_rn_data.dat');
for($i=0;(maikitt_compare($i, maikitt_count($Data)) < 0);$i++){
	$line=explode("&&",($Data[$i] ?? ''));
	if((maikitt_compare(trim(($line[10] ?? '')), "true") != 0)){
	echo"<entry>\n";
	echo"<title>";
	$title = mb_strimwidth($line[1], 0, 80, "…","utf-8");	
	$title = preg_replace('/@@/', "", ($title ?? ''));
	$title = preg_replace('/＊＊/', "", ($title ?? ''));
	$title = preg_replace('/&nbsp;/', "", ($title ?? ''));
	$title = strip_tags(($title ?? ''));	
	if(!$title){ echo strip_tags(($line[1] ?? '')); }
	echo $title;
	echo "</title>\n";
	//↓送信文字をクエリ文字に変換
	$URL = rawurlencode(($title ?? '')); 
	echo"<link rel=\"alternate\" type=\"text/html\" href=\"http://".$domain."/index_detail.html?num=".$line[0]."\" />\n";	
	$date = $line[8];
	$date = preg_replace('/\//', "-", ($date ?? ''));
	$date = preg_replace('/ （/', "T", ($date ?? ''));
	$date = preg_replace('/）/', "Z", ($date ?? ''));	
	echo "<date>".$date."</date>\n";	
	$id = $line[0];	
	maikitt_array($line)[2] = preg_replace('/&nbsp;/'," ",($line[2] ?? ''));
	$summary = mb_strimwidth($line[2], 0, 200, "…","utf-8");	
	$summary = preg_replace('/@@/',"",($summary ?? ''));
	$summary = preg_replace('/＊＊/',"",($summary ?? ''));
	$summary = preg_replace('/\&nbsp\;/',"",($summary ?? ''));
	$summary = preg_replace('/\[hide\]/',"",($summary ?? ''));
	$summary = preg_replace('/\[(\d+)\]/',"",($summary ?? ''));
	$summary = strip_tags(($summary ?? ''));
	echo"<id>tag:".$domain."-information,".$id."</id>\n";
	echo"<summary>".$summary."</summary>\n";
	echo"<issued>".$date."</issued>\n";
	echo"<modified>".$date."</modified>\n";
	echo"<published>".$date."</published>\n";
	echo"</entry>\n";
	}
}
//////////////////////////////////////////////////////////////////////
echo"</feed>";
print <<< END_OF_HTML
END_OF_HTML
?>