최신글스킨, 페이징 처리. 정보
최신글 최신글스킨, 페이징 처리.관련링크
첨부파일
본문
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 );
?>
*******************
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 );
?>
*******************
추천
7
7
댓글 전체
좋은 스킨감사합니다~^^
감사합니다..^^
우와 뮤존님 공개해 주셔서 감사합니다 ^^
감사합니다.
날짜는 어떻게 입력하나요 ?
1 ==> 1일
2 ==> 2일 입니다.
2 ==> 2일 입니다.
감사합니다~^^
ㄳ
ㄳㄳ~
감사 감사 ~
적용해봐야겠네요
감사합니다..
너무 복잡해보이네요
d
좋은 자료 감사합니다.
감사합니다.
공개 감사합니다
감사합니다~
bnmbn
감사감사 잘 쓰겠습니다
감사합니다.
최신글스킨, 페이징 처리.
감사합니다~~ ^^
g4/expend 에 아래 함수 적용.--어떤 화일에 포함하나요?
빈폴더로 나와요..
빈폴더로 나와요..