카테고리별 최신 글 추출인데 댓글까지 나오네요.. 정보
카테고리별 최신 글 추출인데 댓글까지 나오네요..본문
<?
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인데 이상하게도 댓글을 입력하면, 댓글까지 글이 출력이 되네요. 댓글은 어떻게 해야 수정 안될까여.
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인데 이상하게도 댓글을 입력하면, 댓글까지 글이 출력이 되네요. 댓글은 어떻게 해야 수정 안될까여.
댓글 전체
중간쯤
$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 ";
로 고치면 될거 같네요.
$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 ";
로 고치면 될거 같네요.
해결했습니다!