<?php
include "_common.php";
//define('_INDEX_', true);
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
$board_sql = 'select bo_table from '. $g5['board_table'];
$board_query = sql_query($board_sql);
$board_column = 'wr_subject, wr_hit, wr_comment, wr_is_comment';
$tabAll_limit = 10; //최대순위
//각 게시판 테이블명 뽑아내기
while( $board_fetch = sql_fetch_array($board_query) ) {
$bo_table = $board_fetch['bo_table'];
if(!$tabAllBoard['query']) {
$tabAllBoard['query'] = '(select '. $board_column .' from g5_write_'. $bo_table .')';
} else {
$tabAllBoard['query'] .= ' union all (select '. $board_column .' from g5_write_'. $bo_table .')';
}
}
$tabAllQuery = 'select '. $board_column .' from ('. $tabAllBoard['query'] .') where wr_is_comment = 0 order by wr_comment DESC limit '. $tabAll_limit;
$tabAllResult = sql_query($tabAllQuery);
$i=1;
while( $tabAll = sql_fetch_array($tabAllResult) ) {
?>
<li class="h_icon0<?=$i++?>"><a href="<?=$g5['bbs_path']?>/board.php?bo_table="><?=$tabAll['wr_subject']?></a><?=$tabAll['wr_hit']?></li>
<?php
}
?>