카테고리 선택, 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= "1) $a_1_prev_page=""; if($page<$total_page) $a_1_next_page=""; if($page>$show_page_num) { $prev_page=$start_page; $a_prev_page=""; $print_page.="[1].."; $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.=" $move_page "; else $print_page.="[$move_page]"; $i++; } if($total_page>$move_page) { $next_page=$move_page+1; $a_next_page=""; $print_page.="..[$total_page]"; $next_page_exists = true; } // 검색시 Divsion 페이지 이동 표시 if($use_division) { if($prevdivpage&&!$prev_page_exists) $a_div_prev_page="[Previous search]..."; if($nextdivpage&&!$next_page_exists) $a_div_next_page="...[Continue search]"; $print_page = $a_div_prev_page.$print_page.$a_div_next_page; } /*************************************************************************** * 각종 링크를 미리 지정하는 부분 **************************************************************************/ // 글쓰기버튼 if($is_admin||$member[level]<=$setup[grant_write]) $a_write=""; else $a_write="-2000000000) {include $dir."/list_main.php";} else {include $dir."/list_notice.php"; } $_skinTime += getmicrotime()-$_skinTimeStart; $loop_number--; } if($check2) { while($data=@mysql_fetch_array($result2)) { list_check(&$data); $_skinTimeStart = getmicrotime(); if($data[headnum]>-2000000000) {include $dir."/list_main.php";} else {include $dir."/list_notice.php"; } $_skinTime += getmicrotime()-$_skinTimeStart; $loop_number--; } } // 마무리 부분 출력하는 부분;; $_skinTimeStart = getmicrotime(); include $dir."/list_foot.php"; $_skinTime += getmicrotime()-$_skinTimeStart; if($zbLayer) { $_skinTimeStart = getmicrotime(); echo "\n"; unset($zbLayer); $_skinTime += getmicrotime()-$_skinTimeStart; } foot(); /*************************************************************************** * 마무리 부분 include **************************************************************************/ include "_foot.php"; ?>