|
|
|
16년 전
|
조회 984
|
|
|
|
16년 전
|
조회 980
|
|
|
|
16년 전
|
조회 986
|
|
|
|
16년 전
|
조회 999
|
|
|
|
16년 전
|
조회 1,554
|
|
|
|
16년 전
|
조회 1,037
|
|
|
|
16년 전
|
조회 988
|
|
|
|
16년 전
|
조회 1,007
|
|
|
|
16년 전
|
조회 977
|
|
|
|
16년 전
|
조회 1,557
|
|
|
|
16년 전
|
조회 762
|
|
|
|
16년 전
|
조회 840
|
|
|
|
16년 전
|
조회 1,701
|
|
|
|
16년 전
|
조회 808
|
|
|
|
16년 전
|
조회 980
|
|
|
|
16년 전
|
조회 920
|
|
|
|
16년 전
|
조회 1,002
|
|
|
|
16년 전
|
조회 981
|
|
|
|
16년 전
|
조회 818
|
|
|
|
16년 전
|
조회 985
|
댓글 2개
// 최신글 추출
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;
}
이 함수를 통해서 list.skin.php를 메인에 원하는 위치에 include 해서 사용하는 형태입니다.
index.php 파일 상단에 라이브러리 페이지 인크루드 해주시고
include_once("$g4[path]/lib/latest.lib.php");
원하는 위치에 <?=latest('스킨이름', '게시판테이블이름(전체아님)', 4, 33);?> 이러한 형태로 함수 호출을 하시면
그위치에 스킨 페이지를 include 하는것입니다.
스킨은 현재 기본 스킨 위치 참고 하셔서 추가 하실때도 그 폴더 하단에 넣으시면 됩니다.
메뉴얼에도 있는 내용인데 답변 드리기 쑥스럽네요~
혹 <? include include "$latest_skin_path/latest.skin.php";?>
이런 형태로 사용하시려면 위 함수에 내용은 latest.skin.php 안에 넣어 주셔야 겠지요
테이블 명도 따로 지정 해주셔야 할꺼고 그러면 스킨 개념이 아니라 별도의 파일이 되겠군요 ^^