답변 2개
채택된 답변
+20 포인트
1년 전
</p>
<p> <?php
function display_latest_post($bo_table, $latest_post_id) {
global $g5;</p>
<p> // 인덱스용 게시판id
$write_table = $g5['write_prefix'] . $bo_table;
$board = sql_fetch("select * from {$g5['board_table']} where bo_table = '$bo_table'");</p>
<p> if (!$board['bo_table']) {
alert_close('인덱스용 게시판이 생성되지 않았습니다.');
}</p>
<p> if (G5_IS_MOBILE) {
$board_skin_path = get_skin_path('board', $board['bo_mobile_skin']);
$board_skin_url = get_skin_url('board', $board['bo_mobile_skin']);
} else {
$board_skin_path = get_skin_path('board', $board['bo_skin']);
$board_skin_url = get_skin_url('board', $board['bo_skin']);
}</p>
<p> // 게시물 정보 가져오기
$view = sql_fetch("select * from {$write_table} where wr_id = {$latest_post_id}");</p>
<p> if (!$view['wr_id']) {
alert_close('게시물을 찾을 수 없습니다.');
}</p>
<p> // 스킨 파일 포함
include($board_skin_path . '/view.skin.php');
}</p>
<p> display_latest_post('free', 1);</p>
<p> display_latest_post('free', 2);
?></p>
<p> <?php
$bo_tables = ['free','gallery']; // 'free', 여러 개의 인덱스용 게시판id</p>
<p> foreach ($bo_tables as $bo_table) {
$write_table = $g5['write_prefix'] . $bo_table;
$board = sql_fetch("SELECT * FROM {$g5['board_table']} WHERE bo_table = '$bo_table'");</p>
<p> if (!$board['bo_table']) {
alert_close('인덱스용 게시판이 생성되지 않았습니다: ' . $bo_table);
continue; // 다음 게시판으로 넘어감
}</p>
<p> if (defined('G5_IS_MOBILE') && G5_IS_MOBILE) {
$board_skin_path = get_skin_path('board', $board['bo_mobile_skin']);
$board_skin_url = get_skin_url('board', $board['bo_mobile_skin']);
} else {
$board_skin_path = get_skin_path('board', $board['bo_skin']);
$board_skin_url = get_skin_url('board', $board['bo_skin']);
}</p>
<p> include(G5_BBS_PATH . '/list.php');
}
?></p>
<p>
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
들레아빠
11개월 전
채택 감사 합니다.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인