add search

This commit is contained in:
Amberstone 2024-11-25 23:56:26 +09:00
parent 244a8d275e
commit 6ac6a1a4d9
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
2 changed files with 238 additions and 198 deletions

View file

@ -69,6 +69,7 @@ $month_pre = 0;
?> ?>
<div id="bo_frame" style="max-width:<?= $width ?>;margin:0 auto;"> <div id="bo_frame" style="max-width:<?= $width ?>;margin:0 auto;">
<!-- 상단 공지 부분 --> <!-- 상단 공지 부분 -->
<?php if (empty($stx)) { ?>
<nav class="pg_wrap theme-box"> <nav class="pg_wrap theme-box">
<span class="pg control"> <span class="pg control">
<a href="<?= G5_BBS_URL . "/board.php?bo_table=" . $bo_table . "&"; <a href="<?= G5_BBS_URL . "/board.php?bo_table=" . $bo_table . "&";
@ -129,9 +130,27 @@ $month_pre = 0;
</a> </a>
</span> </span>
</nav> </nav>
<?php } else { ?>
<nav class="pg_wrap theme-box">
<span></span>
<h2 class="this-month txt-point" style="padding: 8px 0"><?=$stx?>의 검색 결과</h2>
</nav>
<?php } ?>
<div id="bo_list"> <div id="bo_list">
<section id="diary_calendar"> <section id="diary_calendar">
<div class="diary-calendar theme-box"> <div class="diary-calendar theme-box">
<?php
if (!empty($stx)) {
?>
<h2 class="this-month txt-point">
<a href="<?= G5_BBS_URL ?>/board.php?bo_table=<?=$bo_table?>">돌아가기</a>
</h2>
<div class="controls txt-right">
<?php if ($admin_href) { ?><a href="<?= $admin_href ?>" class="ui-btn small admin">관리자</a><?php } ?>
</div>
<?
} else {
?>
<h2 class="this-month txt-point"><?= $year ?>/<?= $sel_mon ?></h2> <h2 class="this-month txt-point"><?= $year ?>/<?= $sel_mon ?></h2>
<div class="controls txt-right"> <div class="controls txt-right">
<?php if ($admin_href) { ?><a href="<?= $admin_href ?>" class="ui-btn small admin">관리자</a><?php } ?> <?php if ($admin_href) { ?><a href="<?= $admin_href ?>" class="ui-btn small admin">관리자</a><?php } ?>
@ -285,6 +304,7 @@ $month_pre = 0;
?> ?>
</tbody> </tbody>
</table> </table>
<?php } ?>
</div> </div>
<?php if ($board['bo_content_head']) { ?> <?php if ($board['bo_content_head']) { ?>
<hr class="padding small"> <hr class="padding small">
@ -292,7 +312,7 @@ $month_pre = 0;
<?= stripslashes($board['bo_content_head']); ?> <?= stripslashes($board['bo_content_head']); ?>
</div> </div>
<?php } ?> <?php } ?>
<?php if ($is_member && $write_href) { ?> <?php if ($is_member && $write_href && empty($stx)) { ?>
<hr class="padding small"> <hr class="padding small">
<div id="diary_write" class="none-trans"> <div id="diary_write" class="none-trans">
<div class="theme-box"> <div class="theme-box">
@ -302,12 +322,32 @@ $month_pre = 0;
</div> </div>
<hr class="padding small"> <hr class="padding small">
<?php } ?> <?php } ?>
<fieldset id="bo_sch">
<legend>게시물 검색</legend>
<form name="fsearch" method="get">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sop" value="and">
<input type="hidden" name="sfl" value="wr_content">
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo stripslashes($stx) ?>" required id="stx"
class="frm_input required" size="15" maxlength="20">
<button type="submit" class="ui-btn"><i class="material-icons">search</i></button>
</form>
</fieldset>
</section> </section>
<section id="diary_list"> <section id="diary_list">
<div class="diary-cont"> <div class="diary-cont">
<?php <?php
$order = $board['bo_4'] ? "asc" : "desc"; $order = $board['bo_4'] ? "asc" : "desc";
$result = sql_query("SELECT * FROM {$write_table} WHERE wr_1!='' and left(wr_1,6) = '$year$sel_mon' ORDER BY wr_1 {$order}"); $result = sql_query("SELECT * FROM {$write_table} WHERE wr_1!='' and left(wr_1,6) = '$year$sel_mon' ORDER BY wr_1 {$order}");
if (!empty($stx)) {
// need after fix for secure
$stx = "\"%".stripslashes($stx)."%\"";
$result = sql_query("SELECT * FROM {$write_table} WHERE wr_content LIKE {$stx} ORDER BY wr_id");
}
for ($i = 0; $row = sql_fetch_array($result); $i++) { for ($i = 0; $row = sql_fetch_array($result); $i++) {
if (strstr($row['wr_option'], "secret") && (!$is_admin || ($row['mb_id'] && $member['mb_id'] != $member['mb_id']))) if (strstr($row['wr_option'], "secret") && (!$is_admin || ($row['mb_id'] && $member['mb_id'] != $member['mb_id'])))
continue; continue;

View file

@ -80,7 +80,7 @@ add_stylesheet('<link rel="stylesheet" href="' . $board_skin_url . '/style.css">
placeholder="<?= $board['bo_5'] ? $board['bo_5'] : "날씨"; ?>"><input type="text" name="wr_3" id="wr_3" placeholder="<?= $board['bo_5'] ? $board['bo_5'] : "날씨"; ?>"><input type="text" name="wr_3" id="wr_3"
value="<?= $write['wr_3'] ?>" placeholder="<?= $board['bo_6'] ? $board['bo_6'] : "무드"; ?>"> value="<?= $write['wr_3'] ?>" placeholder="<?= $board['bo_6'] ? $board['bo_6'] : "무드"; ?>">
</section> </section>
<textarea name="wr_content" id="wr_content" maxlength="255" required></textarea> <textarea name="wr_content" id="wr_content" required></textarea>
<input type="file" id="wr_file" name="bf_file[0]" title="파일첨부 : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" <input type="file" id="wr_file" name="bf_file[0]" title="파일첨부 : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능"
class="frm_file frm_input full"> class="frm_file frm_input full">
<div class="btn_confirm txt-right"> <div class="btn_confirm txt-right">