$out['content'] .= '<p>' . $lang['notFound'] . '</p>'; } else { $is_posts = isGET('posts'); $out['title'] = $lang['posts']; $out['titleHtml'] = ''; $posts = listEntry('posts'); if ($is_posts) { sort($posts); } else { rsort($posts); } $pages = pages($posts); $page = page($pages); if ($posts) { $first = true; foreach (pageItems($posts, $page) as $post) { $postEntry = readEntry('posts', $post); if (!$is_posts && !$first) { $out['content'] .= '<div class="div">· · · · ·</div>'; } $first = false; $out['content'] .= '<div class="post"> <h2><a href="./view.php?post=' . $post . '">' . $postEntry['title'] . managePost($post) . '</a></h2> <div class="date">' . toDate($post) . '</div>'; $out['content'] .= '<div class="info">'; foreach ($postEntry['tags'] as $tag) { $tagEntry = readEntry('tags', $tag); $tagName = $tagEntry['name']; $out['content'] .= '<a href="./view.php?tag=' . $tag . '">' . $tagName . '</a>'; } $out['content'] .= '</div>';
foreach ($postEntry['tags'] as $tag) { $tagEntry = readEntry('tags', $tag); $tagName = $tagEntry['name']; $out['content'] .= '<a href="./view.php?tag=' . $tag . '">' . $tagName . '</a>'; } $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']) {