새벽에 뜬금없지만.. 그룹 최신글 페이징 가능할까요..?

새벽에 뜬금없지만.. 그룹 최신글 페이징 가능할까요..?

QA

새벽에 뜬금없지만.. 그룹 최신글 페이징 가능할까요..?

본문

검색신공으로 그룹 최신글도 찾고 페이징 최신글도 찾았는데
그룹최신글이 페이징 되는건 쉽지가 않네요. 


이 스킨을 그룹 최신글로 바꾸면 완벽할거 같은데 방법이 있을까요?


// 최신글 추출
function latest_paging($skin_dir="", $bo_table, $url, $page=1, $page_name="page", $rows=5, $subject_len=40, $write_page=5, $total_count = '', $options="")
{
	global $g4, $config;

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

	$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($total_count == "")
	{
		$sql = sql_fetch(" select count(*) as cnt, MIN(wr_num) as n_num, MAX(wr_num) as m_num from $tmp_write_table where wr_is_comment = 0 order by wr_num");
		$total_count = $sql[cnt];
		$min_number = $sql[n_num];
		$max_number = $sql[m_num];
	}	else  {
		$sql = sql_fetch(" select count(*) as cnt, MIN(wr_num) as n_num from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $total_count");
		$min_number = $sql[n_num];
		$max_number = $sql[n_num] + $total_count;
	}

	$total_page  = ceil($total_count / $rows);  // 전체 페이지 계산
	if (!$page) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
	$from_record = ($page - 1) * $rows; // 시작 열을 구함

	// 게시물 구해오기
	$sql = " select * from $tmp_write_table where wr_is_comment = 0 AND (wr_num between '".$min_number."' and '".$max_number."') order by wr_num limit $from_record, $rows ";

	//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);
	}

	if(strstr($url, "?")) { 
		$connect = "&";
	} else { 
		$connect = "?";
	}

	$write_pages = get_paging($write_page, $page, $total_page, $url.$connect.$page_name."=");

	ob_start();
	include "$latest_skin_path/latest.skin.php";
	$content = ob_get_contents();
	ob_end_clean();

	return $content;
}

이 질문에 댓글 쓰기 :

답변 1

생각을 달리해
일반 그룹최신글 스킨에

적용해서 해결했습니다.
답변을 작성하시기 전에 로그인 해주세요.
전체 8
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT