자동폭파일에 팝업창 띄울경우

자동폭파일에 팝업창 띄울경우

QA

자동폭파일에 팝업창 띄울경우

본문

https://sir.kr/g4_tiptech/12417


자동폭파일에 게시글 삭제가 아닌

아래와 같은 팝업창 소스가 실행되게 하려고 합니다.

list.skin.php 에 어떻게 넣어 주어야 하나요??



echo "<script>window.open('{$board_skin_url}/print_list.php?bo_table={$bo_table}&wr_id={$list[$i][wr_id]}&no=1', '', 'left=150, top=10, width=700, height=500, scrollbars=1');</script>"; 



아래처럼 수정해서

list.skin.php 아래 부분에 넣어주었는데.. 화면 출력이 안됩니다.


echo " " . $list[$i][icon_new];
       //echo " " . $list[$i][icon_file];
       //echo " " . $list[$i][icon_hot];
       //echo $nobr_end;
      ?>


<<여기에 넣음>>


=====================================

 <?              
//자폭 시작
//for ($i=0; $i<count($list); $i++) {

 $count_write = 0;
 $count_comment = 0;

 if($list[$i][wr_45]) {
  $g4[time_ymd] = date("Y-m-d H:i", $g4[server_time]);
  $stoday = $g4[time_ymd];

  $bombdate = $list[$i][wr_45];

  $By = substr($bombdate,0,4);
  $Bm = substr($bombdate,5,2);
  $Bd = substr($bombdate,8,2) + 7;
  $Bh = substr($bombdate,11,2);
  $Bi = substr($bombdate,14,2);

  $bombdate7 = date("Y-m-d H:i",mktime($Bh,$Bi,0,$Bm,$Bd,$By) );

  $bombc = $list[$i][wr_id];

  if ($stoday > $bombdate7) {

 
 //자동폭파일에 팝업창 띄우기
 echo "<script>window.open('{$board_skin_url}/print_list.php?bo_table={$bo_table}&wr_id={$list[$i][wr_id]}&no=1', '', 'left=150, top=10, width=700, height=500, scrollbars=1');</script>";
 //자동폭파일에 팝업창 띄우기

}
?>






=======================================

자동폭파 list.skin.ph 소스부분



list.skin.php 의 상단에 아래 소스를 추가합니다

//자폭 시작
for ($i=0; $i<count($list); $i++) {

 $count_write = 0;
 $count_comment = 0;

 if($list[$i][wr_10]) {
  $g4[time_ymd] = date("Y-m-d H:i", $g4[server_time]);
  $stoday = $g4[time_ymd];

  $bombdate = $list[$i][wr_10];

  $By = substr($bombdate,0,4);
  $Bm = substr($bombdate,5,2);
  $Bd = substr($bombdate,8,2) + 7;
  $Bh = substr($bombdate,11,2);
  $Bi = substr($bombdate,14,2);

  $bombdate7 = date("Y-m-d H:i",mktime($Bh,$Bi,0,$Bm,$Bd,$By) );

  $bombc = $list[$i][wr_id];

  if ($stoday > $bombdate7) {
  $sql = " select wr_id, mb_id, wr_is_comment from $write_table where wr_parent = '$bombc' order by wr_id ";
  $result = sql_query($sql);
  while ($row = sql_fetch_array($result))
  {
   // 원글이라면
   if (!$row[wr_is_comment])
   {
    // 원글 포인트 삭제
    if (!delete_point($row[mb_id], $bo_table, $row[wr_id], '쓰기'))
     insert_point($row[mb_id], $board[bo_write_point] * (-1), "$board[bo_subject] $row[wr_id] 글삭제");
    // 업로드된 파일이 있다면 파일삭제
    $sql2 = " select * from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$row[wr_id]' ";
    $result2 = sql_query($sql2);
    while ($row2 = sql_fetch_array($result2)){
     @unlink("$g4[path]/data/file/$bo_table/$row2[bf_file]");
     @unlink("$g4[path]/data/file/$bo_table/thumb/$write[wr_id]"); //썸네일 삭제
     @unlink("$g4[path]/data/file/$bo_table/latest_thumb/$write[wr_id]"); //최근게시물 썸네일 삭제
    }

    //추천기록 삭제
    sql_query(" delete from g4_board_good where wr_id = '$row[wr_id]' AND bo_table = '$bo_table' "); //수정
     
    // 파일테이블 행 삭제
    sql_query(" delete from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$row[wr_id]' ");
    $count_write++;
   }
   else
   {
    // 코멘트 포인트 삭제
    if (!delete_point($row[mb_id], $bo_table, $row[wr_id], '코멘트'))
     insert_point($row[mb_id], $board[bo_comment_point] * (-1), "$board[bo_subject] {$view[wr_id]}-{$row[wr_id]} 코멘트삭제");
    $count_comment++;
   }
  }
  // 게시글 삭제
  sql_query(" delete from $write_table where wr_parent = '$bombc' ");
  // 최근게시물 삭제
  sql_query(" delete from $g4[board_new_table] where bo_table = '$bo_table' and wr_parent = '$bombc' ");
  // 스크랩 삭제
  sql_query(" delete from $g4[scrap_table] where bo_table = '$bo_table' and wr_id = '$bombc' ");

  // 공지사항 삭제
  $notice_array = explode("\n", trim($board[bo_notice]));
  $bo_notice = "";
  for ($k=0; $k<count($notice_array); $k++)
   if ((int)$bombc != (int)$notice_array[$k])
    $bo_notice .= $notice_array[$k] . "\n";
  $bo_notice = trim($bo_notice);
  sql_query(" update $g4[board_table] set bo_notice = '$bo_notice' where bo_table = '$bo_table' ");

  // 글숫자 감소
  if ($count_write > 0 || $count_comment > 0)
   sql_query(" update $g4[board_table] set bo_count_write = bo_count_write - '$count_write', bo_count_comment = bo_count_comment - '$count_comment' where bo_table = '$bo_table' ");
  $bend = 1;
  }
 }
 if(count($list) == $i+1 && $bend == 1){
  goto_url("./board.php?bo_table=$bo_table&page=$page");}
}
//자폭 끝

그리고 echo $list[$i][subject]; 이부분 위에 아래 소스를 추가합니다. 제목을 나타내는 부분위에 넣으세요

  if($list[$i][wr_10]){
   echo "<img src='$board_skin_path/img/bomb.gif' align='absmiddle'>";
  }

이 질문에 댓글 쓰기 :

답변 1

조건은 현재 날짜 Y-m-d H:i 이보다 클때인데
이조건이 만족하는지
먼저 체크해보세요


 echo $stoday." > ".$bombdate7."; exit;

후 조건이 맞는지 먼저 체크하신후 원하는 조건에 맞는지 확인후 작업을 진행하는게 좋을것 같네요

답변을 작성하시기 전에 로그인 해주세요.
전체 2,042
QA 내용 검색
filter #css ×

회원로그인

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