게시판 리스트 카운터 조정.! > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

게시판 리스트 카운터 조정.! 정보

게시판 리스트 카운터 조정.!

본문

현재 엑셀파일을 디비게시판에 업로드 하고 있습니다.
문제는 업로드 하고나서 반드시 게시판관리자모드에서 카운터 조정을해야..
정상적으로 게시물들이 보입니다.
리스트목록스킨에서 카운터 조정을 하고싶습니다.
고수분들 부탁드립니다.^^
  • 복사

댓글 전체

/adm/board_form_update.php
159 라인부터 198라인 즉 수정을 하지 않으셧다면...
참고하세요....
그게 게시물과 댓글등을 재조정하는 부분입니다.
작업량이 아주 많으신 경우 아니면 카운트
조정으로 하시는게 좋을듯 한데요...
꼭 리스트 스킨에서 하실려면
list.skin.php  108라인( for ($i=0; $i<count($list); $i++) { ...)아래쪽에 추가해주세요
엑셀로 입력되면 리스트가 0,-1,-2...출력되니 리스트에 0이있어면
카운트조정하시듯 한번실행됩니다.

<?
//게시글수 조정
if ($list[$i][num] == '0'){
// 게시판의 글 수
$sql = " select count(*) as cnt from g4_write_$bo_table where wr_is_comment = 0 ";
$row = sql_fetch($sql);
$bo_count_write = $row[cnt];

// 게시판의 코멘트 수
$sql = " select count(*) as cnt from g4_write_$bo_table where wr_is_comment = 1 ";
$row = sql_fetch($sql);
$bo_count_comment = $row[cnt];

// 글수 조정
if ($proc_count) {
// 원글을 얻습니다.
$sql = " select wr_id from g4_write_$bo_table where wr_is_comment = 0 ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 코멘트수를 얻습니다.
$sql2 = " select count(*) as cnt from g4_write_$bo_table where wr_parent = '$row[wr_id]' and wr_is_comment = 1 ";
$row2 = sql_fetch($sql2);

sql_query(" update g4_write_$bo_table set wr_comment = '$row2[cnt]' where wr_id = '$row[wr_id]' ");
}
}

// 공지사항에는 등록되어 있지만 실제 존재하지 않는 글 아이디는 삭제합니다.
$bo_notice = "";
$lf = "";
if ($board[bo_notice]) {
$tmp_array = explode("\n", $board[bo_notice]);
for ($i=0; $i<count($tmp_array); $i++) {
$tmp_wr_id = trim($tmp_array[$i]);
$row = sql_fetch(" select count(*) as cnt from g4_write_$bo_table where wr_id = '$tmp_wr_id' ");
if ($row[cnt])
{
$bo_notice .= $lf . $tmp_wr_id;
$lf = "\n";
}
}
}

$sql = " update g4_board
set bo_notice = '$bo_notice',
bo_count_write = '$bo_count_write',
bo_count_comment = '$bo_count_comment' ";
if ($sql_common) $sql .= ", $sql_common ";
$sql .=  " where bo_table = '$bo_table' ";
sql_query($sql);

}
?>
© SIRSOFT
현재 페이지 제일 처음으로