카테고리별 최근게시물 글번호 출력

카테고리별 최근게시물 글번호 출력

QA

카테고리별 최근게시물 글번호 출력

본문

카테고리별로 최근게시물 출력하는 스킨에서

 

글번호출력이 전체 게시물에서 카운트 됩니다.

 

이부분 소스를 카테고리별로 글번호가 카운트되서 출력되도록 어떻게 바꾸나요 ㅠ

 

아래 출력부분 소스입니다. 답변 부탁드립니다. ㅠ

*최근게시물에서 불러오는 lib.php 소스 하단에 함께 추가하였습니다.

<? for ($i=0; $i<count($list); $i++) { ?> 

.

.

 

<?

   $num = $board[bo_count_write] - $i; 

   echo $num; 

?>

.

.

 

<? } ?>

 

 

-------------lib.php-------------

 

<?

if (!defined('_GNUBOARD_')) exit;

 

function latest_cate($skin_dir="", $bo_table, $rows=10, $subject_len=40, $ca_name="")

{

    global $g4;

 

    if ($skin_dir)

        $latest_skin_path = "$g4[path]/skin/latest/$skin_dir";

    else

        $latest_skin_path = "$g4[path]/skin/latest/basic";

 

    $list = array();

 

    $sql = " select * from $g4[board_table] where bo_table = '$bo_table'";

    $board = sql_fetch($sql);

 

    $tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름

 

    if ($ca_name)

    $sql = " select * from $tmp_write_table where ca_name = '$ca_name' and wr_is_comment = 0 order by wr_num limit 0, $rows ";

    else

    $sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";

   

    $result = sql_query($sql);

    for ($i=0; $row = sql_fetch_array($result); $i++) 

        $list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);

    

    ob_start();

    include "$latest_skin_path/latest.skin.php";

    $content = ob_get_contents();

    ob_end_clean();

 

    return $content;

 

?> 

 

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
전체 3
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT