전체 코멘트 불러오기.. > 그누4 스킨

그누4 스킨

스킨의 저작권은 해당 스킨 제작자님께 있으며, 그누보드의 저작권과 다를 수 있습니다.
스킨 다운로드시 좋아요와 감사의 코멘트를 남기시면 제작자에게 큰 힘이됩니다. ^^y
그누보드와 관련이 있지만 스킨과 빌더가 아니면 플러그인 게시판에 올려주세요.

전체 코멘트 불러오기.. 정보

최근게시물 전체 코멘트 불러오기..

첨부파일

최신코멘트.zip (45.5K) 635회 다운로드 2008-12-25 15:52:32

본문

압축해제하시면 lib 폴더와 skin 폴더가 있습니다.
lib 폴더에는 fixing.lib.php 와 comment.lib.php 파일 2개가 있으며
skin 폴더에는 newcomment 폴더가 있고 그안에 2개 폴더가 있습니다.


[설치]
압축해제후 그누 폴더에 그대로 업로드 하신후 comment.lib.php 파일을 인클루드 하세요.

include_once("$g4[path]/lib/comment.lib.php ");


fixing.lib.php 파일을 적용하신분은 중간생략하셔도 됩니다.

common.php 파일 350줄 근처로 보시고 아래와 같이 수정하세요.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// 보드 설정값을 불러 저장
include_once("$g4[path]/lib/fixing.lib.php");

if (isset($bo_table)) {
    //$board = sql_fetch(" select * from {$g4['board_table']} where bo_table = '$bo_table' ");
 $num = $g4_board[num][$bo_table];
 $board = $g4_board[$num];
    if ($board['bo_table']) {
        $gr_id = $board['gr_id'];
        $write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
        //$comment_table = $g4['write_prefix'] . $bo_table . $g4['comment_suffix']; // 코멘트 테이블 전체이름
        if ($wr_id)
            $write = sql_fetch(" select * from $write_table where wr_id = '$wr_id' ");
    }
}

if (isset($gr_id)){
    //$group = sql_fetch(" select * from {$g4['group_table']} where gr_id = '$gr_id' ");
 $num = $g4_group[num][$gr_id];
 $group = $g4_group[$num];
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

위내용에서 실질적으로는 include_once("$g4[path]/lib/fixing.lib.php"); 만있으면됩니다.
그외 내용은 fixing.lib.php 파일에서 저장한 내용을 디비에서 다시 불러들이는 내용이여서 위와 같이 수정하시면 쿼리를 줄일수 있습니다.
그외 latest.lib.php 파일의 수정은 아래 소스를 붙여 넣기 하세요.

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

// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
    global $g4, $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();

    //$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
    //$board = sql_fetch($sql);
    $num = $g4_board[num][$bo_table];
    $board = $g4_board[$num];

    $tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
    //$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
    // 위의 코드 보다 속도가 빠름
    $sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num 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;
}
?>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
latest.lib.php 파일 또한 수정을 안해도 됩니다.
수정하신경우 다량으로 최신글이 불러지는 페이지에서 불러진최신글의 수만큼 쿼리수가 줄어듭니다.


함수 호출은 head.php 파일 에서 원하시는 위치에서 <?=comment("타이틀", "스킨명", 목록수, 제목길이)?> 를 적어주시면 됩니다.


[기능]
1. 전체 최신 코멘트 보기
2. 비밀글 작성자나 최고관리자만 보여짐.
추천
11

댓글 전체

include_once("$g4[path]/lib/comment.lib.php ");
include를 어디에 해야하는지요 head.php 에 했는데 아래와같은 오류가...
쪼끔만 도와주세요 ^^;

Warning: main(./lib/comment.lib.php ): failed to open stream: No such file or directory in /home1/hewego/public_html/board/head_main.php on line 10

Warning: main(): Failed opening './lib/comment.lib.php ' for inclusion (include_path='.:/usr/lib/php/pear') in /home1/hewego/public_html/board/head_main.php on line 10
newcomment 폴더를 skin 바로 밑에 넣었고..
fixing.lib.php comment.lib.php  파일 그대로 lib 폴더에 덮어쓰기 했고..
common.php 파일 350줄 수정했고..
latest.lib.php 파일의 수정 했고..
 
head 부분에 불러올거라서 인크루드 head 파일 상단에
include_once("$g4[path]/lib/comment.lib.php "); 하고

<?=comment("타이틀", "스킨명", 목록수, 제목길이)?>  넣어서
<?=comment("test", "basic", 5, 20)?>
했는데.. 왜 안될까요?? ㅠㅠㅠ
혹시라도 위 설정대로 하셨는데 에러 나오는 분들을 위해 조금이나마 도움 되고자 말씀드립니다.
저도 이게 뭥미~? 하면서도 왜 안되나 싶었는데요!!

include_once("$g4[path]/lib/comment.lib.php ");

위 내용에 한부분 입니다. php " 보이시죠? 이 부분은  php" 로 해주시기 바랍니다.ㅡㅡ^
공백 하나에 문제가 생기네여 ~
수정없이
압축파일 푸시고 lib 파일은 그위치에 skin 파일은 그위치에 적용시키시고

불러올곳에


<?
include_once("$g4[path]/lib/comment.lib.php");
include_once("$g4[path]/lib/fixing.lib.php");
echo newcomment("전체댓글", "basic", 15, 20);

?>


이럼되요..~_~
전체 5,853 |RSS
그누4 스킨 내용 검색

회원로그인

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