s

메인에 특정그룹에 속한 모든게시판의 게시물을 날짜순으로 최신글을 추출하는 방법?

메인에 특정그룹에 속한 모든게시판의 게시물을 날짜순으로 최신글을 추출하려고 합니다~
아래는 최신글 추출하는 함수입니다~
select 구문을 어떻게 수정하면 될까요?

<?=latest("스킨", "그룹아이디", 5, 70);
메인에는 최근게시물의 형식처럼 불려오고요~~
선배님들의 답변을 기다립니다~

// 최신글 추출
function 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 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;
}

댓글 1개

활용팁이나 질문답변에 "latest_group" 으로 검색해 보세요
댓글을 작성하시려면 로그인이 필요합니다.

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

+
제목 글쓴이 날짜 조회
10-08-26 조회 1,541
10-08-26 조회 2,749
10-08-26 조회 1,751
10-08-26 조회 1,932
10-08-26 조회 1,666
10-08-26 조회 1,651
10-08-26 조회 2,370
10-08-26 조회 1,678
10-08-26 조회 1,647
10-08-26 조회 1,642
10-08-26 조회 1,139
10-08-26 조회 1,350
10-08-26 조회 1,350
10-08-26 조회 1,682
10-08-26 조회 1,635
10-08-26 조회 2,187
10-08-26 조회 1,596
10-08-26 조회 1,732
10-08-26 조회 1,434
10-08-26 조회 2,626