DB문제인게확실한거같습니다.
function latest_all3($skin_dir="", $bo_table, $rows=10, $subject_len=40, $contents_len=200, $category="", $orderby="", $gall_order="") {
global $config;
global $g5;
$list = array();
$limitrows = $rows;
$sqlgroup = " select bo_table, bo_subject from $g5[board_table] where bo_table LIKE '".$bo_table."%' ".$gall_order." ";
$rsgroup = sql_query($sqlgroup);
if (!$skin_dir) $skin_dir = 'basic';
if(G5_IS_MOBILE) {
$latest_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;
$latest_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;
} else {
$latest_skin_path = G5_SKIN_PATH.'/latest/'.$skin_dir;
$latest_skin_url = G5_SKIN_URL.'/latest/'.$skin_dir;
}
for ($j=0, $k=0; $rowgroup=sql_fetch_array($rsgroup); $j++) {
$bo_table = $rowgroup[bo_table];
// 테이블 이름구함
$sql = " select * from {$g5[board_table]} where bo_table = '$bo_table' ";
$board = sql_fetch($sql);
$tmp_write_table = $g5[write_prefix] . $bo_table; // 게시판 테이블 실제이름
// 옵션에 따라 정렬
$sql = "select * from $tmp_write_table where wr_is_comment = 0 ";
/*
$sql .= (!$category) ? "" : " and ca_name = '$category' ";
$sql .= (!$orderby) ? " order by wr_id desc " : " order by $orderby desc, wr_id desc ";
*/
$sql .= " order by ".$orderby;
$sql .= " limit $limitrows";
//echo $sql;
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++, $k++) {
if(!$orderby) $op_list[$k] = $row[wr_datetime];
else {
$op_list[$k] = is_string($row[$orderby]) ? sprintf("%-256s", $row[$orderby]) : sprintf("%016d", $row[$orderby]);
$op_list[$k] .= $row[wr_datetime];
$op_list[$k] .= $row[wr_name];
$op_list[$k] .= $row[wr_10];
}
$list[$k] = get_list($row, $board, $latest_skin_path, $subject_len, $wr_name, $wr_10);
$list[$k][bo_table] = $board[bo_table];
$list[$k][bo_subject] = $board[bo_subject];
$list[$k][wr_name] = $board[wr_name];
$list[$k][wr_10] = $board[wr_10];
$list[$k][bo_wr_subject] = cut_str($board[bo_subject] . $list[$k][wr_subject], $subject_len, $wr_name, $wr_10);
}
}
if($k>0) array_multisort($op_list, SORT_DESC, shuffle($list));
if($k>$rows) array_splice($list, $rows);
ob_start();
include $latest_skin_path.'/latest.skin.php';
$content = ob_get_contents();
ob_end_clean();
return $content;
}
이부분을 제거하면 렉이안걸립니다.
이부분에서 문제될만한게 있을까요 ?