선택한 게시물을 정말 삭제하시겠습니까?
한번 삭제한 자료는 복구할 수 없습니다
알림창이후 /g5/bbs/delete_all.php 창에서 멈추어 버립니다.
게시글 역시 삭제되지 않구요..
어느부분이 살펴보면 될런지요.
사용한 스킨 : https://sir.kr/g5_skin/8318
아래 첫번째는 delete_all.php 로 보내고(부동산 스킨)
두번째거는 board_list_update.php 로 보내는 점이 다른데
그누보드5에 부동산 스킨 적용시킬경우 이부분은 문제가 없는 건지요:
// 선택한 게시물 삭제function select_delete(){ var f = document.fboardlist; str = "삭제"; if (!check_confirm(str)) return; if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다")) return; f.action = "./delete_all.php"; f.submit();}
if(document.pressed == "선택삭제") { if (!confirm("선택한 게시물을 정말 삭제하시겠습니까?\n\n한번 삭제한 자료는 복구할 수 없습니다\n\n답변글이 있는 게시글을 선택하신 경우\n답변글도 선택하셔야 게시글이 삭제됩니다.")) return false; f.removeAttribute("target"); f.action = "./board_list_update.php"; } return true;
답변 2개 / 댓글 1개
id가 제대로 들어갔는지 한번 찍어봐서 확인해보세요 보통 id가 제대로 안넘어 가는경우가 있거나 아니면 쿼리문에서 문법이 오류가 있거나 그래서.. 그리고 스킨이나 뭐 이런건 에러가 많을겁니다 그걸 저도 수정하면서 쓰기때문에 정 모르겠으면 더 명확한 설명으로 글을 남기셔야합니다..
답변에 대한 댓글 1개
<?if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 include_once(G5_LIB_PATH.'/latest_wr.lib.php');include_once("$board_skin_path/skin.exe.php");$p_four = explode("|",$list[$i][wr_4]);$four01 = $p_four[0];-중간생략-$four60 = $p_four[59];$mod = $board[bo_gallery_cols];$td_width = (int)(100 / $mod);//if ($is_category) $colspan++;if ($is_checkbox) $colspan++;if ($is_good) $colspan++;if ($is_nogood) $colspan++;function get_bo_n_option($bo_n=''){ global $g5, $board; $arr = explode("|", $board[$bo_n]); // 구분자가 | 로 되어 있음 $str = ""; for ($i=0; $i<count($arr); $i++) if (trim($arr[$i])) $str .= "<option value='$arr[$i]'>$arr[$i]</option>\n"; return $str;}// 카테고리 분할if ($is_category = true) { $bo_7_option = get_bo_n_option('bo_7'); // SELECT OPTION 태그로 넘겨받음 $bo_8_option = get_bo_n_option('bo_8'); // SELECT OPTION 태그로 넘겨받음 $bo_9_option = get_bo_n_option('bo_9'); // SELECT OPTION 태그로 넘겨받음 $bo_5_option = get_bo_n_option('bo_5'); // SELECT OPTION 태그로 넘겨받음}add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);?><script language="Javascript">function mov(){ var f = document.fwrite; location="board.php?bo_table=<?=$bo_table?>&wr_9="+f.wr_9.value+"&wr_8="+f.wr_8.value+"&wr_7="+f.wr_7.value+"&wr_5="+f.wr_5.value+"&wr_2="+f.wr_2.value;}</script><link rel='stylesheet' href='<?=$board_skin_path?>/style.css' type='text/css'><style type="text/css">.board_top {width:100%; height:30px;}-중간생략-#snb ul li ul .on a{color:#1d1d1d; font-weight:normal;}</style><script type="text/javascript" src="<?=$g5[path]?>/js/jquery.js"></script><!--전체테이블--><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="180" valign="top"> <!-- 좌측메뉴시작--> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top" width=180 height=45> <div id="snb"><a href="./board.php?bo_table=<?=$bo_table?>"><img src="<?=$board_skin_url?>/img/l_title.gif" border=0></a> <!--<img src="<?=$g4['path']?>/<?=$gr_id?>/img/title_sub14.gif">--> <? // 카테고리 뽑아오기 $cate_print = ""; $cate_print .=" <div class=\"wireframemenu\"> <ul class=\"ca\">"; $cate = explode("|", $board[bo_category_list]); for ($i=0; $i<count($cate); $i++){ if ($sca == $cate[$i]) { $ca="class=on"; } else {$ca="class=off";} if (trim($cate[$i])){ $cate_print .="<li {$ca}><a href=\"{$g5['bbs_path']}/board.php?bo_table={$bo_table}&sca={$cate[$i]}\">".$cate[$i]."</a></li>"; } } $cate_print .= " </ul> <ul class=\"ca\"></ul> </div> "; // 메뉴 이미지 검사 if($bo_table =="$bo_table"){ $on = "on"; } else { $on = "off"; } ?> <? $line_aticle = 1; // 한줄당 출력 개수 $gooin_bo_table = $bo_table; //게시판명 $ms = " select * from g5_board where bo_table = '$gooin_bo_table' order by bo_category_list and bo_5 "; //$rs = mysql_query($ms); $rs = sql_query($ms); //while ($dt=mysql_fetch_array($rs)) { while ($dt=sql_fetch_array($rs)) { $cat_dt = explode("|", $dt[bo_category_list]); $ex_bo_dt = explode("|", $dt[bo_5]); ?> <table width='100%' cellpadding='0' cellspacing='0' border='0'> <tr> <? for ($i=0; $i<count($ex_bo_dt); $i++) { $bo_dt3 = explode("^", $ex_bo_dt[$i]); if($i%$line_aticle==0) { echo "</tr><tr>"; } if($cat_dt[$i]==$sca){ $sub_on = "on"; } else { $sub_on = "off"; } ?> <td valign=top> <table width='100%' cellpadding='0' cellspacing='0' border='0'> <tr> <td height=28 style="padding-right:10px;"><div id="calink"> <div id="name1" class="<?=$sub_on?>"> <a href="<?=$g5['path']?>/bbs/board.php?bo_table=<?=$gooin_bo_table?>&sca=<?=$cat_dt[$i]?>&wr_9=<?=$wr_9?>&wr_8=<?=$wr_8?>&wr_7=<?=$wr_7?>&wr_5=<?=$wr_5?>"> <?=$cat_dt[$i]?> </a></div> <? for ($q=0; $q<count($bo_dt3); $q++) { ?> <div id="name2"> <a href="<?=$g5['path']?>/bbs/board.php?bo_table=<?=$gooin_bo_table?>&sca=<?=$cat_dt[$i]?>&wr_9=<?=$wr_9?>&wr_8=<?=$wr_8?>&wr_7=<?=$wr_7?>&wr_5=<?=$bo_dt3[$q]?>"> <? if ($bo_dt3[$q] == '매매') { echo "<img src='$board_skin_url/img/icon_ca01.gif' width='14' height='14' border=0 align='absmiddle' alt='매매' title='매매'>"; } else if ($bo_dt3[$q] == '전세') { echo "<img src='$board_skin_url/img/icon_ca02.gif' width='14' height='14' border='0' alt='전세'>"; } else if ($bo_dt3[$q] == '월세') { echo "<img src='$board_skin_url/img/icon_ca03.gif' width='14' height='14' border='0' alt='월세'>"; } else if ($bo_dt3[$q] == '임대') { echo "<img src='$board_skin_url/img/icon_ca04.gif' width='14' height='14' border='0' alt='임세'>"; } ?> </a> </div> <? } ?> </div></td> </tr> <tr> <td height="1" colspan="2" bgcolor="#e9e9e9"></td> </tr> </table></td> <? } ?> </tr> </table> <? } ?> </div> </td></tr></table> <!--좌측메뉴 끝--> </td> <td width="10"> </td> <td valign="top"> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td> <div style="border:10px #F3F3F3 solid; padding:10px;"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr align=center> <form name="fcategory" method="get"> <input type=hidden name=bo_table value="<?=$bo_table?>"> <td width="100%"> <select name=wr_5 onchange="location='<?=$category_location?>'+this.form.sca.value+'&wr_9='+this.form.wr_9.value+'&wr_8='+this.form.wr_8.value+'&wr_7='+this.form.wr_7.value+'&wr_5='+this.value;"> <option value=''> <?//=$board[bo_5_subj]?>물건형태 <option value='매매'>매매</option> <option value='전세'>전세</option> <option value='월세'>월세</option> <option value='임대'>임대</option> </option> </select> <select name=wr_8 onchange="location='<?=$category_location?>'+this.form.sca.value+'&wr_9='+this.form.wr_9.value+'&wr_8='+this.value+'&wr_7='+this.form.wr_7.value+'&wr_5='+this.form.wr_5.value;"> <option value=''> <?//=$board[bo_8_subj]?>지역 </option> <?=$bo_8_option?> </select> <select name=sca onchange="location='<?=$category_location?>'+this.value+'&wr_9='+this.form.wr_9.value+'&wr_8='+this.form.wr_8.value+'&wr_7='+this.form.wr_7.value+'&wr_5='+this.form.wr_5.value;"> <option value=''>종류</option> <?=$category_option?> </select> <select name=wr_9 onchange="location='<?=$category_location?>'+this.form.sca.value+'&wr_9='+this.value+'&wr_8='+this.form.wr_8.value+'&wr_7='+this.form.wr_7.value+'&wr_5='+this.form.wr_5.value;"> <option value=''> <?//=$board[bo_7_subj]?>아파트명 </option> <? $apt_table = 'apt_info'; // 아파트정보등록게시판 //$sql = mysql_query(" select distinct wr_subject from $g5[write_prefix]$apt_table where wr_subject != '' "); $sql = sql_query(" select distinct wr_subject from $g5[write_prefix]$apt_table where wr_subject != '' "); //for ($i=0; $row=mysql_fetch_array($sql); $i++) { for ($i=0; $row=sql_fetch_array($sql); $i++) { ?> <option value='<?=$row[wr_subject]?>'> <?=$row[wr_subject]?> <? }?> </option> </select> <? if ($sca == '아파트') { ?> <select name=wr_7 onchange="location='<?=$category_location?>'+this.form.sca.value+'&wr_9='+this.form.wr_9.value+'&wr_8='+this.form.wr_8.value+'&wr_5='+this.form.wr_5.value+'&wr_7='+this.value;" > <option value=''> <?//=$board[bo_9_subj]?>공인중개사 </option> <? $mem_table = 'apt_member'; //회원사등록 게시판 //$sql = mysql_query(" select distinct wr_subject from $g5[write_prefix]$mem_table where wr_subject != '' "); $sql = sql_query(" select distinct wr_subject from $g5[write_prefix]$mem_table where wr_subject != '' "); //for ($i=0; $row=mysql_fetch_array($sql); $i++) { for ($i=0; $row=sql_fetch_array($sql); $i++) { ?> <option value='<?=$row[wr_subject]?>'> <?=$row[wr_subject]?> <? }?> </option> </select> <? } else{?> <input type=hidden name=wr_7 value="<?=$wr_7?>" /> <? }?> </td> </form> </tr> </table> </div> <table width="100%"><tr><td height=5></td></tr></table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr><td colspan=7 height=2 bgcolor=#C22212></td></tr> <tr bgcolor=#F1F1F1> <td width="40" height="35" align=center>번호</td> <td width="42" align=center>형태</td> <td width="60" align=center>지역</td> <td width="80" align=center>매물</td> <td style='word-break:break-all;' align=center>제목</td> <td width="120" align=center>평형</td> <td width="110" align=center>가격</td> </tr> <tr><td colspan=7 height=3></td></tr> </table> <div style="height:1px; line-height:1px; font-size:1px; background-color:#ddd; clear:both;"> </div> <form name="fboardlist" method="post" style="margin:0px;"> <input type="hidden" name="bo_table" value="<?=$bo_table?>" /> <input type="hidden" name="sfl" value="<?=$sfl?>" /> <input type="hidden" name="stx" value="<?=$stx?>" /> <input type="hidden" name="spt" value="<?=$spt?>" /> <input type="hidden" name="sca" value="<?=$sca?>" /> <input type="hidden" name="page" value="<?=$page?>" /> <input type="hidden" name="sw" value="" /> <? for ($i=0; $i<count($list); $i++) { ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr align=center <? if ($wr_id == $list[$i][wr_id]) { ?>bgcolor="#FFF9F9"<? }?> onmouseover=this.style.backgroundColor='#fafafa' onmouseout=this.style.backgroundColor='' style="FILTER: blendTrans(duration=0.5);"> <td width="40" height="28"> <? if ($wr_id == $list[$i][wr_id]) // 현재위치 (게시판 리스트 번호) echo "<span style='font:bold 11px tahoma; color:#E15916;'>{$list[$i][num]}</span>"; else echo "<span style='font:normal 11px tahoma; color:#B3B3B3;'>{$list[$i][num]}</span>"; ?> </td> <td width="42" class="list"> <?=$list[$i][wr_5]?> </td> <td width="60" class="list"> <?=$list[$i]['wr_8']?> </td> <td width="80" class="list"> <? if ($is_category && $list[$i][ca_name]) { echo "{$list[$i][ca_name]}"; } ?> </td> <td align=left class="list" style='word-break:break-all;'> <? if ($is_checkbox) echo "<input type=checkbox name=chk_wr_id[] value='<?=$list[$i][wr_id]?>'>"; //echo $nobr_begin; //echo $list[$i][reply]; //echo $list[$i][icon_reply]; $style = ""; if ($list[$i][is_notice]) $style = " style='font-weight:bold;'"; echo "<a href='{$list[$i][href]}' $style>"; if ($list[$i][wr_1] == 1){ echo "<img src = {$board_skin_url}/img/gp.gif border=0>"; echo " "; } if ($list[$i][wr_1] == 2){ echo "<img src = {$board_skin_url}/img/choo.gif border=0>"; echo " "; } echo $list[$i][subject]; echo "</a>"; if ($sca == '아파트') echo $list[$i][ext3_03]; if ($list[$i][comment_cnt]) echo " <a href=\"{$list[$i][comment_href]}\"><span style='font-family:Tahoma;font-size:10px;color:#EE5A00;'>{$list[$i][comment_cnt]}</span></a>"; //echo " " . $list[$i][icon_new]; //echo " " . $list[$i][icon_file]; //echo " " . $list[$i][icon_hot]; //echo $nobr_end; ?> </td> <? $p_two = explode("|",$list[$i][wr_2]); $two01 = $p_two[0]; -중간생략- $two10 = $p_two[9]; $add_filed = explode("|",$list[$i][wr_6]); $add01 = $add_filed[0]; -중간생략- $add60 = $add_filed[59]; ?> <td width="60" class="list"> <?=$add01?> 평형</td> <td width="60" align=left> <span style='font-size:10px;color:#EE5A00;'><?=$add02?></span> m²</td> <td width="110" align=right class="list"><? if ($list[$i]['wr_5'] == '매매') {?> <?=$two01?> 만원 <? }?> <? if ($list[$i]['wr_5'] == '전세') {?> <?=$two03?> 만원 <? }?> <? if ($list[$i]['wr_5'] == '월세') {?> <?=$two04?> / <?=$two05?> 만원 <? }?> <? if ($list[$i]['wr_5'] == '임대') {?> <?=$two06?> / <?=$tow07?> 만원 <? }?></td> </tr> </table> <div style="height:1px; line-height:1px; font-size:1px; background-color:#ddd; clear:both;"> </div> <? }?> <!--</form>--> <table width="<?=$width?>" cellpadding=0 cellspacing=0> <tr> <td width="50%" height="40"><? if ($list_href) { ?> <a href="<?=$list_href?>"><img src="<?=$board_skin_url?>/img/btn_list.gif" border="0" /></a> <? } ?> <? if ($write_href) { ?> <a href="<?=$write_href?>"><img src="<?=$board_skin_url?>/img/btn_write.gif" border="0" /></a> <? } ?> <? if ($is_checkbox) { ?> <a href="javascript:select_delete();"><img src="<?=$board_skin_url?>/img/btn_select_delete.gif" border="0" /></a> <a href="javascript:select_copy('copy');"><img src="<?=$board_skin_url?>/img/btn_select_copy.gif" border="0" /></a> <a href="javascript:select_copy('move');"><img src="<?=$board_skin_url?>/img/btn_select_move.gif" border="0" /></a> <? } ?></td> <td width="50%" align="right"> <div style="float:right;"> <? if ($admin_href) { ?> <a href="<?=$admin_href?>"><img src="<?=$board_skin_url?>/img/btn_admin.gif" border='0' title="관리자" align="absmiddle" /></a> <?}?> <? if ($rss_href) { ?> <a href='<?=$rss_href?>'><img src='<?=$board_skin_url?>/img/btn_rss.gif' border='0' align="absmiddle" /></a> <?}?> <img src="<?=$board_skin_url?>/img/icon_total.gif" align="absmiddle" border='0' /> <span style="color:#888888; font-weight:bold;">Total <?=number_format($total_count)?> </span> </div> </td> </tr> </table> </form> </td></tr></table></td></tr></table><!-- 페이지 --><table width="100%" cellpadding="3" > <tr> <td align="center"> <? if ($prev_part_href) { echo "<a href='$prev_part_href'> <img src='$board_skin_url/img/search_prev.gif' border=0 align=absmiddle></a>"; }?> <? //echo $write_pages; $write_pages = str_replace("처음", "<img src='$board_skin_url/img/page_begin.gif' border='0' align='absmiddle'>", $write_pages); $write_pages = str_replace("이전", "<img src='$board_skin_url/img/page_prev.gif' border='0' align='absmiddle'>", $write_pages); $write_pages = str_replace("다음", "<img src='$board_skin_url/img/page_next.gif' border='0' align='absmiddle'>", $write_pages); $write_pages = str_replace("맨끝", "<img src='$board_skin_url/img/page_end.gif' border='0' align='absmiddle'>", $write_pages); $write_pages = preg_replace("/([0-9]*)/", "$1", $write_pages); $write_pages = preg_replace("/([0-9]*)/", "$1", $write_pages); ?> <?=$write_pages?> <? if ($next_part_href) { echo "<a href='$next_part_href'> <img src='$board_skin_url/img/search_next.gif' border=0 align=absmiddle></a>"; } ?></td> </tr></table> <? if ($is_checkbox) { ?><script language="JavaScript">function all_checked(sw){ var f = document.fboardlist; for (var i=0; i<f.length; i++) { if (f.elements[i].name == "chk_wr_id[]") f.elements[i].checked = sw; }}function check_confirm(str){ var f = document.fboardlist; 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(str + "할 게시물을 하나 이상 선택하세요."); return false; } return true;}// 선택한 게시물 삭제function select_delete(){ var f = document.fboardlist; str = "삭제"; if (!check_confirm(str)) return; if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다")) return; f.action = "./delete_all.php"; f.submit();}// 선택한 게시물 복사 및 이동function select_copy(sw){ var f = document.fboardlist; if (sw == "copy") str = "복사"; else str = "이동"; if (!check_confirm(str)) return; var sub_win = window.open("", "move", "left=50, top=50, width=400, height=550, scrollbars=1"); f.sw.value = sw; f.target = "move"; f.action = "./move.php"; f.submit();}</script><? } ?><script language="JavaScript">if ('<?=$sca?>') document.fcategory.sca.value = '<?=$sca?>';if ('<?=$wr_9?>') document.fcategory.wr_9.value = '<?=$wr_9?>';if ('<?=$wr_8?>') document.fcategory.wr_8.value = '<?=$wr_8?>';if ('<?=$wr_7?>') document.fcategory.wr_7.value = '<?=$wr_7?>';if ('<?=$wr_5?>') document.fcategory.wr_5.value = '<?=$wr_5?>';if ('<?=$stx?>') { document.fsearch.sfl.value = '<?=$sfl?>'; document.fsearch.sop.value = '<?=$sop?>';}</script>
답변을 작성하려면 로그인이 필요합니다.
게시판 리스트에서 삭제을 원하는 게시글 체크박스 선택후
선택삭제 버튼을 클릭하면 알림창 뜨고 확인을 누르면
/g5/bbs/delete_all.php 창에서 멈추어 버립니다.
복사와 이동의 경우에는 새창에서 복사및 이동할 게시판 선택해준뒤 확인을 누르면
완료가 되었 다고 나오지만 실제로는
복사와 이동이 되지 않는 문제입니다.