특정 게시판이나 특정그룹게시판의 코멘트 추출하는방법

특정 게시판이나 특정그룹게시판의 코멘트 추출하는방법

QA

특정 게시판이나 특정그룹게시판의 코멘트 추출하는방법

본문

 
 
제목그대로 특정 게시판이나 특정그룹게시판의 코멘트만 추출하는 방법
 
문의입니다.
 
 
my_guest2 라는 게시판 위에 최신댓글이 출력이  되는데 문제는
 
order그룹에 들어가있는 모든 게시판의 최신글이 다 노출됩니다.
 
그래서 order라는 그룹을 order2로 따로 다른 게시판들과 그룹분리를 햇는데도
 
추출이 됩니다.
 
 
 
리스트의 최신댓글 부분입니다.
 
<?
include_once("$g4[path]/lib/latestLast.lib.php");
echo latestAnswer("basic", "", 15, 100);
?>
 
 
 
 
order2 그룹에 속해있는 my_guest2 게시판에서 작성된 댓글만
최신글로 추출하고 싶을때 어느파일의 어느부분을 수정or추가해야하나요~
 
초보라서 자세히 부탁드립니다.
 
아래는 latestLast.lib.php 입니다.
 
 
 
<?
if (!defined('_GNUBOARD_')) exit;
// 최신댓글 추출
function latestAnswer($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
    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_common = " from $g4[board_new_table] a, $g4[board_table] b, $g4[group_table] c
              where a.bo_table = b.bo_table and b.gr_id = c.gr_id and b.bo_use_search = '1' ";
if ($gr_id)
    $sql_common .= " and b.gr_id = '$gr_id' ";
   
$sql_common .= " and a.wr_id <> a.wr_parent ";
if ($mb_id)
    $sql_common .= " and a.mb_id = '$mb_id' ";
$sql_order = " order by a.bn_id desc ";
if (!$page) $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select a.*, b.bo_subject, c.gr_subject, c.gr_id
          $sql_common
          $sql_order
          limit $from_record, $rows ";
    $result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
    $tmp_write_table = $g4[write_prefix] . $row[bo_table];
        $comment = "";
        $comment_link = "";
        $row2 = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_id]' ");
        $list[$i] = $row2;
        $name = get_sideview($row2[mb_id], cut_str($row2[wr_name], $config[cf_cut_name]), $row2[wr_email], $row2[wr_homepage]);
        // 당일인 경우 시간으로 표시함
        $datetime = substr($row2[wr_datetime],0,10);
        $datetime2 = $row2[wr_datetime];
        if ($datetime == $g4[time_ymd])
            $datetime2 = substr($datetime2,11,5);
        else
            $datetime2 = substr($datetime2,5,5);
 
    $list[$i][gr_id] = $row[gr_id];
    $list[$i][bo_table] = $row[bo_table];
    $list[$i][name] = $name;
    $list[$i][comment] = $comment;
   $list[$i][href] = "$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row2[wr_id]{$comment_link}";

    $list[$i][datetime] = $datetime;
    $list[$i][datetime2] = $datetime2;
    $list[$i][gr_subject] = $row[gr_subject];
    $list[$i][bo_subject] = $row[bo_subject];
    $list[$i][subject] = conv_subject($row2[wr_content], $subject_len, "…");
 $list[$i][subject2] = $row[subject];
 $list[$i][subject3] = $row2[subject];  
}
   
    ob_start();
    include "$latest_skin_path/latest.skin.php";
    $content = ob_get_contents();
    ob_end_clean();
    return $content;
}
?>
 
 
 
 
 
 
 
 
 
 

이 질문에 댓글 쓰기 :

답변 1

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

회원로그인

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