페이징 함수 이점과 이후에 코드를 추가할수 있는 함수 추가
page_insertbefore() page_insertafter()
This commit is contained in:
@ -132,14 +132,19 @@ if ($sca || $stx) {
|
||||
|
||||
//if ($prev_spt >= $min_spt)
|
||||
$prev_spt = $spt - $config['cf_search_part'];
|
||||
if (isset($min_spt) && $prev_spt >= $min_spt)
|
||||
if (isset($min_spt) && $prev_spt >= $min_spt) {
|
||||
$prev_part_href = './board.php?bo_table='.$bo_table.$qstr.'&spt='.$prev_spt.'&page=1';
|
||||
$write_pages = page_insertbefore($write_pages, '<a href="'.$prev_part_href.'">이전검색</a>');
|
||||
}
|
||||
|
||||
$next_spt = $spt + $config['cf_search_part'];
|
||||
if ($next_spt < 0)
|
||||
if ($next_spt < 0) {
|
||||
$next_part_href = './board.php?bo_table='.$bo_table.$qstr.'&spt='.$next_spt.'&page=1';
|
||||
$write_pages = page_insertafter($write_pages, '<a href="'.$next_part_href.'">다음검색</a>');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$write_href = '';
|
||||
if ($member['mb_level'] >= $board['bo_write_level']) {
|
||||
$write_href = './write.php?bo_table='.$bo_table;
|
||||
|
||||
@ -51,6 +51,21 @@ function get_paging($write_pages, $cur_page, $total_page, $url, $add="")
|
||||
return "";
|
||||
}
|
||||
|
||||
// 페이징 코드의 <div><span> 태그 다음에 코드를 삽입
|
||||
function page_insertbefore($paging_html, $insert_html)
|
||||
{
|
||||
if ($paging_html) {
|
||||
return preg_replace("/^(<div[^>]+><span[^>]+>)/", '$1'.$insert_html, $paging_html);
|
||||
}
|
||||
}
|
||||
|
||||
// 페이징 코드의 </span></div> 태그 이전에 코드를 삽입
|
||||
function page_insertafter($paging_html, $insert_html)
|
||||
{
|
||||
if ($paging_html) {
|
||||
return preg_replace("/(<\/span><\/div>)$/", $insert_html.'$1', $paging_html);
|
||||
}
|
||||
}
|
||||
|
||||
// 변수 또는 배열의 이름과 값을 얻어냄. print_r() 함수의 변형
|
||||
function print_r2($var)
|
||||
|
||||
@ -156,9 +156,7 @@ if ($is_nogood) $colspan++;
|
||||
<? } ?>
|
||||
|
||||
<!-- 페이지 -->
|
||||
<? if ($prev_part_href) { echo '<a href="'.$prev_part_href.'">이전검색</a>'; } ?>
|
||||
<?=$write_pages?>
|
||||
<? if ($next_part_href) { echo '<a href="'.$next_part_href.'">다음검색</a>'; } ?>
|
||||
<? echo $write_pages; ?>
|
||||
|
||||
<script>
|
||||
<? if ($sca) { echo "document.fcategory.sca.value = \"$sca\";"; } ?>
|
||||
|
||||
Reference in New Issue
Block a user