require 'header.php'; if (isGET('drafts') && isAdmin()) { $out['title'] = $lang['drafts']; $out['titleHtml'] = ''; $drafts = listEntry('drafts'); sort($drafts); $pages = pages($drafts); $page = page($pages); if ($drafts) { $first = true; foreach (pageItems($drafts, $page) as $draft) { $draftEntry = readEntry('drafts', $draft); $out['content'] .= $first ? '' : '<div class="div">· · · · ·</div>'; $first = false; $out['content'] .= '<div class="post"> <h2><a href="./view.php?draft=' . $draft . '">' . $draftEntry['title'] . manageDraft($draft) . '</a></h2> <div class="date">' . toDate($draft) . '</div>'; $out['content'] .= '<div class="content">' . $draftEntry['content'] . '</div> </div>'; } } $out['content'] .= paging($page, $pages, './index.php?drafts=all'); } else { if (isGET('comments')) { $out['title'] = $lang['comments']; $comments = listEntry('comments'); rsort($comments); $pages = pages($comments); $page = page($pages); if ($comments) { $out['content'] .= '<div id="comments">';
} $out['content'] .= paging($page, $pages, './view.php?post=' . GET('post') . '#comments'); if (!$postEntry['locked']) { $out['content'] .= '<form action="./add.php?comment=' . GET('post') . '" method="post"> <p>' . text('name') . '</p> <p>' . textarea('content') . '</p> <p>' . submitSafe('send') . '</p> </form>'; } } else { if (isGET('draft') && isValidEntry('drafts', GET('draft'))) { $draftEntry = readEntry('drafts', GET('draft')); $out['title'] = $draftEntry['title']; $out['titleHtml'] = ''; $out['content'] .= '<div class="post"> <h1 class="title">' . $out['title'] . manageDraft(GET('draft')) . '</h1> <div class="date">' . toDate(GET('draft')) . '</div>'; $out['content'] .= '<div class="content">' . $draftEntry['content'] . '</div> </div>'; } else { if (isGET('tag') && isValidEntry('tags', GET('tag'))) { $tagEntry = readEntry('tags', GET('tag')); $out['title'] = $tagEntry['name']; $out['titleHtml'] .= '<h1>' . $out['title'] . manageTag(GET('tag')) . '</h1>'; $out['content'] .= ''; if ($tagEntry['posts']) { foreach ($tagEntry['posts'] as $post) { $postEntry = readEntry('posts', $post); $title = $postEntry['title']; $out['content'] .= '<p><a href="./view.php?post=' . $post . '">' . $title . '</a>' . managePost($post) . ' — ' . toDate($post) . '</p>'; }