현재접속자에 페이징 기능 추가 하고 십습니다
본문
현재접속자에 페이징 기능 추가 하고 십습니다
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$connect_skin_url.'/style.css">', 0);
?>
<!-- 현재접속자 목록 시작 { -->
<div class="tbl_head01 tbl_wrap">
<table id="current_connect_tbl">
<thead>
<tr>
<th scope="col">번호</th>
<th scope="col">이름</th>
<th scope="col">위치</th>
</tr>
</thead>
<tbody>
<?php
for ($i=0; $i<count($list); $i++) {
//$location = conv_content($list[$i]['lo_location'], 0);
$location = $list[$i]['lo_location'];
// 최고관리자에게만 허용
// 이 조건문은 가능한 변경하지 마십시오.
if ($list[$i]['lo_url'] && $is_admin == 'super') $display_location = "<a href=\"".$list[$i]['lo_url']."\">".$location."</a>";
else $display_location = $location;
?>
<tr>
<td class="td_num"><?php echo $list[$i]['num'] ?></td>
<td class="td_name"><?php echo $list[$i]['name'] ?></td>
<td><?php echo $display_location ?></td>
</tr>
<?php
}
if ($i == 0)
echo "<tr><td colspan=\"3\" class=\"empty_table\">현재 접속자가 없습니다.</td></tr>";
?>
</tbody>
</table>
</div>
<!-- } 현재접속자 목록 끝 -->
답변 1
될지 안될지 모르지만 일단 /lib/connect.lib.php 를 수정해야 합니다
global $config, $g5,$page;
// 회원, 방문객 카운트
$sql = " select sum(IF(mb_id<>'',1,0)) as mb_cnt, count(*) as total_cnt from {$g5['login_table']} where mb_id <> '{$config['cf_admin']}' ";
이부분을
global $config, $g5,$page;
$page_rows = 5;
$sql = " select * from {$g5['login_table']} where mb_id <> '{$config['cf_admin']}' ";
$result = sql_query($sql);
$total_count = mysql_num_rows($result);
$total_page = ceil($total_count / $page_rows); // 전체 페이지 계산
$from_record = ($page - 1) * $page_rows; // 시작 열을 구함
//$sql = " select sum(IF(mb_id<>'',1,0)) as mb_cnt, count(*) as total_cnt from {$g5['login_table']} where mb_id <> '{$config['cf_admin']}' ";
$sql = " select sum(IF(mb_id<>'',1,0)) as mb_cnt, count(*) as total_cnt from {$g5['login_table']} where mb_id <> '{$config['cf_admin']}' limit {$from_record}, $page_rows ";
//$write_pages = get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, './board.php?bo_table='.$bo_table.$qstr.'&page=');
$write_pages = get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'&page=');
이런식으로 바꾸고 connect.skin.php 에서
<!-- 페이지 -->
<?php echo $write_pages; ?>
추가하시면 되지 않나 싶네요
!-->!-->