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 );
?>
*******************
|
댓글을 작성하시려면 로그인이 필요합니다.
댓글 24개
2 ==> 2일 입니다.
빈폴더로 나와요..