Merge branch 'master' of github.com:gnuboard/g4s

This commit is contained in:
whitedot
2013-02-01 16:36:28 +09:00
4 changed files with 16 additions and 8 deletions

View File

@ -3,10 +3,16 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 분류 사용 여부
$is_category = false;
$category_option = '';
if ($board['bo_use_category']) {
$is_category = true;
$category_location = './board.php?bo_table='.$bo_table.'&sca=';
$category_option = get_category_option($bo_table); // SELECT OPTION 태그로 넘겨받음
$categorys = explode('|', $board['bo_category_list']); // 구분자가 , 로 되어 있음
for ($i=0; $i<count($categorys); $i++) {
if (trim($categorys[$i]))
$category_option .= '<li>'.$categorys[$i].'</li>';
}
}
$sop = strtolower($sop);

View File

@ -47,14 +47,14 @@ if (!$board['bo_use_list_view']) {
$prev_href = '';
if (isset($prev['wr_id']) && $prev['wr_id']) {
$prev_wr_subject = get_text(cut_str($prev['wr_subject'], 255));
$prev_href = './board.php?bo_table='.$bo_table.'&amp;wr_id='.$prev['wr_id'].'&amp;page='.$page.$qstr;
$prev_href = './board.php?bo_table='.$bo_table.'&amp;wr_id='.$prev['wr_id'].$qstr;
}
// 다음글 링크
$next_href = '';
if (isset($next['wr_id']) && $next['wr_id']) {
$next_wr_subject = get_text(cut_str($next['wr_subject'], 255));
$next_href = './board.php?bo_table='.$bo_table.'&amp;wr_id='.$next['wr_id'].'&amp;page='.$page.$qstr;
$next_href = './board.php?bo_table='.$bo_table.'&amp;wr_id='.$next['wr_id'].$qstr;
}
// 쓰기 링크

View File

@ -18,6 +18,8 @@ function get_microtime()
// 현재페이지, 총페이지수, 한페이지에 보여줄 행, URL
function get_paging($write_pages, $cur_page, $total_page, $url, $add="")
{
$url = preg_replace('#(&amp;|&)?page\=[0-9]+#', '', $url);
$str = '';
if ($cur_page > 1) {
$str .= '<a href="'.$url.'1'.$add.'" class="pg_page pg_start">처음</a>'.PHP_EOL;
@ -801,7 +803,7 @@ function get_category_option($bo_table='', $ca_name='')
$category = trim($arr[$i]);
if (!$category) continue;
$str .= "<option value=\"$arr[$i]\"";
$str .= "<lioption value=\"$arr[$i]\"";
if ($category == $ca_name) {
$str .= ' selected="selected"';
}

View File

@ -15,10 +15,10 @@ if ($is_nogood) $colspan++;
<div id="bo_cate">
<? if ($is_category) { ?>
<form id="fcategory" name="fcategory" method="get">
<select name="sca" onchange="location='<?=$category_location?>'+<?=strtolower($g4['charset'])=='utf-8' ? "encodeURIComponent(this.value)" : "this.value"?>;">
<option value=''>전체</option>
<ul>
<li>전체</li>
<?=$category_option?>
</select>
</ul>
</form>
<? } ?>
</div>
@ -244,4 +244,4 @@ $(function() {
});
});
</script>
<![endif]-->
<![endif]-->