테스트 사이트 - 개발 중인 베타 버전입니다

$bo_table 혹시 이건 전체 게시판이고 게시판 하나만 쓰려면...?? 채택완료

wnsah6288 5년 전 조회 3,721

$bo_table 혹시 이건 전체 게시판이고 게시판 하나만 쓰려면...??

 

만약에 게시판 테이블 명이 test1 이라고 했을때

 

어떻게 넣어야 될까요...??

댓글을 작성하려면 로그인이 필요합니다.

답변 2개

채택된 답변
+20 포인트

$bo_table 이 전체 게시판은 아니구요

그누보드 기본 구조는

g5_write_{$bo_table} 구조라고 보시면 됩니다.

 

예로

g5_write_test1

/bbs/board.php?bo_table=test1

이런식입니다.

 

해결되지않을경우 궁금하신 부분 디테일하게 문의부탁드려요

 

 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

w
wnsah6288
5년 전
lib/latest_popular.lib.php 파일 입니다.



<?php
if (!defined('_GNUBOARD_')) exit;

// 인기글 추출
// $cache_time 캐시 갱신시간
function latest_popular($bo_table, $rows=10, $subject_len=40, $term='', $options='')
{
global $g5;

switch($term){
case '일간': $term_time = date("Y-m-d H:i:s", G5_SERVER_TIME-3600*24); break;
case '주간': $term_time = date("Y-m-d H:i:s", G5_SERVER_TIME-3600*24*7); break;
case '월간': $term_time = date("Y-m-d H:i:s", G5_SERVER_TIME-3600*24*30); break;
}

$list = array();

if($bo_table){ //각 게시판 출력
$sql = " select * from {$g5['board_table']} where bo_table = '{$bo_table}' ";
$board = sql_fetch($sql);
$bo_subject = get_text($board['bo_subject']);

$tmp_write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
$sql_between = " wr_datetime between '$term_time' and '".G5_TIME_YMDHIS."' ";
$sql = " select * from {$tmp_write_table} where wr_is_comment = 0 and {$sql_between} order by {$options} limit 0, {$rows} ";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++) {
$list[$i] = get_list($row, $board, $latest_skin_url, $subject_len);
}
}else{ //전체 게시판 출력

$sql_between = " a.bn_datetime between '$term_time' and '".G5_TIME_YMDHIS."' ";
$sql_common = " from {$g5['board_new_table']} a, {$g5['board_table']} b where a.bo_table = b.bo_table and b.bo_use_search = 1 and a.wr_id = a.wr_parent and {$sql_between} ";
$sql_order = " order by a.bn_datetime desc ";

$sql = " select a.*, count(b.bo_subject) as cnt {$sql_common} {$sql_order} limit 0, {$rows} ";
$row = sql_fetch($sql);


if($row['cnt'] > 0){
$sql = " select a.*, b.bo_subject {$sql_common} {$sql_order} limit 0, {$rows} ";
$result = sql_query($sql);

for ($i=0; $row = sql_fetch_array($result); $i++){
$tmp_write_table = $g5['write_prefix'].$row['bo_table'];
$bo_table = $row['bo_table'];

if($i > 0)
$sql2 .= " union ";
$sql2 .= "(select '{$bo_table}' as bo_table, wr_id, wr_subject, wr_hit, wr_good from {$tmp_write_table} where wr_datetime between '{$term_time}' and '".G5_TIME_YMDHIS."') ";
}
$sql2 .= " order by ".$options." limit 0, 10";
$result2 = sql_query($sql2);

for ($i=0; $row2 = sql_fetch_array($result2); $i++){
$list[$i]['href'] = G5_BBS_URL.'/board.php?bo_table='.$row2['bo_table'].'&amp;wr_id='.$row2['wr_id'];
$list[$i]['subject'] = $row2['wr_subject'];
}
}

}

ob_start();
?>


<div class="tab">
<input type="radio" name="css-tabs" id="tab-1" checked class="tab-switch">
<label for="tab-1" class="tab-label" href="#" jquery16408452460570924265=1>일간 조회수</label>
<div class="tab-content"><?php echo latest_popular($bo_table, 10, 40, '일간', 'wr_hit desc'); ?></div>
</div>
<div class="tab">
<input type="radio" name="css-tabs" id="tab-2" class="tab-switch">
<label for="tab-2" class="tab-label" href="#" jquery16408452460570924265=2>일간 추천수</label>
<div class="tab-content"><?php echo latest_popular($bo_table, 10, 40, '일간', 'wr_good desc'); ?></div>
</div>
<div class="tab">
<input type="radio" name="css-tabs" id="tab-3" class="tab-switch">
<label for="tab-3" class="tab-label" href="#" jquery16408452460570924265=3>주간 조회수</label>
<div class="tab-content"><?php echo latest_popular($bo_table, 10, 40, '주간', 'wr_hit desc'); ?></div>
</div>
<div class="tab">
<input type="radio" name="css-tabs" id="tab-4" class="tab-switch">
<label for="tab-4" class="tab-label" href="#" jquery16408452460570924265=4>주간 추천수</label>
<div class="tab-content"><?php echo latest_popular($bo_table, 10, 40, '주간', 'wr_good desc'); ?></div>
</div>



---------------------------------------------------------------------------------------------------


theme/test/mobile/index.php


바로 밑에 보이는게 불러오는 부분입니다.

<!-- 히트글 순위 -->
<?php
// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);
// 테마의 스킨을 사용하려면 theme/basic 과 같이 지정
include_once(G5_LIB_PATH.'/latest_popular.lib.php');
?>

<!-- 배너 최신글 -->
<?php
// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);
// 테마의 스킨을 사용하려면 theme/basic 과 같이 지정
echo latest('theme/about', 'about', 1, 33);
?>

<!-- a메뉴 최신글 -->
<?php
// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);
// 테마의 스킨을 사용하려면 theme/basic 과 같이 지정
echo latest('theme/menu', 'free', 12, 33);
?>
w
wnsah6288
5년 전
test 라는 게시판 하나만 리스트에 띄우고 싶습니다....

https://sir.kr/bbs/board.php?bo_table=g5_skin&wr_id=3873&page=0&posting=ok&sca=&sfl=&stx=&sst=&sod=&spt=0&page=0

이 소스입니다.

댓글을 작성하려면 로그인이 필요합니다.

5년 전

링크의 스킨사용법에 나와잇는 그대로 하면 안되던가요?

각 게시판에 별도로 추가하려면 /skin/board/스킨폴더/list.skin.php 21번 라인 정도 <--라고 되어잇는데

test1게시판이 사용하는 스킨을 따로 설정해서 설명처럼 하세요

 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인