게시판분류 select option 을 ul li 로 변경

This commit is contained in:
gnuboard
2013-02-01 17:10:20 +09:00
parent 7b1e23f792
commit 3813b7b165
5 changed files with 19 additions and 19 deletions

View File

@ -8,10 +8,10 @@ if ($board['bo_use_category']) {
$is_category = true;
$category_location = './board.php?bo_table='.$bo_table.'&sca=';
$categorys = explode('|', $board['bo_category_list']); // 구분자가 , 로 되어 있음
for ($i=0; $i<count($categorys); $i++) {
if (trim($categorys[$i]))
$category_option .= '<li>'.$categorys[$i].'</li>';
$categories = explode('|', $board['bo_category_list']); // 구분자가 , 로 되어 있음
for ($i=0; $i<count($categories); $i++) {
if (trim($categories[$i]))
$category_option .= '<li>'.$categories[$i].'</li>';
}
}

View File

@ -224,6 +224,7 @@ if ($is_guest || ($is_admin && $w == 'u' && $member['mb_id'] != $write['mb_id'])
}
$is_category = false;
$category_option = '';
if ($board['bo_use_category']) {
$ca_name = "";
if (isset($write['ca_name']))

View File

@ -797,17 +797,17 @@ function get_category_option($bo_table='', $ca_name='')
{
global $g4, $board;
$arr = explode("|", $board['bo_category_list']); // 구분자가 , 로 되어 있음
$categories = explode("|", $board['bo_category_list']); // 구분자가 , 로 되어 있음
$str = "";
for ($i=0; $i<count($arr); $i++) {
$category = trim($arr[$i]);
for ($i=0; $i<count($categories); $i++) {
$category = trim($categories[$i]);
if (!$category) continue;
$str .= "<lioption value=\"$arr[$i]\"";
$str .= "<option value=\"$categories[$i]\"";
if ($category == $ca_name) {
$str .= ' selected="selected"';
}
$str .= ">$arr[$i]</option>\n";
$str .= ">$categories[$i]</option>\n";
}
return $str;

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>

View File

@ -152,13 +152,12 @@ echo $option_hidden;
// 관리자라면 분류 선택에 '공지' 옵션을 추가함
if ($is_admin)
{
echo "
if (typeof(document.fwrite.ca_name) != 'undefined')
{
document.fwrite.ca_name.options.length += 1;
document.fwrite.ca_name.options[document.fwrite.ca_name.options.length-1].value = '공지';
document.fwrite.ca_name.options[document.fwrite.ca_name.options.length-1].text = '공지';
}";
echo '
if (ca_name_select = document.getElementById("ca_name")) {
ca_name_select.options.length += 1;
ca_name_select.options[ca_name_select.options.length-1].value = "공지";
ca_name_select.options[ca_name_select.options.length-1].text = "공지";
}';
}
?>