나방큰도그래

게시판 글 카운트 한번에 조정

· 3년 전 · 2098 · 2

php 초보라서..^^ 그냥 짜맞추기 식으로 만들었습니다^^

필요하신 분 있을 거 같아서!

 

버전 5.5.x 이상

후크형이 들어가서.. 혹시 이전버전은 run_event( ); 부분 제거하시면 될껍니다!

 

# adm/board_count_ref.php만들고 아래 내용 복붙

[code]

<?php
$sub_menu = '300830';
require_once './_common.php';

if ($is_admin != 'super') {
    alert('최고관리자만 접근 가능합니다.', G5_URL);
}

run_event('board_count_refrash_before');

$g5['title'] = '게시판 카운트 조정';
require_once './admin.head.php';
?>

<div class="local_desc02 local_desc">
    <p>
        완료 메세지가 나오기 전에 프로그램의 실행을 중지하지 마십시오.
    </p>
</div>

<?php
$sql = sql_query(" select bo_table from {$g5['board_table']} ");
while ($row = sql_fetch_array($sql)) {
    $write_table = $g5['write_prefix'].$row['bo_table'];
    sql_query(" update {$g5['board_table']} set bo_count_write = (select count(*) from {$write_table} where wr_is_comment = 0) where bo_table = '{$row['bo_table']}' ");
    sql_query(" update {$g5['board_table']} set bo_count_comment = (select count(*) from {$write_table} where wr_is_comment = 1) where bo_table = '{$row['bo_table']}' ");
}

run_event('board_count_refrash');

echo '<li>완료됨</li></ul>' . PHP_EOL;
echo '<div class="local_desc01 local_desc"><p><strong>모든 게시판에 카운트 조정이 완료 되었습니다.</strong><br>프로그램의 실행을 끝마치셔도 좋습니다.</p></div>' . PHP_EOL;
?>

<?php
require_once './admin.tail.php';

[/code]

 

# adm/admin.menu300.php

array('300820', '글,댓글 현황', G5_ADMIN_URL . '/write_count.php', 'scf_write_count'), 하단에 아래내용 추가

[code]
array('300830', '게시판 카운트 조정', G5_ADMIN_URL . '/board_count_ref.php', 'scf_board_count'),

[/code]

|

댓글 2개

좋은 자료 감사합니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누보드5 팁자료실

+
제목 글쓴이 날짜 조회
3년 전 조회 2,446
3년 전 조회 2,063
3년 전 조회 1,679
3년 전 조회 3,405
3년 전 조회 2,138
3년 전 조회 2,975
3년 전 조회 3,471
3년 전 조회 1,783
3년 전 조회 2,097
3년 전 조회 2,334
3년 전 조회 2,778
3년 전 조회 1,849
3년 전 조회 2,383
3년 전 조회 3,458
3년 전 조회 2,099
3년 전 조회 3,492
3년 전 조회 1,835
3년 전 조회 1,551
3년 전 조회 2,635
3년 전 조회 2,351
3년 전 조회 1,467
3년 전 조회 3,347
3년 전 조회 3,512
3년 전 조회 2,648
3년 전 조회 5,197
3년 전 조회 2,481
3년 전 조회 2,261
3년 전 조회 2,044
3년 전 조회 3,395
3년 전 조회 1,995