unset($_SESSION); session_destroy(); header("Location:index.php"); } else { if ($mode == 7) { $snippet(array('title' => $title, 'bland' => $bland, 'menu' => $menu)); } } } } } //表示 } else { //ディフォールトページ設定 if ($page < 0 && strlen($start) > 0) { parse_str(parse_url($start, PHP_URL_QUERY), $_GET); $page = array_getn($_GET, 'p'); } $ym = array_get($_GET, 'ym'); if (array_get($_GET, 'feed') == 'atom') { $atom(); } else { list($bland, $menu) = dbGetMenu(-1); if ($page <= 0) { $mainidx(array('title' => $blog, 'bland' => $bland, 'data' => dbGetContents(0), 'menu' => $menu, 'ym' => $ym)); //各ページ themeの切り替えはreq.php内の$themeで変更 } else { $disp(array('title' => $blog, 'bland' => $bland, 'data' => dbGetContents($page), 'menu' => $menu)); } } }
$native = array_get($_POST, 'native'); $ptag = array_get($_POST, 'ptag'); //投稿された if (strlen($submit) > 0) { if (strlen($eyecatch) == 0) { $eyecatch = 'http://placehold.it/320x240'; } if (strlen($ptag)) { $text = entag($text); } $page = dbAddContents(array('mode' => $mode, 'title' => $title, 'contents' => $text, 'header' => $head, 'eyecatch' => $eyecatch, 'page' => $page, 'native' => $native)); } //編集 if ($mode == 0 || $mode == 1) { if ($page >= 0) { $data = dbGetContents($page); $mode = $data['mode']; $title = $data['title']; $head = $data['header']; $text = $data['contents']; $eyecatch = $data['eyecatch']; $native = $data['native']; } $editpage(array('title' => $title, 'text' => $text, 'head' => $head, 'eyecatch' => $eyecatch, 'mode' => $mode, 'page' => $page, 'native' => $native)); $path = 'system/snippets'; if (isset($_SESSION) && isset($_SESSION['snplst'])) { $snplst = $_SESSION['snplst']; } else { if ($handle = opendir($path)) { while (false !== ($file = readdir($handle))) { if (!is_dir("{$path}/{$file}")) {