お知らせ一覧
';
echo 'alert('.json_encode($data).')';
echo '';
}
function console_log($data){
echo '';
}
?>
タグのhrefに指定されているファイルを保持する配列
$hrefFileList = array();
foreach($years as $year) {
// ファイルポインタをオープン
$file = fopen("../../shared/inc/inc_information.html", "r");
if ($file) {
// 出力用フラグ
$isRead = false;
$yearflg = false;
// 更新アイコン初期化
$renewIco = 0;
// と とを格納する一時バッファ
$tempBuffer = array();
// 最終更新日保持変数
$lastUpdated = "";
while ($line = fgets($file)) {
// 文字列の後ろの改行(\n)を削除
$line = trim($line);
// 先頭#の文章又は空行を飛ばす
if (preg_match('/^#.*/', $line) || $line == "" ) {
continue;
}
// コメント開始検知
if (preg_match('//', $line) ) {
// コメントフラグOFF
$commentOut = false;
}
// コメントフラグONの際にコメントを飛ばす
if ($commentOut == true) {
continue;
}
// renew-ico01又はrenew-ico02が含まれており、「$year」を含む場合は、それ以降の$lineを出力する
// コロナ関連のお知らせではない
if (strpos ($line, " corona-switch") == false) {
if (strpos ($line, " renew-ico01") !== false || strpos ($line, "renew-ico02") !== false) {
if (strpos ($line, " renew-ico01") !== false) {
//重要アイコン
$renewIco = 1;
}
if (strpos ($line, " renew-ico02") !== false) {
//お知らせアイコン
$renewIco = 2;
}
// 出力ON
$isRead = true;
// と を格納する一時バッファを初期化
$tempBuffer = array();
//array_push($tempBuffer, $line);
}
}
if(strpos($line, " ", $lastUpdated . "", $line);
// 最終更新日保持変数を初期化
$lastUpdated = "";
}
// $lineをバッファに格納
array_push($tempBuffer, $line);
}
// 出力ON時に を検出した場合
if ($isRead && $line == "") {
// 出力OFF
$isRead = false;
$yearflg = false;
// $tempBufferにはタグと タグとタグが格納されているので
// HTML格納用バッファに格納する
if (!empty($tempBuffer)) {
// 更新アイコンが「重要」の場合
if ($renewIco == 1) {
$buffer = array_merge($buffer, array('
- '), $tempBuffer, array('
- '), $tempBuffer, array('
{$year}年
{$result}
HTML;
}
// HTML格納用バッファ初期化
$buffer = array();
}
}
?>