야한남자

게시판리스트메인에빼는법질문입니다.

list.skin.php 를 index.php 첫페이지에뺄수잇는방법좀알려주세요

아이프레임방식이아닌 .list.skin.php  파일을 인클루드해서 쓸수잇는방법입니다.
|

댓글 2개

그누보드 설치 경로/lib/latest.lib.php 보시면 아래와 같은 함수 있습니다.

// 최신글 추출
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 안에 넣어 주셔야 겠지요

테이블 명도 따로 지정 해주셔야 할꺼고 그러면 스킨 개념이 아니라 별도의 파일이 되겠군요 ^^
정말친절한답변감사합니다 ^^ 진심으로 감사드려요~^^
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
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