<?php $out = array(); require 'header.php'; if (isGET('login')) { if (checkBot() && check('password') && login(cleanMagic($_POST['password']))) { session_regenerate_id(true); home(); } else { $out['title'] = $lang['login']; $out['content'] .= '<form action="./auth.php?login" method="post"> <p>' . password('password') . '</p> <p>' . submitSafe($lang['confirm']) . '</p> </form>'; } } else { if (isGET('logout') && isAdmin()) { $_SESSION['role'] = ''; home(); } else { if (isGET('test') && isAdmin()) { $out['title'] = $lang['login']; $out['content'] .= '<form action="./auth.php?test" method="post"> <p>' . password('password') . '</p> <p>' . submitAdmin($lang['confirm']) . '</p> </form>'; if (check('password')) { $out['content'] .= box(hide(cleanMagic($_POST['password']))); } } else { home();
$out['content'] .= '<div id="' . $comment . '" class="comment"> <div class="title">' . $commentEntry['commenter'] . manageComment($comment) . '</div> <div class="date">' . toDate($comment) . '</div> <div class="content">' . content($commentEntry['content']) . '</div> </div>'; } $out['content'] .= '</div>'; } else { $out['content'] .= '<div id="comments"></div>'; } $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'));