뮤

최신글스킨, 페이징 처리.

latest.JPG
1. 근사모 참조 : http://apmsetup.com/php.php?ct=5&tutid=111&uid=165#165

2. 특징 : latest.skin.php 에 페이지 처리하여.. 일반 게시판처럼 구현처리.

3. 샘풀 : http://sksna.com/index.php?gr_id=bill_skin 메인 상단 갤러리 최신글 페이지.
--------------------------------------------------------------------------

사용방법

1. g4/expend 에 아래 함수 적용.
*******************
<?
// 페이지 노출 축출
function latest_ucc_etc($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="",$options2="",$s_subject="",$s_turn="",$t_end="" , $control="" ,$control2="",$pagenum="" )
{
global $g4, $is_admin;

if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";

//정렬값이 없다면
if(!$options2)
$options2 = "wr_id";


//가로정렬값이 없는경우
if(!$options)
$options = 3;


//관리 테이블
$bo_table_cf = $bo_table;

//$bo_table 초기화
//$bo_table = "";
//$bo_table = "product";


$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; // 게시판 테이블 전체이름

//기간별 조건검색이 없는경우
if(!$s_turn){
$s_turn = 365; // 조건값이 없을경우 1년 이내의 자료만 검색
}

$s_day = 24;
$s_time = $s_day*$s_turn; //정수값을 1일로 환산처리.
$now_time = $g4[time_ymdhis]; //현재시간기준, 삭제해도 됨.
$s_start = date("Y-m-d H:i:s", time()-3600 * $s_time);

//기간별 조건검색이 없는경우
if(!$t_end){
$t_end = $g4[time_ymdhis];; // 현재시간
}
else{

$t_day = 24;
$t_time = $s_day*$t_end; //정수값을 1일로 환산처리.
$now_time = $g4[time_ymdhis]; //현재시간기준, 삭제해도 됨.
$t_end = date("Y-m-d H:i:s", time()-3600 * $t_time);
}

//조건
$s_mct = "wr_is_comment = 0 ";
$s_mct .= " and wr_datetime >= '$s_start'";
$s_mct .= " and wr_datetime <= '$t_end'";

//관리자 control
if($control){
$s_mct .= " and $control = '$control2'";
}



////////////////////////////
$s_query = " select * from $tmp_write_table where $s_mct";
$s_total = sql_query($s_query);
$total = mysql_num_rows($s_total);
$s_page = $options;
$pagesu =ceil($total/$s_page); //페이지수를 구합니다. 결과:4
$start =($s_page*$pagenum); //가져올 시작위치를 결정합니다.
//////////////////////////////


$sql = " select * from $tmp_write_table where $s_mct order by $options2 desc limit $start, $s_page";
//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;


}


?>

2. 출력하고 싶은곳에 아래의 함수를 적용.

<?
// echo latest_ucc_etc("스킨명", "테이블명", "출력수량", "제목길이", "","","","최초시작일","마지막일" , "" ,"",$pagenum=$pagenum );


// 빌더의 경우
//echo latest_ucc_etc($skin_dir=$row['mb_ids'], $bo_table=$row['po_poll1'], $rows=$row['po_ips'], $subject_len=$row['po_cnt1'], $options=$row['po_poll17'],$options2=$row['po_ips'],$s_subject=$row['po_poll12'],$s_turn=$row['po_poll13'],$t_end=$row['po_poll14'] , $control=$row['po_poll15'] ,$control2=$row['po_poll16'],$pagenum=$pagenum );
?>
*******************

첨부파일

latest.JPG (30.3 KB)
0회 2007-07-01 14:26
gallery_004_num.zip (31.5 KB) 405회 2007-07-01 14:26
|

댓글 24개

좋은 스킨감사합니다~^^
우와 뮤존님 공개해 주셔서 감사합니다 ^^
날짜는 어떻게 입력하나요 ?
1 ==> 1일
2 ==> 2일 입니다.
감사합니다~^^
적용해봐야겠네요
감사합니다..
너무 복잡해보이네요
좋은 자료 감사합니다.
감사합니다.
공개 감사합니다
감사합니다~
감사감사 잘 쓰겠습니다
감사합니다.
최신글스킨, 페이징 처리.
감사합니다~~ ^^
g4/expend 에 아래 함수 적용.--어떤 화일에 포함하나요?
빈폴더로 나와요..
댓글을 작성하시려면 로그인이 필요합니다.

그누4 스킨

5,847건

스킨의 저작권은 해당 스킨 제작자님께 있으며, 그누보드의 저작권과 다를 수 있습니다. 스킨 다운로드시 좋아요와 감사의 코멘트를 남기시면 제작자에게 큰 힘이됩니다. ^^y 그누보드와 관련이 있지만 스킨과 빌더가 아니면 플러그인 게시판에 올려주세요.

+
분류 제목 글쓴이 날짜 조회
달력 07-07-03 조회 2만
게시판 07-07-03 조회 7,271
최근게시물 07-07-03 조회 1.8만
기타 07-07-03 조회 3,953
최신글 07-07-03 조회 7,103
외부로그인 07-07-02 조회 5,520
최근게시물
[최근게시물]
07-07-02 조회 1.4만
회원통합스킨 07-07-01 조회 7,678
최신글 07-07-01 조회 8,191