bibis/view/post.php

24 行
706 B
PHP

<?php
// Post/thread detail
require __DIR__ . '/post-common.php';
$post = $view['post'] ?? [];
$title = $post['title'] ?? '';
$reply_list = $view['reply_list'] ?? [];
$total = sizeof($reply_list) + 1;
$total_view = $total > 1 ? " ($total)" : '';
?>
<?php if ($title > ''): ?>
<h2>件名:<?= htmlspecialchars("$title{$total_view}") ?></h2>
<?php elseif ($post['thread_id'] <= ''): ?>
<h2><?= htmlspecialchars('無題#' . mb_substr($post['id'], 0, 7) . $total_view) ?></h2>
<?php endif; ?>
<?php
view_post($post, ['res_num' => $post['thread_id'] > '' ? 0 : 1, 'is_single' => true, 'link_to_thread' => true]);
?>
<?php
foreach ($reply_list as $i => $reply) {
view_post($reply, ['res_num' => $i + 2]);
}
?>