최근글 페이징 형식으로 표시하기
http://sir.co.kr/bbs/board.php?bo_table=g4_qa&wr_id=239122&sca=&sfl=mb_id%2C0&stx=expand82
위의 질문이 올라왔길래 한번 만들어봤습니다.
2가지 타입으로 만들어봤는데요 실제 페이징 되는 최신글과
한번 불러온후 뒤에 숨겨두고 일부분만 페이징 되도록 하는 부분입니다.
테스트를 많이 안해봐서 오류가 있을수있습니다
미리보기 사이트 입니다.
http://tproject.cafe24.com/paging_latest.php
css를 사용 한방식인경우
latest.skin.php 의 5번라인에
$split_cnt = 5; 라인별 출력갯수를 설정해주어야 합니다.
사용 예
ajax
<?=latest("paging_latest", 'latest1', 5, 70)?>
css split_cnt 를 설정해줘야함 디폴트5개
<?=latest("paging_latest2", 'latest5', 15, 70)?>
ajax를 사용 한 방법에서 한글문제가 있을수있을꺼같은데요 테스트를 utf-8부분만 해봐서
한글깨짐이 있을경우get_list_content.php 파일에서 iconv() 함수를 사용하여 한번 컨버팅 해주시면 해결될듯합니다.
++++++++++++++2012-10-04 수정++++++++++++++++++++++++++
css-hidden 방식 수정됨
latest.skin.php
7 line
$total_page = ceil($rows/$split_cnt);
=>
$total_page = ceil(count($list)/$split_cnt);
59 line
<? if (ceil($board['bo_count_write']/$rows) >= 1) { ?>
=>
<? if ($total_page >= 1) { ?>
위의 질문이 올라왔길래 한번 만들어봤습니다.
2가지 타입으로 만들어봤는데요 실제 페이징 되는 최신글과
한번 불러온후 뒤에 숨겨두고 일부분만 페이징 되도록 하는 부분입니다.
테스트를 많이 안해봐서 오류가 있을수있습니다
미리보기 사이트 입니다.
http://tproject.cafe24.com/paging_latest.php
css를 사용 한방식인경우
latest.skin.php 의 5번라인에
$split_cnt = 5; 라인별 출력갯수를 설정해주어야 합니다.
사용 예
ajax
<?=latest("paging_latest", 'latest1', 5, 70)?>
css split_cnt 를 설정해줘야함 디폴트5개
<?=latest("paging_latest2", 'latest5', 15, 70)?>
ajax를 사용 한 방법에서 한글문제가 있을수있을꺼같은데요 테스트를 utf-8부분만 해봐서
한글깨짐이 있을경우get_list_content.php 파일에서 iconv() 함수를 사용하여 한번 컨버팅 해주시면 해결될듯합니다.
++++++++++++++2012-10-04 수정++++++++++++++++++++++++++
css-hidden 방식 수정됨
latest.skin.php
7 line
$total_page = ceil($rows/$split_cnt);
=>
$total_page = ceil(count($list)/$split_cnt);
59 line
<? if (ceil($board['bo_count_write']/$rows) >= 1) { ?>
=>
<? if ($total_page >= 1) { ?>
첨부파일
|
댓글을 작성하시려면 로그인이 필요합니다.
그누4 스킨
5,847건스킨의 저작권은 해당 스킨 제작자님께 있으며, 그누보드의 저작권과 다를 수 있습니다. 스킨 다운로드시 좋아요와 감사의 코멘트를 남기시면 제작자에게 큰 힘이됩니다. ^^y 그누보드와 관련이 있지만 스킨과 빌더가 아니면 플러그인 게시판에 올려주세요.
댓글 21개
사용하다가 한가지 문제가 발생이 되었어요......
보통 하나의 게시판을 추출할경우는 문제가 안생기는데 저의경우 여러게시판을 다중으로 하나의 최신글스킨으로 출력하다보니 페이징이 나오지 않네요;;;;;
latest.lib.php 안에
// 최신글 추출 (다중 테이블)
function latest_multi_4($skin_dir="", $bo_table1,$bo_table2,$bo_table3,$bo_table4, $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_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table
and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4')
and a.wr_id = a.wr_parent
order by a.bn_id desc
limit $rows ";
$result = sql_query($sql);
for ($i=0; $board=sql_fetch_array($result); $i++)
{
$tmp_write_table = $g4[write_prefix] . $board[bo_table];
$sql = "select * from $tmp_write_table where wr_id = '$board[wr_id]'";
$result2 = sql_query($sql);
$row2 = sql_fetch_array($result2);
$list[$i] = get_list($row2, $board, $latest_skin_path, $subject_len);
$list[$i][bo_table] = $board[bo_table];
}
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
위 소스를 추가하여 <?=latest_multi_4('page', FreeBoard,QABoard,UserVote,Proposal, 18,20) ?>
이런식으로 출력해서 사용했습니다....
이런경우 어디를 별도로 수정이 필요할까요 ;;;;;;;
http://www.thecoupe.net 에서 하단에 커뮤니티와 지역별 부분입니다.
번거로우시겟지만 답변 부탁드릴께요 (__);;
베이직한그누보드용으로 개발해놔서 해당사이트에 맞게끔 사용하시려면
ajax방식인경우 get_content_list 파일도 수정해 주어야 합니다
css방식인 경우에는 문제가없을것으로보입니다 제가집에둘어가면 한번더 봐드릴께요
7라인
$total_page = ceil($rows/$split_cnt);
=>
$total_page = ceil(count($list)/$split_cnt);
59라인
<? if (ceil($board['bo_count_write']/$rows) >= 1) { ?>
=>
<? if ($total_page >= 1) { ?>
이렇게 변경해주세요
사이트 폐쇄될때까지 잘 사용하겟습니다...........꾸벅(__)
잘몰라서 ^^;
100개의 게시물을 사용자 브라우져가 가지고 있어야 하거든요.
그렇게 되면 html 양이 많아 질테고 사용자 컴퓨터에 따라 영향이 있을수있습니다.
한번 시도 해볼만 하겠네요 ^^