최신글스킨, 페이징 처리. > 그누4 스킨

그누4 스킨

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

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

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

첨부파일

gallery_004_num.zip (31.5K) 405회 다운로드 2007-07-01 14:26:57

본문

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 );
?>
*******************
추천
7
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로