테스트 사이트 - 개발 중인 베타 버전입니다

스크랩 목록 전체삭제 버튼 가능할까요? 채택완료

iesam 9년 전 조회 2,157
/bbs/scrap.php 에 전체삭제 기능을 넣으려고 하는데요



<a href="http://sir.kr/cm_free/392480" target="_blank" rel="noopener noreferrer">http://sir.kr/cm_free/392480</a> 여기에 비슷한 글이 있는데



완성된게 아니고 그누4라서 많이 다르더라고요



전체삭제 기능을 넣으려면 어떻게해야될지

큐앤에이로 가능할지 모르겠지만 조언좀 부탁드립니다







<?php

if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가



// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨

add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);

?>



<!-- 스크랩 목록 시작 { -->

<div id="scrap" class="new_win mbskin">

&nbsp; &nbsp; <h1 id="win_title"><?php echo $g5['title'] ?></h1>



&nbsp; &nbsp; <div class="tbl_head01 tbl_wrap">

&nbsp; &nbsp; &nbsp; &nbsp; <table>

&nbsp; &nbsp; &nbsp; &nbsp; <caption>스크랩 목록</caption>

&nbsp; &nbsp; &nbsp; &nbsp; <thead>

&nbsp; &nbsp; &nbsp; &nbsp; <tr>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <th scope="col">번호</th>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <th scope="col">게시판</th>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <th scope="col">제목</th>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <th scope="col">보관일시</th>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <th scope="col">삭제</th>

&nbsp; &nbsp; &nbsp; &nbsp; </tr>

&nbsp; &nbsp; &nbsp; &nbsp; </thead>

&nbsp; &nbsp; &nbsp; &nbsp; <tbody>

&nbsp; &nbsp; &nbsp; &nbsp; <?php for ($i=0; $i<count($list); $i++) {&nbsp; ?>

&nbsp; &nbsp; &nbsp; &nbsp; <tr>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <td class="td_num"><?php echo $list[$i]['num'] ?></td>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <td class="td_board"><a href="<?php echo $list[$i]['opener_href'] ?>" target="_blank" onclick="opener.document.location.href='<?php echo $list[$i]['opener_href'] ?>'; return false;"><?php echo $list[$i]['bo_subject'] ?></a></td>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <td><a href="<?php echo $list[$i]['opener_href_wr_id'] ?>" target="_blank" onclick="opener.document.location.href='<?php echo $list[$i]['opener_href_wr_id'] ?>'; return false;"><?php echo $list[$i]['subject'] ?></a></td>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <td class="td_datetime"><?php echo $list[$i]['ms_datetime'] ?></td>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <td class="td_mng"><a href="<?php echo $list[$i]['del_href'];&nbsp; ?>" onclick="del(this.href); return false;">삭제</a></td>

&nbsp; &nbsp; &nbsp; &nbsp; </tr>

&nbsp; &nbsp; &nbsp; &nbsp; <?php }&nbsp; ?>



&nbsp; &nbsp; &nbsp; &nbsp; <?php if ($i == 0) echo "<tr><td colspan=\"5\" class=\"empty_table\">자료가 없습니다.</td></tr>";&nbsp; ?>

&nbsp; &nbsp; &nbsp; &nbsp; </tbody>

&nbsp; &nbsp; &nbsp; &nbsp; </table>

&nbsp; &nbsp; </div>



&nbsp; &nbsp; <?php echo get_paging($config['cf_write_pages'], $page, $total_page, "?$qstr&page="); ?>



&nbsp; &nbsp; <div class="win_btn">

&nbsp; &nbsp; &nbsp; &nbsp; <button type="button" onclick="window.close();">창닫기</button>

&nbsp; &nbsp; </div>

</div>

<!-- } 스크랩 목록 끝 -->
댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트
HyeonPark
9년 전

bbs/scrap_delete_all.php

 

</p><p><?php</p><p>include_once('./_common.php');</p><p> </p><p>if (!$is_member)</p><p>    alert('회원만 이용하실 수 있습니다.');</p><p> </p><p>$sql = " delete from {$g5['scrap_table']} where mb_id = '{$member['mb_id']}' ";</p><p>sql_query($sql);</p><p> </p><p>goto_url('./scrap.php');</p><p>?></p><div>
</div><div>
scrap_delete_all.php 파일을 하나 만드셔서 위의 코드 내용을 집어 넣으신 다음에
skin/member/회원스킨/scrap.skin.php 파일에 전체 삭제 버튼을 넣을 부분에
</div><div>
</div><div><a href="./scrap_delete_all.php" onclick="del(this.href); return false;">전체삭제</a>
</div><div>
</div><div>
이 소스 코드를 넣어 주시면 될거같네요~!
로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

i
iesam
9년 전
친절한 답변 감사합니다 잘됩니다^^

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인