구매고객
판매자
솔루션별 질문
객관적이지 않은 사유는 인정되지 않으며, 신고 권한이 제재될 수 있습니다.
0/200
신고 사유에 해당하지 않는 글을 신고하면 신고 권한이 제한될 수 있습니다.
이 회원의 커뮤니티 콘텐츠와 알림을 내 화면에서만 숨깁니다.
신고는 접수되지 않으며, 숨긴 회원은 내 정보에서 다시 보이게 할 수 있습니다.
신고할 글이 아닌가요? 이 회원만 숨기기
신고하기로 돌아가기
그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.
전체 67032개 중 50061-50080번째
댓글 5개
$ca_name = $list[$i][ca_name];
for 문 시작..
if($ca_name == "카타고리명") {
기타 등등 내용....
}
for 문 끝..
요런식으로 하면될듯 싶어요.
어찌 하오리까?
질문자의 질문에 대한 정확한 답일터인데...
대신 extend/developer.lib.php에 다음의 함수를 넣어서
// 특정 카테고리 최신글 추출
function new_latest($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 wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 and ca_name ='원하는 카테고리명' order by wr_id desc 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;
}
최신글 불러올때 new_latest("","", 5, 20);형식으로 해서 만들었답니다.
도움주신 분들에게 감사합니다.