묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
궁금... 소스 풀이 요망 !
2003.08.05 22:03
// 사용권한 체크
if($setup[grant_list]<$member[level] && !$is_admin) Error("사용권한이 없습니다","login.php?id=$id&page=$page&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&no=$no&s_url=".urlencode($REQUEST_URI));
// 검색조건이 있을때 : 상황 -> 카테고리 선택, Use_Showreply 사용, 또는 검색어로 검색을 할때
if($s_que) {
$_dbTimeStart = getmicrotime();
$que="select * from $t_board"."_$id $s_que order by $select_arrange $desc limit $start_num, $page_num";
$result=mysql_query($que,$connect) or Error(mysql_error());
$_dbTime += getmicrotime()-$_dbTimeStart;
}
// 검색 조건이 없을때 : 상황 -> 일반 정렬, 또는 정렬기준을 가지거나 Desc, Asc 일때.
else {
// 검색조건이 없고 정렬이 headnum에 의한 것일때;; 즉 일반 정렬일때;;
if ($select_arrange=="headnum"&&$desc=="asc") {
while($division_data=mysql_fetch_array($division_result)) {
$sum=$sum+$division_data[num];
$division=$division_data[division];
if($sum>=$start_num) {
$start_num=$start_num-($sum-$division_data[num]);
$_dbTimeStart = getmicrotime();
$que="select * from $t_board"."_$id where division='$division' and headnum<0 order by headnum,arrangenum limit $start_num, $page_num";
$result=mysql_query($que) or error(mysql_error());
$_dbTime += getmicrotime()-$_dbTimeStart;
$check1=1;
$returnNum = mysql_num_rows($result);
if($returnNum>=$page_num) {
break;
} else {
if($division>1) {
$division--;
$minus=$page_num-$returnNum;
$_dbTimeStart = getmicrotime();
$que2="select * from $t_board"."_$id where division=$division and headnum!=0 order by headnum,arrangenum limit $minus";
$result2=mysql_query($que2) or error(mysql_error());
$_dbTime += getmicrotime()-$_dbTimeStart;
$check2=1;
break;
}
}
}
}
}
// 검색조건은 없지만 정렬값이 생길때;;; //////////////////////////////
else {
$que="select * from $t_board"."_$id $s_que order by $select_arrange $desc $add_on limit $start_num, $page_num";
$_dbTimeStart = getmicrotime();
$result=mysql_query($que,$connect) or Error(mysql_error());
$_dbTime += getmicrotime()-$_dbTimeStart;
}
}
// 관리자일때는 게시판 글 옮기기때문에 게시판 리스트를 뽑아옴;;
if($is_admin) {
$_dbTimeStart = getmicrotime();
$board_result=mysql_query("select no,name from $admin_table where no!='$setup[no]'");
$_dbTime += getmicrotime()-$_dbTimeStart;
}
/***************************************************************************
* 스킨에서 사용할 페이지 정리
**************************************************************************/
$print_page="";
$show_page_num=$setup[page_num]; // 한번에 보일 페이지 갯수
$start_page=(int)(($page-1)/$show_page_num)*$show_page_num;
$i=1;
$a_1_prev_page= "<Zeroboard ";
$a_1_next_page= "<Zeroboard ";
$a_prev_page = "<Zeroboard ";
$a_next_page = "<Zeroboard ";
if($page>1) $a_1_prev_page="<a onfocus=blur() href='$PHP_SELF?id=$id&page=".($page-1)."&select_arrange=$select_arrange&desc=$desc&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&sn1=$sn1&divpage=$divpage'>";
if($page<$total_page) $a_1_next_page="<a onfocus=blur() href='$PHP_SELF?id=$id&page=".($page+1)."&select_arrange=$select_arrange&desc=$desc&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&sn1=$sn1&divpage=$divpage'>";
if($page>$show_page_num) {
$prev_page=$start_page;
$a_prev_page="<a onfocus=blur() href='$PHP_SELF?id=$id&page=$prev_page&select_arrange=$select_arrange&desc=$desc&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&sn1=$sn1&divpage=$divpage'>";
$print_page.="<a onfocus=blur() href='$PHP_SELF?id=$id&page=1&select_arrange=$select_arrange&desc=$desc&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&sn1=$sn1&divpage=$divpage'><font style=font-size:8pt>[1]</a><font style=font-size:8pt>..";
$prev_page_exists = true;
}
while($i+$start_page<=$total_page&&$i<=$show_page_num) {
$move_page=$i+$start_page;
if($page==$move_page) $print_page.=" <font style=font-size:8pt><b>$move_page</b> ";
else $print_page.="<a onfocus=blur() href='$PHP_SELF?id=$id&page=$move_page&select_arrange=$select_arrange&desc=$desc&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&sn1=$sn1&divpage=$divpage'><font style=font-size:8pt>[$move_page]</a>";
$i++;
}
if($total_page>$move_page) {
$next_page=$move_page+1;
$a_next_page="<a onfocus=blur() href='$PHP_SELF?id=$id&page=$next_page&select_arrange=$select_arrange&desc=$desc&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&sn1=$sn1&divpage=$divpage'>";
$print_page.="<font style=font-size:8pt>..<a onfocus=blur() href='$PHP_SELF?id=$id&page=$total_page&select_arrange=$select_arrange&desc=$desc&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&sn1=$sn1&divpage=$divpage'><font style=font-size:8pt>[$total_page]</a>";
$next_page_exists = true;
}
* zero님에 의해서 게시물 이동되었습니다 (2003-08-05 22:56)
if($setup[grant_list]<$member[level] && !$is_admin) Error("사용권한이 없습니다","login.php?id=$id&page=$page&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&no=$no&s_url=".urlencode($REQUEST_URI));
// 검색조건이 있을때 : 상황 -> 카테고리 선택, Use_Showreply 사용, 또는 검색어로 검색을 할때
if($s_que) {
$_dbTimeStart = getmicrotime();
$que="select * from $t_board"."_$id $s_que order by $select_arrange $desc limit $start_num, $page_num";
$result=mysql_query($que,$connect) or Error(mysql_error());
$_dbTime += getmicrotime()-$_dbTimeStart;
}
// 검색 조건이 없을때 : 상황 -> 일반 정렬, 또는 정렬기준을 가지거나 Desc, Asc 일때.
else {
// 검색조건이 없고 정렬이 headnum에 의한 것일때;; 즉 일반 정렬일때;;
if ($select_arrange=="headnum"&&$desc=="asc") {
while($division_data=mysql_fetch_array($division_result)) {
$sum=$sum+$division_data[num];
$division=$division_data[division];
if($sum>=$start_num) {
$start_num=$start_num-($sum-$division_data[num]);
$_dbTimeStart = getmicrotime();
$que="select * from $t_board"."_$id where division='$division' and headnum<0 order by headnum,arrangenum limit $start_num, $page_num";
$result=mysql_query($que) or error(mysql_error());
$_dbTime += getmicrotime()-$_dbTimeStart;
$check1=1;
$returnNum = mysql_num_rows($result);
if($returnNum>=$page_num) {
break;
} else {
if($division>1) {
$division--;
$minus=$page_num-$returnNum;
$_dbTimeStart = getmicrotime();
$que2="select * from $t_board"."_$id where division=$division and headnum!=0 order by headnum,arrangenum limit $minus";
$result2=mysql_query($que2) or error(mysql_error());
$_dbTime += getmicrotime()-$_dbTimeStart;
$check2=1;
break;
}
}
}
}
}
// 검색조건은 없지만 정렬값이 생길때;;; //////////////////////////////
else {
$que="select * from $t_board"."_$id $s_que order by $select_arrange $desc $add_on limit $start_num, $page_num";
$_dbTimeStart = getmicrotime();
$result=mysql_query($que,$connect) or Error(mysql_error());
$_dbTime += getmicrotime()-$_dbTimeStart;
}
}
// 관리자일때는 게시판 글 옮기기때문에 게시판 리스트를 뽑아옴;;
if($is_admin) {
$_dbTimeStart = getmicrotime();
$board_result=mysql_query("select no,name from $admin_table where no!='$setup[no]'");
$_dbTime += getmicrotime()-$_dbTimeStart;
}
/***************************************************************************
* 스킨에서 사용할 페이지 정리
**************************************************************************/
$print_page="";
$show_page_num=$setup[page_num]; // 한번에 보일 페이지 갯수
$start_page=(int)(($page-1)/$show_page_num)*$show_page_num;
$i=1;
$a_1_prev_page= "<Zeroboard ";
$a_1_next_page= "<Zeroboard ";
$a_prev_page = "<Zeroboard ";
$a_next_page = "<Zeroboard ";
if($page>1) $a_1_prev_page="<a onfocus=blur() href='$PHP_SELF?id=$id&page=".($page-1)."&select_arrange=$select_arrange&desc=$desc&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&sn1=$sn1&divpage=$divpage'>";
if($page<$total_page) $a_1_next_page="<a onfocus=blur() href='$PHP_SELF?id=$id&page=".($page+1)."&select_arrange=$select_arrange&desc=$desc&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&sn1=$sn1&divpage=$divpage'>";
if($page>$show_page_num) {
$prev_page=$start_page;
$a_prev_page="<a onfocus=blur() href='$PHP_SELF?id=$id&page=$prev_page&select_arrange=$select_arrange&desc=$desc&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&sn1=$sn1&divpage=$divpage'>";
$print_page.="<a onfocus=blur() href='$PHP_SELF?id=$id&page=1&select_arrange=$select_arrange&desc=$desc&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&sn1=$sn1&divpage=$divpage'><font style=font-size:8pt>[1]</a><font style=font-size:8pt>..";
$prev_page_exists = true;
}
while($i+$start_page<=$total_page&&$i<=$show_page_num) {
$move_page=$i+$start_page;
if($page==$move_page) $print_page.=" <font style=font-size:8pt><b>$move_page</b> ";
else $print_page.="<a onfocus=blur() href='$PHP_SELF?id=$id&page=$move_page&select_arrange=$select_arrange&desc=$desc&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&sn1=$sn1&divpage=$divpage'><font style=font-size:8pt>[$move_page]</a>";
$i++;
}
if($total_page>$move_page) {
$next_page=$move_page+1;
$a_next_page="<a onfocus=blur() href='$PHP_SELF?id=$id&page=$next_page&select_arrange=$select_arrange&desc=$desc&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&sn1=$sn1&divpage=$divpage'>";
$print_page.="<font style=font-size:8pt>..<a onfocus=blur() href='$PHP_SELF?id=$id&page=$total_page&select_arrange=$select_arrange&desc=$desc&category=$category&sn=$sn&ss=$ss&sc=$sc&keyword=$keyword&sn1=$sn1&divpage=$divpage'><font style=font-size:8pt>[$total_page]</a>";
$next_page_exists = true;
}
* zero님에 의해서 게시물 이동되었습니다 (2003-08-05 22:56)