[제나플러스] 카테고리 최신글 뽑아 보기 > 팁앤테크

본문 바로가기
사이트 내 전체검색

팁앤테크

[제나플러스] 카테고리 최신글 뽑아 보기

페이지 정보

profile_image
작성자 제로
댓글 1건 조회 51,910회 작성일 11-09-02 13:04

본문

zn.latest.lib.php 함수에서

//zlatest
function zn_latest_caname($skin_dir="", $bo_table, $rows=10, $ca_name, $brch="", $subject_len="255", $options="")
{
    global $g4;

    global $g4_board;

    if ($skin_dir)
        $latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
    else
        $latest_skin_path = "$g4[path]/skin/latest/basic";

    $list = array();
        if(!$g4_board or !$g4_board["$bo_table"]){
    //$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
    $sql_select = "bo_table, bo_subject, bo_notice, bo_use_category, bo_category_list, bo_new, bo_hot";
    $sql = " select $sql_select from $g4[board_table] where bo_table = '$bo_table'";
    $g4_board["$bo_table"] = sql_fetch($sql);
    }

    $board = $g4_board["$bo_table"];

    $tmp_write_table = $g4['write_prefix'] . $bo_table;
    if (!$brch)
        $brch = "wr_num asc";

    //$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
    // SPEED UP
    //$sql_select = "wr_id, wr_subject, wr_option, wr_content, wr_comment, wr_parent, wr_datetime, wr_name, wr_reply, wr_link1, wr_link2, ca_name, wr_hit, wr_good, wr_nogood";
    $sql_select = "wr_id, wr_subject, wr_comment, ca_name, wr_1";
    $sql = " select $sql_select from $tmp_write_table where wr_is_comment = 0 and ca_name = '$ca_name' order by $brch, wr_reply limit 0, $rows ";
    //explain($sql);
    $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;
}

수정된 부분을 확인하세요..

출력방법은

<?php echo zn_latest_caname("caname", plustip, 6, "zenaplus", "")?>

일반 스킨에서 카테고리함수만 추가되면 각 게시판의 카테고리별로 뽑아 올수 있습니다.

댓글목록

profile_image

김콩재님의 댓글

김콩재 작성일

저 같은 초보들한테 이런게 진짜 유용한 팁인듯!!

Total 779건 12 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 날짜
504 제로 87057 12-08
503 제로 86501 11-17
502 제로 89038 11-12
501 제로 89645 11-07
500 제로 70703 11-01
499 제로 76469 10-13
498 제로 73405 10-04
497 제로 92698 09-27
496 제로 100977 09-23
495 제로 82970 09-19
494 제로 70246 09-19
493 제로 63674 09-14
492 제로 56290 09-12
491 제로 60978 09-03
490 제로 58015 09-03
열람중 제로 51911 09-02
488 제로 91428 08-06
487 제로 93653 08-06
486 제로 94152 07-29
485 제로 96718 07-28
484 제로 93609 07-22
483 제로 90587 07-22
482 제로 102604 07-22
481 제로 57590 07-20
480 제로 90350 07-13

검색

회원로그인

회원가입

사이트 정보

株式会社YHPLUS / 대표 : ZERO
〒140-0011 東京都品川区東大井2-5-9-203
050-5470-4714
오픈카카오톡 (YHPLUS) :
https://open.kakao.com/o/slfDj15d

접속자집계

오늘
1,002
어제
25,212
최대
431,155
전체
6,726,254
Copyright (c) 株式会社YHPLUS. All rights reserved.