댓글 최신글 출력 질문 다시올립니다~ > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

댓글 최신글 출력 질문 다시올립니다~ 정보

댓글 최신글 출력 질문 다시올립니다~

본문

특정 게시판 댓글만 출력하게 하려면 어느부분을 수정해야하나요?


<?
include_once("$g4[path]/lib/latestLast2.lib.php");
echo latestAnswer("basic", "order2", 10, 100);
?>

출력할 부분에 이렇게 넣엇는데


문제는 게시판1과 게시판 2가있는데

같은 스킨을 쓰고요 게시판명칭만 하나는 order  또하나는 order2 입니다.

근데 저렇게 게시판명을 줘도 order2에 계속 order  최신글 내역도 같이 보입니다.


order게시판 위에 최신 댓글에는 order에 달린 댓글만 출력이 되어야하고

order2게시판 위에 최신 댓글에는 order2에 달린 댓글만 출력이 되어야 합니다.

이럴경우 어떻게 수정을 해주어야하나요? 위에 출력방법은 맞는건가요?~



혹시몰라 latestLast2.lip.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 bo_table, bo_subject from $g4[board_table] where bo_table not in ('order') order by gr_id, bo_table ";

$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;
}


?>
  • 복사

댓글 전체


$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 = " from $g4[board_new_table] a, $g4[board_table] b where a.bo_table = b.bo_table and b.bo_use_search = '1' "; 
아래 소스로 수정하니까 오류가 뜨네요 ㅠㅠ
이렇게 뜨는데 머가 잘못된건지ㅠ.ㅠ
-------------------------------------

select a.*, b.bo_subject, c.gr_subject, c.gr_id from g4_board_new a, g4_board b where a.bo_table = b.bo_table and b.bo_use_search = '1' and a.wr_id <> a.wr_parent order by a.bn_id desc limit 0, 10

1054 : Unknown column 'c.gr_subject' in 'field list'

error file : /bbs/board.php

-------------------------------------
아니면 혹시 댓글중에서 권한이 안되는 댓글은 안보이게 감춘다거나 할수는

있나요~?
© SIRSOFT
현재 페이지 제일 처음으로