sorry
このコミットが含まれているのは:
コミット
0d2c5aa6cd
|
@ -1,36 +1,60 @@
|
|||
<?php
|
||||
// 投稿フォーム
|
||||
$value = '';
|
||||
if (($view['res_num'] ?? 0) >= 2) {
|
||||
$value = '>>' . $view['res_num'] . PHP_EOL;
|
||||
}
|
||||
?>
|
||||
<?php if (isset($view['form']['thread_id']) && $view['form']['thread_id'] >= 0): ?>
|
||||
<h2 id="REPLY_FORM">返信</h2>
|
||||
<?php if (ENABLE_POST): ?>
|
||||
<?php if (isset($view['form']['thread_id']) && $view['form']['thread_id'] != ''): ?>
|
||||
<h2 id="REPLY_FORM">返信・Reply</h2>
|
||||
<?php endif; ?>
|
||||
<?php if (!can_post()): ?>
|
||||
<?php if (!post_limited()): ?>
|
||||
<?php if (!ENABLE_GUEST && !is_logged_in()): ?>
|
||||
<ul>
|
||||
<li>書き込み制限中。</li>
|
||||
<li>書き込みするにはログインしてください。
|
||||
</ul>
|
||||
<?php elseif (!post_limited()): ?>
|
||||
<ul>
|
||||
<li>書き込み制限中。
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<?php elseif ($view['thread_size_over'] ?? false): ?>
|
||||
<ul>
|
||||
<li>スレッドの長さが上限の <?= THREAD_SIZE ?> 件に到達。</li>
|
||||
<li>スレッドの長さが上限の <?= THREAD_SIZE ?> 件に到達。
|
||||
</ul>
|
||||
<?php elseif ($view['is_future_post'] ?? false): ?>
|
||||
<ul>
|
||||
<li>予約投稿は時間になるまで返信不可。
|
||||
</ul>
|
||||
<?php elseif (REQUIRE_COOKIE && !has_cookie()): ?>
|
||||
<ul>
|
||||
<li>投稿するにはリロードしてください。(要:COOKIE)
|
||||
</ul>
|
||||
<?php else: ?>
|
||||
<?php
|
||||
$view['form'] = $view['form'] ?? [];
|
||||
?>
|
||||
<form method="POST" action="/post/">
|
||||
<form method="POST" action="<?= sitebase('post/') ?>" enctype="multipart/form-data">
|
||||
<ul>
|
||||
<?php if (!(isset($view['form']['thread_id']) && $view['form']['thread_id'] >= 0)): ?>
|
||||
<li><label for="TITLE">件名 (省略可)</label> <input type="text" id="TITLE" name="title">
|
||||
<li><?= is_logged_in() ? 'ログイン中:<b>' . htmlspecialchars($view['login_user']['username']) . '</b>' : '<b>' . htmlspecialchars(GUESTNAME) . '</b>' ?>
|
||||
<?php if (!(isset($view['form']['thread_id']) && $view['form']['thread_id'] > '')): ?>
|
||||
<li><label for="TITLE">件名 (省略可)・Title (Optional)</label> <input type="text" id="TITLE" name="title">
|
||||
<?php endif; ?>
|
||||
<li><label for="BODY">本文 (500文字以内)・Text (500)</label> <textarea id="BODY" name="body" cols="40" rows="5"><?= htmlspecialchars($value) ?></textarea>
|
||||
<?php if (ENABLE_SPOOF_TIME): ?>
|
||||
<li><label><input type="checkbox" name="spooftime" value="1"> <b class="spooftime-text">ランダム予約投稿(3H~27H遅らせる)</b></label></li>
|
||||
<?php endif; ?>
|
||||
<?php if (ENABLE_IMAGE): ?>
|
||||
<li><label for="ATTACHMENT">画像 (gif/jpg/png・上限 500kb 程)</label> <input type="file" id="ATTACHMENT" name="attachment">
|
||||
<?php endif; ?>
|
||||
<li><label for="BODY">本文 (500文字以内)</label> <textarea id="BODY" name="body" cols="40" rows="5"></textarea>
|
||||
<li class="form-li-submit">
|
||||
<?php if (isset($view['form']['thread_id']) && $view['form']['thread_id'] >= 0): ?>
|
||||
<?php if (isset($view['form']['thread_id']) && $view['form']['thread_id'] != ''): ?>
|
||||
<input type="hidden" name="thread_id" value="<?= htmlspecialchars($view['form']['thread_id'] ?? '') ?>">
|
||||
<button type="submit">返信</button>
|
||||
<?php else: ?>
|
||||
<button type="submit">書き込む</button>
|
||||
<?php endif; ?>
|
||||
<?= output_csrf_token_hidden() ?>
|
||||
<button type="submit">書き込み</button>
|
||||
</ul>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -1,36 +1,13 @@
|
|||
<?php
|
||||
// 投稿一覧
|
||||
$reply_list_mode = isset($view['reply_list_mode']) && $view['reply_list_mode'];
|
||||
?>
|
||||
<?php if (isset($view['post_list'])): ?>
|
||||
<?php foreach ($view['post_list'] as $i => $post):
|
||||
$no = $i + 2;
|
||||
$title = htmlspecialchars($post['title'] ?? '');
|
||||
$username = htmlspecialchars($post['username']);
|
||||
$userid = htmlspecialchars($post['userid']);
|
||||
$time = $post['time']; // safe
|
||||
$detail_url = htmlspecialchars($post['detail_url']);
|
||||
$user_url = htmlspecialchars($post['user_url']);
|
||||
$body = $post['body']; // body is valid html
|
||||
$is_guest = $post['is_guest'] ?? false;
|
||||
$thread_id = $post['thread_id'] ?? '';
|
||||
$thread_title = $post['thread_title'] ?? '';
|
||||
$thread_url = $post['thread_url'] ?? '';
|
||||
?>
|
||||
<dl<?= ($reply_list_mode ? ' id="' . $no . '"' : '') ?>>
|
||||
<?php if ($title != ''): ?>
|
||||
<dt><b>件名:<a href="<?= $detail_url ?>"><?= $title ?></a></b></dt>
|
||||
<?php endif; ?>
|
||||
<?php if ($is_guest): ?>
|
||||
<dt><?= $reply_list_mode ? "$no " : '' ?> <b><?= $username ?></b> <a class="post-time" href="<?= $detail_url ?>"><?= $time ?></a></dt>
|
||||
<?php else: ?>
|
||||
<dt><?= $reply_list_mode ? "$no " : '' ?> <b><a href="<?= $user_url ?>"><?= $username ?></a></b> @<?= $userid ?> <a class="post-time" href="<?= $detail_url ?>"><?= $time ?></a></dt>
|
||||
<?php endif; ?>
|
||||
<?php if ($thread_id >= 0 && !$reply_list_mode): ?>
|
||||
<dd>RE:<a href="<?= $thread_url ?>"><?= $thread_title ?></a></dd>
|
||||
<?php endif; ?>
|
||||
<dd><?= $body ?></dd>
|
||||
<dd><a href="<?= $detail_url ?>#REPLY_FORM">返信</a></dd>
|
||||
</dl>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
require __DIR__ . '/post-common.php';
|
||||
|
||||
if (!($view['post_list'] ?? false)) {
|
||||
echo '<p>まだ書き込みがありません。' . PHP_EOL;
|
||||
exit;
|
||||
}
|
||||
|
||||
foreach ($view['post_list'] ?? [] as $post) {
|
||||
view_post($post, ['link_to_thread' => true]);
|
||||
}
|
||||
|
|
読み込み中…
新しいイシューから参照