function dbLoad() { global $_contents; global $_menu; if (file_exists("db/contents.txt")) { $_contents = json_decode(file_get_contents("db/contents.txt"), true); } else { dbAddContents(array('mode' => 1, 'title' => '投稿一覧', 'contents' => '', 'header' => '', 'eyecatch' => '', 'page' => -1, 'native' => '')); } if (file_exists("db/menu.txt")) { $_menu = json_decode(file_get_contents("db/menu.txt"), true); } else { $_menu = array(); $_menu['bland'] = "初期メニュー"; $_menu['menu'] = array("ログイン" => "index.php?signin=1"); dbSetMenu($_menu); } }
function dbLoad() { global $_contents; global $_menu; if (file_exists("db/contents.txt")) { $_contents = json_decode(file_get_contents("db/contents.txt"), true); } else { dbAddContents(array('mode' => 1, 'title' => 'Posts', 'contents' => '', 'header' => '', 'eyecatch' => '', 'page' => -1, 'native' => '')); } if (file_exists("db/menu.txt")) { $_menu = json_decode(file_get_contents("db/menu.txt"), true); } else { $_menu = array(); $_menu['bland'] = "Init Menu"; $_menu['menu'] = array("Login" => "system/login.php"); dbSetMenu($_menu); } }
if (isset($prev)) { $prev += array($line[0] => $line[1]); } else { //初回の2段目について$prevに保存 $smenu[$cnt] = array($line[0] => $line[1]); $prev =& $smenu[$cnt]; $cnt++; } } } } else { break; } } unset($prev); dbSetMenu(array('bland' => $sbland, 'menu' => $smenu)); echo "設定完了"; //編集 } else { list($sbland, $smenu) = dbGetMenu(-1); foreach ($smenu as $key => $value) { if (is_array($value)) { foreach ($value as $key2 => $value2) { $text .= " {$key2},{$value2}\n"; } } else { $text .= "{$key},{$value}\n"; } } $text .= "\n"; foreach ($_contents as $value) {