답변 3개 / 댓글 7개
채택된 답변
+20 포인트
Copy
<?php
$bo_table = 'free'; // 인덱스용 게시판id
$write_table = $g5['write_prefix'] . $bo_table;
$board = sql_fetch(" select * from {$g5['board_table']} where bo_table = '$bo_table' ");
if (!$board['bo_table']) {
alert_close('인덱스용 게시판이 생성되지 않았습니다.');
}
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']);
}
include_once (G5_BBS_PATH.'/view.php');
?>
답변에 대한 댓글 5개
[code]
<?php
$bo_table = 'free'; // 인덱스용 게시판id
$write_table = $g5['write_prefix'] . $bo_table;
$board = sql_fetch("select * from {$g5['board_table']} where bo_table = '$bo_table'");
if (!$board['bo_table']) {
alert_close('인덱스용 게시판이 생성되지 않았습니다.');
}
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']);
}
// 최종 게시물 가져오기
$latest_post = sql_fetch("select * from {$write_table} order by wr_id desc limit 1");
if (!$latest_post['wr_id']) {
alert_close('게시물이 존재하지 않습니다.');
}
// 게시물 정보 가져오기
$view = sql_fetch("select * from {$write_table} where wr_id = {$latest_post['wr_id']}");
if (!$view['wr_id']) {
alert_close('게시물을 찾을 수 없습니다.');
}
// 스킨 파일 경로 설정
$view_skin_path = $board_skin_path . '/view.skin.php';
// 스킨 파일 포함
include_once($view_skin_path);
// 뷰 페이지 경로 설정
include_once($board_skin_path . '/view.head.skin.php');
include_once(G5_BBS_PATH . '/view.php');
include_once($board_skin_path . '/view.tail.skin.php');
?>
[/code]
이 코드를 사용 하세요.
<?php
$bo_table = 'free'; // 인덱스용 게시판id
$write_table = $g5['write_prefix'] . $bo_table;
$board = sql_fetch("select * from {$g5['board_table']} where bo_table = '$bo_table'");
if (!$board['bo_table']) {
alert_close('인덱스용 게시판이 생성되지 않았습니다.');
}
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']);
}
// 최종 게시물 가져오기
$latest_post = sql_fetch("select * from {$write_table} order by wr_id desc limit 1");
if (!$latest_post['wr_id']) {
alert_close('게시물이 존재하지 않습니다.');
}
// 게시물 정보 가져오기
$view = sql_fetch("select * from {$write_table} where wr_id = {$latest_post['wr_id']}");
if (!$view['wr_id']) {
alert_close('게시물을 찾을 수 없습니다.');
}
// 스킨 파일 경로 설정
$view_skin_path = $board_skin_path . '/view.skin.php';
// 스킨 파일 포함
include_once($view_skin_path);
// 뷰 페이지 경로 설정
include_once($board_skin_path . '/view.head.skin.php');
include_once(G5_BBS_PATH . '/view.php');
include_once($board_skin_path . '/view.tail.skin.php');
?>
[/code]
이 코드를 사용 하세요.
latest 스킨으로 인해서 최신글을 리스트처리할수있습니다.
그런데 지금 뷰스킨을 가져오는것을 무엇을뜻하는것일까요 말그대로 뷰페이지자체를 다른곳에서 보이고자하는것인가요? 정확한 의도를 말씀해주셔야 할것 같습니다.
답변을 작성하려면 로그인이 필요합니다.
위에 알려주신 코드를 페이지에 추가하면 되는것일까요???