게시판 카테고리중 하나만 최신글로 출력할때 정보
게시판 카테고리중 하나만 최신글로 출력할때
본문
적용스킨 : http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=642&sca=&sfl=wr_subject&stx=%C4%AB%C5%D7%B0%ED%B8%AE&sop=and&page=3
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 : http://www.nadovip.com/bbs/group.php?gr_id=h100
중간에 내용이 하나 빠져서 나옵니다.
lib화일 다 올립니다.
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출 - 선택한 카테고리별로 원하는 수만큼 보여줌
function latest_cat($skin_dir="", $bo_table, $cat, $rows=10, $subject_len=40){
global $config;
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
$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 wr_comment > -1 && ca_name = '$cat' order by wr_id desc limit 0, $rows ";
$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;
}
?>
스킨화일입니다.
<table align="center" cellpadding="0" cellspacing="0" width="100%" border="0">
<? for ($i=0; $i<count($list); $i++) {?>
<tr>
<!--게시물 아래 점선 색상을 바꾸고 싶으시면 211,211,211부분을, 게시물 추출부분 세로 길이를 늘리시려면 25을 수정하세요-->
<td width="100%" height="23" valign=middle style="border-bottom-width:0px; border-bottom-color:rgb(211,211,211); border-bottom-style:dotted;">
<?
//날짜표시
$subject = $list[$i][subject];
$b_subject = "<strong>".$list[$i][subject]."<strong>";
?>
<table align="center" cellpadding="0" cellspacing="0" width="100%" height="100%" border="0">
<tr>
<td width="3"></td>
<td><span style='color:#777777;font-weight:bold;'>ㆍ</span><a href='<?=$list[$i][href]?>'>
<?=$list[$i][subject]?><?=$list[$i][wr_9]?>
</a>
</td>
<td width="80" align="center"><?=$list[$i][name]?></td>
<td width="30" align="right"><span style='font:normal 11px tahoma; color:#BABABA;'><?=$list[$i][datetime2]?></span></td>
<td width='5'></td>
</tr>
</table>
<!--게시물 추출 글자 설정 끝-->
</td>
</tr>
<? } ?>
</table>
어디서 잘못되었느지 모르겠습니다.
부탁좀 드리겠습니다.
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 : http://www.nadovip.com/bbs/group.php?gr_id=h100
중간에 내용이 하나 빠져서 나옵니다.
lib화일 다 올립니다.
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출 - 선택한 카테고리별로 원하는 수만큼 보여줌
function latest_cat($skin_dir="", $bo_table, $cat, $rows=10, $subject_len=40){
global $config;
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
$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 wr_comment > -1 && ca_name = '$cat' order by wr_id desc limit 0, $rows ";
$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;
}
?>
스킨화일입니다.
<table align="center" cellpadding="0" cellspacing="0" width="100%" border="0">
<? for ($i=0; $i<count($list); $i++) {?>
<tr>
<!--게시물 아래 점선 색상을 바꾸고 싶으시면 211,211,211부분을, 게시물 추출부분 세로 길이를 늘리시려면 25을 수정하세요-->
<td width="100%" height="23" valign=middle style="border-bottom-width:0px; border-bottom-color:rgb(211,211,211); border-bottom-style:dotted;">
<?
//날짜표시
$subject = $list[$i][subject];
$b_subject = "<strong>".$list[$i][subject]."<strong>";
?>
<table align="center" cellpadding="0" cellspacing="0" width="100%" height="100%" border="0">
<tr>
<td width="3"></td>
<td><span style='color:#777777;font-weight:bold;'>ㆍ</span><a href='<?=$list[$i][href]?>'>
<?=$list[$i][subject]?><?=$list[$i][wr_9]?>
</a>
</td>
<td width="80" align="center"><?=$list[$i][name]?></td>
<td width="30" align="right"><span style='font:normal 11px tahoma; color:#BABABA;'><?=$list[$i][datetime2]?></span></td>
<td width='5'></td>
</tr>
</table>
<!--게시물 추출 글자 설정 끝-->
</td>
</tr>
<? } ?>
</table>
어디서 잘못되었느지 모르겠습니다.
부탁좀 드리겠습니다.
댓글 전체
뭐가 중간에 하나가 빠져나온다는 뜻인지요?
그림화일 올렸습니다.
다른부분은 아무런 잘못된 사항이 없습니다.
다만
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
이부분에서 $config[cf_latest_skin]"; 이 스킨이 어떤 역활을 하는지를 알 수 없네요..
이부분이 쬐금 의심이 값니다.
다만
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/$config[cf_latest_skin]";
이부분에서 $config[cf_latest_skin]"; 이 스킨이 어떤 역활을 하는지를 알 수 없네요..
이부분이 쬐금 의심이 값니다.
원인은 댓글이 있을경우에는 안보이게 한것 같은데요...
대기로 검색을 해보세요
감사합니다. 해결되었습니다. ^^
$sql = " select * from $tmp_write_table where wr_comment > -1 && ca_name = '$cat' order by wr_id desc limit 0, $rows ";
이걸
$sql = " select * from $tmp_write_table where wr_comment = 0 && ca_name = '$cat' order by wr_id desc limit 0, $rows ";
으로 바꾸니 해결되었습니다.
정말 다시한번 감사드립니다.
$sql = " select * from $tmp_write_table where wr_comment > -1 && ca_name = '$cat' order by wr_id desc limit 0, $rows ";
이걸
$sql = " select * from $tmp_write_table where wr_comment = 0 && ca_name = '$cat' order by wr_id desc limit 0, $rows ";
으로 바꾸니 해결되었습니다.
정말 다시한번 감사드립니다.
결과값이 원래 확정된것만 나오게 하는것 아닌가요 댓글이 있던 없던 구분에 확정만 나오는것이 정상이 아닌가 생각을 합니다.