나방큰도그래

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

· 3년 전 · 2095 · 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,444
3년 전 조회 2,060
3년 전 조회 1,672
3년 전 조회 3,400
3년 전 조회 2,133
3년 전 조회 2,972
3년 전 조회 3,463
3년 전 조회 1,778
3년 전 조회 2,090
3년 전 조회 2,327
3년 전 조회 2,775
3년 전 조회 1,847
3년 전 조회 2,377
3년 전 조회 3,456
3년 전 조회 2,096
3년 전 조회 3,489
3년 전 조회 1,831
3년 전 조회 1,548
3년 전 조회 2,628
3년 전 조회 2,347
3년 전 조회 1,463
3년 전 조회 3,338
3년 전 조회 3,508
3년 전 조회 2,640
3년 전 조회 5,183
3년 전 조회 2,474
3년 전 조회 2,255
3년 전 조회 2,041
3년 전 조회 3,391
3년 전 조회 1,986