마지막 최신 글 본문에 출력되는 링크 만들기 정보
마지막 최신 글 본문에 출력되는 링크 만들기본문
본문과 목록을 같이 보일때 가장 마지막 최신 글이 본문에 출력되어 나오도록하려면
마지막 글의 번호를 알아내야 합니다.
그래서
common.lib.php 에
function last_page($bo_table_name)
{
$last_page_array = sql_fetch("select wr_id from g4_write_".$bo_table_name." order by wr_id desc limit 1");
$last_page = $last_page_array[wr_id];
return $last_page;
}
을 추가합니다.
그리고 최신글 게시판 제목이나 페이지 이동 버튼 또는 글로벌 메뉴등의
링크 주소인
href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?> 다음에
&wr_id=<?=last_page(게시판이름)?>
또는 필요에 따라 &wr_id=<?=last_page($board[bo_table])?>
또는 &wr_id=<?=last_page($bo_table)?>
을 덧붙이는 식으로 가장 마지막 글의 본문이 출력되게 합니다.
마지막 글의 번호를 알아내야 합니다.
그래서
common.lib.php 에
function last_page($bo_table_name)
{
$last_page_array = sql_fetch("select wr_id from g4_write_".$bo_table_name." order by wr_id desc limit 1");
$last_page = $last_page_array[wr_id];
return $last_page;
}
을 추가합니다.
그리고 최신글 게시판 제목이나 페이지 이동 버튼 또는 글로벌 메뉴등의
링크 주소인
href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?> 다음에
&wr_id=<?=last_page(게시판이름)?>
또는 필요에 따라 &wr_id=<?=last_page($board[bo_table])?>
또는 &wr_id=<?=last_page($bo_table)?>
을 덧붙이는 식으로 가장 마지막 글의 본문이 출력되게 합니다.
추천
0
0
댓글 0개