메뉴보이기 및 출력순서 적용

This commit is contained in:
gnuboard
2013-02-25 17:20:56 +09:00
parent 1fc4856f71
commit 72aec2598a
14 changed files with 93 additions and 26 deletions

View File

@ -78,7 +78,8 @@ $sql = " insert into {$g4['board_table']}
bo_upload_size = '{$board[bo_upload_size]}',
bo_reply_order = '{$board[bo_reply_order]}',
bo_use_search = '{$board[bo_use_search]}',
bo_order_search = '{$board[bo_order_search]}',
bo_show_menu = '{$board[bo_show_menu]}',
bo_order = '{$board[bo_order]}',
bo_notice = '{$board['bo_notice']}',
bo_upload_count = '{$board[bo_upload_count]}',
bo_use_email = '{$board[bo_use_email]}',

View File

@ -12,6 +12,10 @@ if (!$row['cnt'])
$html_title = '게시판';
if (!isset($board['bo_show_menu'])) {
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_show_menu` TINYINT NOT NULL DEFAULT '0' AFTER `bo_order_search`, ADD `bo_order` INT NOT NULL DEFAULT '0' AFTER `bo_show_menu` ", false);
}
if ($w == '') {
$html_title .= ' 생성';
@ -40,6 +44,9 @@ if ($w == '') {
$board['bo_skin'] = 'basic';
$board['gr_id'] = $gr_id;
$board['bo_use_secret'] = 0;
$board['bo_include_head'] = '_head.php';
$board['bo_include_tail'] = '_tail.php';
$board['bo_show_menu'] = true;
} else if ($w == 'u') {
@ -110,6 +117,7 @@ $pg_anchor = "<ul class=\"anchor\">
<th scope="row"><label for="gr_id">그룹<strong class="sound_only">필수</strong></label></th>
<td colspan="2">
<?=get_group_select('gr_id', $board['gr_id'], 'required');?>
<? if ($w=='u') { ?><script>document.write("<a href='javascript:;' onclick=\"location.href='./board_list.php?sfl=a.gr_id&stx='+document.getElementById('gr_id').value;\">동일그룹게시판목록</a>");</script><?}?></td>
</td>
</tr>
<tr>
@ -538,14 +546,26 @@ $pg_anchor = "<ul class=\"anchor\">
</td>
</tr>
<tr>
<th scope="row"><label for="bo_order_search">전체 검색 순서</label></th>
<th scope="row"><label for="bo_show_menu">메뉴보이기</label></th>
<td>
<?=help('숫자가 낮은 게시판 부터 검색')?>
<input type="text" id="bo_order_search" name="bo_order_search" class="frm_input" value="<?=$board['bo_order_search']?>" size="4">
<?=help("사용에 체크하시면 게시판 제목을 메뉴에 출력합니다.")?>
<input type="checkbox" id="bo_show_menu" name="bo_show_menu" value="1" <?=$board['bo_show_menu']?'checked':'';?>>
사용
</td>
<td class="group_setting">
<input type="checkbox" id="chk_order_search" name="chk_order_search" value="1">
<label for="chk_order_search">동일그룹 모두 적용</label>
<input type="checkbox" id="chk_show_menu" name="chk_show_menu" value="1">
<label for="chk_show_menu">동일그룹 모두 적용</label>
</td>
</tr>
<tr>
<th scope="row"><label for="bo_order">출력 순서</label></th>
<td>
<?=help('숫자가 낮은 게시판 부터 메뉴나 검색시 우선 출력합니다.')?>
<input type="text" id="bo_order" name="bo_order" class="frm_input" value="<?=$board['bo_order']?>" size="4">
</td>
<td class="group_setting">
<input type="checkbox" id="chk_order" name="chk_order" value="1">
<label for="chk_order">동일그룹 모두 적용</label>
</td>
</tr>
</tbody>

View File

@ -102,7 +102,7 @@ $sql_common = " gr_id = '{$_POST['gr_id']}',
bo_upload_size = '{$_POST['bo_upload_size']}',
bo_reply_order = '{$_POST['bo_reply_order']}',
bo_use_search = '{$_POST['bo_use_search']}',
bo_order_search = '{$_POST['bo_order_search']}',
bo_order = '{$_POST['bo_order']}',
bo_write_min = '{$_POST['bo_write_min']}',
bo_write_max = '{$_POST['bo_write_max']}',
bo_comment_min = '{$_POST['bo_comment_min']}',
@ -265,7 +265,7 @@ if (is_checked('chk_content_head')) $fields .= " , bo_content_head = '{$bo_c
if (is_checked('chk_content_tail')) $fields .= " , bo_content_tail = '{$bo_content_tail}' ";
if (is_checked('chk_insert_content')) $fields .= " , bo_insert_content = '{$bo_insert_content}' ";
if (is_checked('chk_use_search')) $fields .= " , bo_use_search = '{$bo_use_search}' ";
if (is_checked('chk_order_search')) $fields .= " , bo_order_search = '{$bo_order_search}' ";
if (is_checked('chk_order')) $fields .= " , bo_order = '{$bo_order}' ";
for ($i=1; $i<=10; $i++) {
if (is_checked('chk_'.$i)) {
$fields .= " , bo_{$i}_subj = '".$_POST['bo_'.$i.'_subj']."' ";

View File

@ -112,7 +112,8 @@ $colspan = 8;
<th scope="col">댓글P<span class="sound_only">포인트</span></th>
<th scope="col">다운P<span class="sound_only">포인트</span></th>
<th scope="col"><?=subject_sort_link('bo_use_search')?>검색<br>사용</a></th>
<th scope="col"><?=subject_sort_link('bo_order_search')?>검색<br>순서</a></th>
<th scope="col"><?=subject_sort_link('bo_show_menu')?>메뉴<br>보임</a></th>
<th scope="col"><?=subject_sort_link('bo_order')?>출력<br>순서</a></th>
<th scope="col">접속기기</th>
<th scope="col">관리</th>
</tr>
@ -147,8 +148,9 @@ $colspan = 8;
<td><input type="text" name="bo_write_point[<?=$i?>]" class="frm_input" value="<?=$row['bo_write_point']?>" size="2" title="쓰기포인트"></td>
<td><input type="text" name="bo_comment_point[<?=$i?>]" class="frm_input" value="<?=$row['bo_comment_point']?>" size="2" title="댓글포인트"></td>
<td><input type="text" name="bo_download_point[<?=$i?>]" class="frm_input" value="<?=$row['bo_download_point']?>" size="2" title="다운포인트"></td>
<td><input type="checkbox" id="bo_use_search_<?=$i?>" name="bo_use_search[<?=$i?>]" <?=$row['bo_use_search']?"checked":""?> value="1" title="검색사용"></td>
<td><input type="text" id="bo_order_search_<?=$i?>" name="bo_order_search[<?=$i?>]" class="frm_input" value="<?=$row['bo_order_search']?>" size="2" title="검색순서"></td>
<td><input type="checkbox" id="bo_use_search_<?=$i?>" name="bo_use_search[<?=$i?>]" <?=$row['bo_use_search']?"checked":""?> value="1" title="선택시 검색사용"></td>
<td><input type="checkbox" id="bo_use_search_<?=$i?>" name="bo_show_menu[<?=$i?>]" <?=$row['bo_show_menu']?"checked":""?> value="1" title="선택시 메뉴보이기"></td>
<td><input type="text" id="bo_order<?=$i?>" name="bo_order[<?=$i?>]" class="frm_input" value="<?=$row['bo_order']?>" size="2" title="출력순서"></td>
</td>
<td>
<select id="bo_device_<?=$i?>" name="bo_device[<?=$i?>]">

View File

@ -37,7 +37,8 @@ if ($_POST['act_button'] == "선택수정") {
bo_comment_point = '{$_POST['bo_comment_point'][$k]}',
bo_download_point = '{$_POST['bo_download_point'][$k]}',
bo_use_search = '{$_POST['bo_use_search'][$k]}',
bo_order_search = '{$_POST['bo_order_search'][$k]}'
bo_show_menu = '{$_POST['bo_show_menu'][$k]}',
bo_order = '{$_POST['bo_order'][$k]}'
where bo_table = '{$_POST['board_table'][$k]}' ";
sql_query($sql);
}

View File

@ -13,13 +13,17 @@ if ($w == '') {
$gr['gr_use_access'] = 0;
$html_title .= ' 생성';
} else if ($w == 'u') {
$gr_id_attr = 'readonly style="background-color:#dddddd"';
$gr_id_attr = 'readonly';
$gr = sql_fetch(" select * from {$g4['group_table']} where gr_id = '$gr_id' ");
$html_title .= ' 수정';
}
else
alert('제대로 된 값이 넘어오지 않았습니다.');
if (!isset($group['gr_show_menu'])) {
sql_query(" ALTER TABLE `{$g4['group_table']}` ADD `gr_show_menu` TINYINT NOT NULL DEFAULT '0' AFTER `gr_use_access`, ADD `gr_order` INT NOT NULL DEFAULT '0' AFTER `gr_show_menu` ", true);
}
$g4['title'] = $html_title;
include_once('./admin.head.php');
?>
@ -45,7 +49,14 @@ include_once('./admin.head.php');
<tbody>
<tr>
<th scope="row"><label for="gr_id">그룹 ID<?=$sound_only?></label></th>
<td><input type="text" id="gr_id" name="gr_id" maxlength="10" class="<?=$gr_id_attr?> alnum_ frm_input" value="<?=$group['gr_id']?>"> 영문자, 숫자, _ 만 가능 (공백없이)</td>
<td><input type="text" id="gr_id" name="gr_id" maxlength="10" class="<?=$gr_id_attr?> alnum_ frm_input" value="<?=$group['gr_id']?>">
<?
if ($w=='')
echo '영문자, 숫자, _ 만 가능 (공백없이)';
else
echo '<a href="'.G4_BBS_URL.'/group.php?gr_id='.$group['gr_id'].'">게시판그룹 바로가기</a>';
?>
</td>
</tr>
<tr>
<th scope="row"><label for="gr_subject">그룹 제목<strong class="sound_only">필수</strong></label></th>
@ -98,6 +109,14 @@ include_once('./admin.head.php');
?>
</td>
</tr>
<tr>
<th scope="row"><label for="gr_show_menu">메뉴보이기</label></th>
<td>
<?=help("사용에 체크하시면 게시판그룹 제목을 메뉴에 출력합니다.")?>
<input type="checkbox" id="gr_show_menu" name="gr_show_menu" value="1" <?=$gr['gr_show_menu']?'checked':'';?>>
사용
</td>
</tr>
<? for ($i=1;$i<=10;$i++) { ?>
<tr>
<th scope="row">회원여분필드<?=$i?></th>

View File

@ -17,6 +17,7 @@ if (!$gr_subject) alert('그룹 제목을 입력하세요.');
$sql_common = " gr_subject = '{$_POST['gr_subject']}',
gr_device = '{$_POST['gr_device']}',
gr_admin = '{$_POST['gr_admin']}',
gr_show_menu = '{$_POST['gr_show_menu']}',
gr_1_subj = '{$_POST['gr_1_subj']}',
gr_2_subj = '{$_POST['gr_2_subj']}',
gr_3_subj = '{$_POST['gr_3_subj']}',

View File

@ -105,9 +105,11 @@ $colspan = 8;
<th scope="col"><?=subject_sort_link('gr_id')?>그룹아이디</a></th>
<th scope="col"><?=subject_sort_link('gr_subject')?>제목</a></th>
<?if ($is_admin == 'super'){?><th scope="col"><?=subject_sort_link('gr_admin')?>그룹관리자</a></th><?}?>
<th scope="col">게시판</th>
<th scope="col">접근사용</th>
<th scope="col">접근회원수</th>
<th scope="col">게시판<br>갯수</th>
<th scope="col">접근<br>사용</th>
<th scope="col">접근<br>회원수</th>
<th scope="col">메뉴<br>보임</th>
<th scope="col">출력<br>순서</th>
<th scope="col">접속기기</th>
<th scope="col">관리</th>
</tr>
@ -132,13 +134,13 @@ $colspan = 8;
<input type="checkbox" id="chk_<?=$i?>" name="chk[]" value="<?=$i?>" title="<?=$row['gr_subject']?> 그룹선택">
<input type="hidden" name="group_id[<?=$i?>]" value="<?=$row['gr_id']?>">
</td>
<td class="td_mbid"><a href="<?=G4_BBS_URL?>/group.php?gr_id=<?=$row['gr_id']?>"><?=$row['gr_id']?></a></td>
<td class="td_grid"><a href="<?=G4_BBS_URL?>/group.php?gr_id=<?=$row['gr_id']?>"><?=$row['gr_id']?></a></td>
<td>
<input type="text" id="gr_subject_<?=$i?>" name="gr_subject[<?=$i?>]" class="frm_input" value="<?=get_text($row['gr_subject'])?>" title="그룹제목 수정">
</td>
<td>
<?if ($is_admin == 'super'){?>
<input type="text" id="gr_admin" name="gr_admin[<?=$i?>]" class="frm_input" value="<?=$row['gr_admin']?>" title="그룹관리자 수정" maxlength="20">
<input type="text" id="gr_admin" name="gr_admin[<?=$i?>]" size="10" class="frm_input" value="<?=$row['gr_admin']?>" title="그룹관리자 수정" maxlength="20">
<?}else{?>
<input type="hidden" name="gr_admin[<?=$i?>]" value="<?=$row['gr_admin']?>"><td><?=$row['gr_admin']?>
<?}?>
@ -146,6 +148,10 @@ $colspan = 8;
<td><a href="./board_list.php?sfl=a.gr_id&amp;stx=<?=$row['gr_id']?>"><?=$row2['cnt']?></a></td>
<td><input type="checkbox" id="gr_use_access" name="gr_use_access[<?=$i?>]" <?=$row['gr_use_access']?'checked':''?> value="1" title="선택 시 접근회원 사용"></td>
<td><a href="./boardgroupmember_list.php?gr_id=<?=$row['gr_id']?>"><?=$row1['cnt']?></a></td>
<td><input type="checkbox" id="gr_show_menu" name="gr_show_menu[<?=$i?>]" <?=$row['gr_show_menu']?'checked':''?> value="1" title="선택 시 메뉴보이기"></td>
<td>
<input type="text" id="gr_order_<?=$i?>" name="gr_order[<?=$i?>]" size="2" class="frm_input" value="<?=$row['gr_order']?>" title="출력순서 수정">
</td>
<td>
<select id="gr_device_<?=$i?>" name="gr_device[<?=$i?>]">
<option value="both"<?=get_selected($row['gr_device'], 'both');?>>모두</option>

View File

@ -23,7 +23,9 @@ for ($i=0; $i<$count; $i++)
set gr_subject = '{$_POST['gr_subject'][$k]}',
gr_device = '{$_POST['gr_device'][$k]}',
gr_admin = '{$_POST['gr_admin'][$k]}',
gr_use_access = '{$_POST['gr_use_access'][$k]}'
gr_use_access = '{$_POST['gr_use_access'][$k]}',
gr_show_menu = '{$_POST['gr_show_menu'][$k]}',
gr_order = '{$_POST['gr_order'][$k]}'
where gr_id = '{$gr_id}' ";
if ($is_admin != 'super')
$sql .= " and gr_admin = '{$_POST['gr_admin'][$k]}' ";

View File

@ -34,7 +34,7 @@ if ($is_admin == 'group')
$sql .= " and b.gr_admin = '{$member['mb_id']}' ";
else if ($is_admin == 'board')
$sql .= " and a.bo_admin = '{$member['mb_id']}' ";
$sql .= " order by a.gr_id, a.bo_order_search, a.bo_table ";
$sql .= " order by a.gr_id, a.bo_order, a.bo_table ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{

View File

@ -27,7 +27,7 @@ if ($stx) {
$onetable = isset($onetable) ? $onetable : "";
if ($onetable) // 하나의 게시판만 검색한다면
$sql .= " and bo_table = '{$onetable}' ";
$sql .= " order by bo_order_search, gr_id, bo_table ";
$sql .= " order by bo_order, gr_id, bo_table ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{

View File

@ -248,6 +248,7 @@ td {padding:8px 5px 6px;border-top:1px solid #e9e9e9;border-bottom:1px solid #e9
.td_chk {width:30px;text-align:center}
.td_num {width:60px;text-align:center}
.td_bignum {width:120px;text-align:center}
.td_grid {width:60px;text-align:center}
.td_mbid,
.td_name,
.td_mbname {width:100px;text-align:left !important}

View File

@ -127,13 +127,24 @@ if ($config['cf_include_head']) {
<script>$('#gnb').addClass('gnb_js');</script>
<h2>홈페이지 메인메뉴</h2>
<ul>
<?
$sql = " select * from {$g4['group_table']} where gr_show_menu order by gr_order ";
$result = sql_query($sql);
for ($gi=0; $row=sql_fetch_array($result); $gi++) { // gi 는 group index
?>
<li class="gnb_1depth">
<a href="<?=$g4['url']?>/bbs/board.php?bo_table=sirgle">분류1</a>
<a href="<?=G4_BBS_URL?>/group.php?gr_id=<?=$row['gr_id']?>"><?=$row['gr_subject']?></a>
<ul>
<li class="gnb_2depth"><a href="#">게시판1</a></li>
<li class="gnb_2depth"><a href="#">게시판2</a></li>
<?
$sql2 = " select * from {$g4['board_table']} where gr_id = '{$row['gr_id']}' order by bo_order ";
$result2 = sql_query($sql2);
for ($bi=0; $row2=sql_fetch_array($result2); $bi++) { // bi 는 board index
?>
<li class="gnb_2depth"><a href="<?=G4_BBS_URL?>/board.php?bo_table=<?=$row2['bo_table']?>"><?=$row2['bo_subject']?></a></li>
<?}?>
</ul>
</li>
<?}?>
</ul>
</nav>

View File

@ -76,7 +76,8 @@ CREATE TABLE IF NOT EXISTS `g4s_board` (
`bo_upload_size` int(11) NOT NULL default '0',
`bo_reply_order` tinyint(4) NOT NULL default '0',
`bo_use_search` tinyint(4) NOT NULL default '0',
`bo_order_search` int(11) NOT NULL default '0',
`bo_show_menu` tinyint(4) NOT NULL default '0',
`bo_order` int(11) NOT NULL default '0',
`bo_count_write` int(11) NOT NULL default '0',
`bo_count_comment` int(11) NOT NULL default '0',
`bo_write_min` int(11) NOT NULL default '0',
@ -293,6 +294,8 @@ CREATE TABLE IF NOT EXISTS `g4s_group` (
`gr_subject` varchar(255) NOT NULL default '',
`gr_admin` varchar(255) NOT NULL default '',
`gr_use_access` tinyint(4) NOT NULL default '0',
`gr_show_menu` int(11) NOT NULL default '0',
`gr_order` tinyint(4) NOT NULL default '0',
`gr_1_subj` varchar(255) NOT NULL default '',
`gr_2_subj` varchar(255) NOT NULL default '',
`gr_3_subj` varchar(255) NOT NULL default '',