게시판에서 비밀글 체크하면 제목도 비밀글입니다. 생성되게 할수있나요?

게시판에서 비밀글 체크하면 제목도 비밀글입니다. 생성되게 할수있나요?

QA

게시판에서 비밀글 체크하면 제목도 비밀글입니다. 생성되게 할수있나요?

본문

게시판에서 비밀글 체크하면 제목도 비밀글입니다. 생성되게 할수있나요?


지금 게시판에서 홈페이지 이용자가 비밀글을 체크박스 체크하면,

제목에 자동으로 비밀글입니다. 생성되고, 수정하지 못하게 할수 있나요?


아래는 비밀글 체크박스부터 제목이 나오는 영역 (write) 입니다.

가능할까요?


<?php
    $option = '';
    $option_hidden = '';
    if ($is_notice || $is_html || $is_secret || $is_mail) {
        $option = '';
        if ($is_notice) {
            $option .= "\n".'<input type="checkbox" id="notice" name="notice" value="1" '.$notice_checked.'>'."\n".'<label for="notice">공지</label>';
        }

        if ($is_html) {
            if ($is_dhtml_editor) {
                $option_hidden .= '<input type="hidden" value="html1" name="html">';
            } else {
                $option .= "\n".'<input type="checkbox" id="html" name="html" onclick="html_auto_br(this);" value="'.$html_value.'" '.$html_checked.'>'."\n".'<label for="html">html</label>';
            }
        }

        if ($is_secret) {
            if ($is_admin || $is_secret==1) {
                $option .= "\n".'<input type="checkbox" id="secret" name="secret" value="secret" '.$secret_checked.'>'."\n".'<label for="secret">비밀글</label>';
            } else {
                $option_hidden .= '<input type="hidden" name="secret" value="secret">';
            }
        }

        if ($is_mail) {
            $option .= "\n".'<input type="checkbox" id="mail" name="mail" value="mail" '.$recv_email_checked.'>'."\n".'<label for="mail">답변메일받기</label>';
        }
    }

    echo $option_hidden;
    ?>

    <div class="tbl_frm01 tbl_wrap">
        <table>
        <tbody>
        <?php if ($is_name) { ?>
        <tr>
            <th scope="row"><label for="wr_name">이름<strong class="sound_only">필수</strong></label></th>
            <td><input type="text" name="wr_name" value="<?php echo $name ?>" id="wr_name" required class="frm_input required" size="10" maxlength="20"></td>
        </tr>
        <?php } ?>

        <?php if ($is_password) { ?>
        <tr>
            <th scope="row"><label for="wr_password">비밀번호<strong class="sound_only">필수</strong></label></th>
            <td><input type="password" name="wr_password" id="wr_password" <?php echo $password_required ?> class="frm_input <?php echo $password_required ?>" maxlength="20"></td>
        </tr>
        <?php } ?>

  

        <?php if ($is_email) { ?>
        <tr>
            <th scope="row"><label for="wr_email">이메일</label></th>
            <td><input type="text" name="wr_email" value="<?php echo $email ?>" id="wr_email" class="frm_input email" size="50" maxlength="100"></td>
        </tr>
        <?php } ?>

        <?php if ($is_homepage) { ?>
        <tr>
            <th scope="row"><label for="wr_homepage">홈페이지</label></th>
            <td><input type="text" name="wr_homepage" value="<?php echo $homepage ?>" id="wr_homepage" class="frm_input" size="50"></td>
        </tr>
        <?php } ?>

        <?php if ($option) { ?>
        <tr>
            <th scope="row">옵션</th>
            <td><?php echo $option ?></td>
        </tr>
        <?php } ?>

        <?php if ($is_category) { ?>
        <tr>
            <th scope="row"><label for="ca_name">분류<strong class="sound_only">필수</strong></label></th>
            <td>
                <select name="ca_name" id="ca_name" required class="required" >
                    <option value="">선택하세요</option>
                    <?php echo $category_option ?>
                </select>
            </td>
        </tr>
        <?php } ?>
 
        <tr>
            <th scope="row"><label for="wr_subject">제목<strong class="sound_only">필수</strong></label></th>
            <td>
                <div id="autosave_wrapper">
                    <input type="text" name="wr_subject" value="<?php echo $subject ?>" id="wr_subject" required class="frm_input required" size="50" maxlength="255">

                    <?php if ($is_member) { // 임시 저장된 글 기능 ?>
                    <script src="<?php echo G5_JS_URL; ?>/autosave.js"></script>
                    <button type="button" id="btn_autosave" class="btn_frmline">임시 저장된 글 (<span id="autosave_count"><?php echo $autosave_count; ?></span>)</button>
                    <div id="autosave_pop">
                        <strong>임시 저장된 글 목록</strong>
                        <div><button type="button" class="autosave_close"><img src="<?php echo $board_skin_url; ?>/img/btn_close.gif" alt="닫기"></button></div>
                        <ul></ul>
                        <div><button type="button" class="autosave_close"><img src="<?php echo $board_skin_url; ?>/img/btn_close.gif" alt="닫기"></button></div>
                    </div>
                    <?php } ?>
                </div>
            </td>
        </tr>
 

이 질문에 댓글 쓰기 :

답변 3

네 할수 있씁니다

 

1 제목에 링크 거는 부분에서조건문으로 채크되어있는 가를 확인하여 클릭여부를 조정 할수있습니다

2 뷰페이지에서 조건문으로 페이지가열리긴전에 채크해서 조정 할수있습니다

3 디비 커리처리하는 페이지에서 조건문으로처리할수있습니다


위 내용 다 조건문과 DB 검색 을 할수있는 프로그램? 능력이 있어야 가능 합니다


추천 제작의뢰 게시판에 글을 남겨서 10만원쯤이면 해결 가능 합니다

해당 게시판 스킨 폴더에서

list.skin.php 파일에서 제목 출력 부분을 이렇게 수정하고 (관리자는 예외입니다.)


<?php if (!$is_admin && $list[$i]['icon_secret']) { ?>

    비밀글입니다.

<?php } else { ?>

    <a href="<?php echo $list[$i]['href'] ?>"><?php echo $list[$i]['subject'] ?></a>

<?php } ?>


write.skin.php 상단 ?> 안쪽에 이렇게 넣으면 수정도 안될 것 같네요.

if ($w == 'u' && !$is_admin && strstr($write['wr_option'], 'secret')) {

    alert("수정할 수 없습니다.");

}

만약 DB 자체 제목을 "비밀글입니다"로 변경하시는 거면


write_update.skin.php에


if ( $secret == 'secret') {
$subject = "비밀글입니다";
$sql  = " update $write_table set wr_subject = '$subject' where wr_id = '$wr_id' ";
sql_query($sql); 
}


를 넣어주시면 될겁니다.


그냥 보여주기식으로만 하실려면 작은별님 답변처럼 하시면 되실거구요



답변을 작성하시기 전에 로그인 해주세요.
전체 0 | RSS
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT