야

카테고리별 최신 글 추출인데 댓글까지 나오네요..

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

// 최신글 카테고리 데이타만 추출
function latest_category ($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 = " select * from $g4[board_table] where bo_table = '$bo_table'";
$board = sql_fetch($sql);

$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
$sql = " select * from $tmp_write_table where ca_name = '$options' 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.group.lib.php인데 이상하게도 댓글을 입력하면, 댓글까지 글이 출력이 되네요. 댓글은 어떻게 해야 수정 안될까여.

댓글 2개

중간쯤

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

를

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

로 고치면 될거 같네요.
해결했습니다!
댓글을 작성하시려면 로그인이 필요합니다.

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

+
제목 글쓴이 날짜 조회
08-12-18 조회 1,049
08-12-18 조회 1,014
08-12-18 조회 1,045
08-12-18 조회 1,696
08-12-18 조회 1,630
08-12-18 조회 1,157
08-12-18 조회 2,652
08-12-18 조회 1,608
08-12-18 조회 1,973
08-12-18 조회 1,057
08-12-18 조회 1,201
08-12-18 조회 1,008
08-12-18 조회 1,583
08-12-18 조회 1,902
08-12-17 조회 918
08-12-17 조회 977
08-12-17 조회 1,642
08-12-17 조회 927
08-12-17 조회 1,008
08-12-17 조회 1,034