rsort($comments); $pages = pages($comments); $page = page($pages); if ($comments) { $out['content'] .= '<div id="comments">'; $first = true; foreach (pageItems($comments, $page) as $comment) { $out['content'] .= $first ? '' : '<div class="div">· · · · ·</div>'; $first = false; $commentEntry = readEntry('comments', $comment); $postEntry = readEntry('posts', $commentEntry['post']); $title = $commentEntry['commenter'] . $lang['commented'] . $postEntry['title']; $pageOf = pageOf($comment, $postEntry['comments']); $link = './view.php?post=' . $commentEntry['post'] . '/pages/' . $pageOf . '#' . $comment; $out['content'] .= '<div class="comment"> <div class="title"><a href="' . $link . '">' . $title . manageComment($comment) . '</a></div> <div class="date">' . toDate($comment) . '</div> <div class="content">' . content($commentEntry['content']) . '</div> </div>'; } $out['content'] .= '</div>'; } $out['content'] .= paging($page, $pages, './index.php?comments=all'); } else { if (isGET('404')) { $out['title'] = 'HTTP 404'; $out['content'] .= '<p>' . $lang['notFound'] . '</p>'; } else { $is_posts = isGET('posts'); $out['title'] = $lang['posts']; $out['titleHtml'] = '';
$out['content'] .= '</div> <div class="content">' . $postEntry['content'] . '</div> </div>'; $pages = pages($postEntry['comments']); $page = page($pages); if ($postEntry['comments']) { $commentCount = count($postEntry['comments']); $out['content'] .= '<div class="ccount">' . $commentCount . ($commentCount != 1 ? $lang['ncomments'] : $lang['ncomment']) . '</div>'; $out['content'] .= '<div id="comments">'; $first = true; foreach (pageItems($postEntry['comments'], $page) as $comment) { $out['content'] .= $first ? '' : '<div class="div">· · · · ·</div>'; $first = false; $commentEntry = readEntry('comments', $comment); $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>';