フォーク元 tak4/bibis
53 行
2.0 KiB
PHP
53 行
2.0 KiB
PHP
<?php
|
|
// Post form
|
|
?>
|
|
<?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()): ?>
|
|
<ul>
|
|
<li>書き込み制限中。
|
|
</ul>
|
|
<?php endif; ?>
|
|
<?php elseif ($view['thread_size_over'] ?? false): ?>
|
|
<ul>
|
|
<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="<?= sitebase('post/') ?>" enctype="multipart/form-data">
|
|
<ul>
|
|
<li><?= $view['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"></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 class="form-li-submit">
|
|
<?php if (isset($view['form']['thread_id']) && $view['form']['thread_id'] != ''): ?>
|
|
<input type="hidden" name="thread_id" value="<?= htmlspecialchars($view['form']['thread_id'] ?? '') ?>">
|
|
<?php endif; ?>
|
|
<?= output_csrf_token_hidden() ?>
|
|
<button type="submit">書き込み</button>
|
|
</ul>
|
|
</form>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|