From e6d32bcaf4e3d1b9b2c95b2fc0889c5ccde7010b Mon Sep 17 00:00:00 2001 From: gnuboard Date: Wed, 6 Feb 2013 17:41:33 +0900 Subject: [PATCH] =?UTF-8?q?page=3D=20=EB=91=90=EB=B2=88=20=EB=82=98?= =?UTF-8?q?=EC=98=A4=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/admin.lib.php | 14 +++++++------- lib/common.lib.php | 12 ++++++++++-- test.php | 30 +++++++----------------------- 3 files changed, 24 insertions(+), 32 deletions(-) diff --git a/adm/admin.lib.php b/adm/admin.lib.php index a3ca32f19..d4bb2cb81 100644 --- a/adm/admin.lib.php +++ b/adm/admin.lib.php @@ -260,11 +260,11 @@ while ($entry = $tmp->read()) { } @ksort($amenu); -$qstr = ''; -if (isset($sst)) $qstr .= '&sst='.$sst; -if (isset($sod)) $qstr .= '&sod='.$sod; -if (isset($sfl)) $qstr .= '&sfl='.$sfl; -if (isset($stx)) $qstr .= '&stx='.$stx; -if (isset($page)) $qstr .= '&page='.$page; -//$qstr = 'sst=$sst&sod=$sod&sfl=$sfl&stx=$stx&page=$page'; +$arr_query = array(); +if (isset($sst)) $arr_query[] = 'sst='.$sst; +if (isset($sod)) $arr_query[] = 'sod='.$sod; +if (isset($sfl)) $arr_query[] = 'sfl='.$sfl; +if (isset($stx)) $arr_query[] = 'stx='.$stx; +if (isset($page)) $arr_query[] = 'page='.$page; +$qstr = implode("&", $arr_query); ?> \ No newline at end of file diff --git a/lib/common.lib.php b/lib/common.lib.php index 0351b0c95..65c195451 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -18,7 +18,7 @@ function get_microtime() // 현재페이지, 총페이지수, 한페이지에 보여줄 행, URL function get_paging($write_pages, $cur_page, $total_page, $url, $add="") { - $url = preg_replace('#(&|&)?page\=[0-9]+#', '', $url); + $url = preg_replace('#&page=[0-9]*(&page=)$#', '$1', $url); $str = ''; if ($cur_page > 1) { @@ -748,7 +748,15 @@ function subject_sort_link($col, $query_string='', $flag='asc') } } - return ''; + $arr_query = array(); + $arr_query[] = $q1; + $arr_query[] = $q2; + $arr_query[] = 'sfl='.$sfl; + $arr_query[] = 'stx='.$stx; + $arr_query[] = 'page='.$page; + $qstr = implode("&", $arr_query); + + return ""; } diff --git a/test.php b/test.php index c276d6d96..26cf6e554 100644 --- a/test.php +++ b/test.php @@ -1,24 +1,8 @@ - - - -title - - - - +이 문자열에서 부분을 치환합니다.

- -
치환하기 - - - - - - \ No newline at end of file +echo preg_replace('#(&|&)?page\=[^&]*#', '', $qstr3); +?> \ No newline at end of file