게시판 스킨 리스트 페이지에서 

<?php if ($is_checkbox) { ?> 
        <ul class="btn_bo_adm"> 
            <li><input type="submit" name="btn_submit" value="DEL" onclick="document.pressed=this.value"></li> 
            <li><input type="submit" name="btn_submit" value="COPY" onclick="document.pressed=this.value"></li> 
            <li><input type="submit" name="btn_submit" value="MOVE" onclick="document.pressed=this.value"></li> 
        </ul> 
        <?php } ?> 

이 부분의 밸류값을 수정하면 글 옮기거나 삭제할때 오류가 나는데 
아래쪽의 스크립트 수정해야 한다. 


function fboardlist_submit(f) { 
    var chk_count = 0; 

    for (var i=0; i<f.length; i++) { 
        if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked) 
            chk_count++; 
    } 

    if (!chk_count) { 
        alert(document.pressed + "할 게시물을 하나 이상 선택하세요."); 
        return false; 
    } 

    if(document.pressed == "COPY") { 
        select_copy("copy"); 
        return; 
    } 

    if(document.pressed == "MOVE") { 
        select_copy("move"); 
        return; 
    } 

    if(document.pressed == "DEL") { 
        if (!confirm("선택한 게시물을 정말 삭제하시겠습니까?\n\n한번 삭제한 자료는 복구할 수 없습니다\n\n답변글이 있는 게시글을 선택하신 경우\n답변글도 선택하셔야 게시글이 삭제됩니다.")) 
            return false; 

        f.removeAttribute("target"); 
        f.action = "./board_list_update.php"; 
    } 

    return true; 




그리고 bbs/board_list_update.php 수정해야 한다. 

<?php 
include_once('./_common.php'); 

$count = count($_POST['chk_wr_id']); 

if(!$count) { 
    alert($_POST['btn_submit'].' 하실 항목을 하나 이상 선택하세요.'); 


if($_POST['btn_submit'] == 'DEL') { 
    include './delete_all.php'; 
} else if($_POST['btn_submit'] == 'COPY') { 
    $sw = 'copy'; 
    include './move.php'; 
} else if($_POST['btn_submit'] == 'MOVE') { 
    $sw = 'move'; 
    include './move.php'; 
} else { 
    alert('올바른 방법으로 이용해 주세요.'); 

?>









귀찮으면 스킨 다운받아 사용 - https://sir.kr/g5_skin/5590

+ Recent posts