article as $item) { $art_title = iconv("UTF-8","euc-kr",$item->art_title); $art_category = iconv("UTF-8","euc-kr",$item->art_category); $art_finename = iconv("UTF-8","euc-kr",$item->news_key); $art_servicedate = iconv("UTF-8","euc-kr",$item->art_servicedate); $art_date = iconv("UTF-8","euc-kr",$item->art_date); $art_photo = iconv("UTF-8","euc-kr",$item->thumb_image); $art_doc = iconv("UTF-8","euc-kr",$item->art_doc); $art_doc = mb_substr($art_doc,0,150,"euc-kr"); // 중복 제거 if ($art_title == $art_title_old) { continue; } $art_title_old = $art_title; $tmparr = array($art_title, $art_category, $art_finename, $art_servicedate, $art_date, $art_photo, $art_doc); array_push($list, $tmparr); } $current_page = $_GET["page"]; if ($current_page == '' || $current_page == 0) { $current_page = 1; } $total_cnt = count($list); // 총 글 수 $page_size = 10; // 한 페이지에 보여줄 글 수 $block_size = 10; // 한 블록에 보여줄 페이지 수 $page_count = ceil($total_cnt / $page_size); $start_row = ($current_page-1) * $page_size; $end_row = $start_row + $page_size -1; $end_row = $end_row < $total_cnt ? $end_row : $total_cnt -1; for($count = $start_row; $count <= $end_row; $count++) { $art_tit = $list[$count][0]; $art_tit = str_replace("패션의 마침표를!","스포츠 패션의 마침표를!",$art_tit); $art_tit = str_replace("일본 명품 골프'풀세트', '60만원'대 '파격할인' 30세트한정","일본 명품 골프'풀세트', '60만원'대 '파격할인' 20세트한정",$art_tit); ?>
  • ....
$page_count ? $page_count : $end_page_num; if ($current_page > $block_size) { ?> 이전 $total_cnt='.$total_cnt; // echo '
$page_count='.$page_count; // echo '
$start_row='.$start_row; // echo '
$end_row='.$end_row; // echo '
$start_page_num='.$start_page_num; // echo '
$end_page_num='.$end_page_num; for ($i = $start_page_num; $i <= $end_page_num; $i++) { if ($current_page == $i) { ?>
$end_page_num) { ?> 다음