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

This commit is contained in:
whitedot
2014-03-14 17:31:19 +09:00
29 changed files with 521 additions and 170 deletions

View File

@ -88,7 +88,6 @@ $sql = " insert into {$g5['board_table']}
bo_upload_size = '{$board[bo_upload_size]}',
bo_reply_order = '{$board[bo_reply_order]}',
bo_use_search = '{$board[bo_use_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]}',

View File

@ -21,10 +21,6 @@ if (!isset($board['bo_device'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_device` ENUM( 'both', 'pc', 'mobile' ) NOT NULL DEFAULT 'both' AFTER `bo_subject` ", false);
}
if (!isset($board['bo_show_menu'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_show_menu` TINYINT NOT NULL DEFAULT '0' AFTER `bo_use_search`, ADD `bo_order` INT NOT NULL DEFAULT '0' AFTER `bo_show_menu` ", false);
}
if (!isset($board['bo_mobile_skin'])) {
sql_query(" ALTER TABLE `{$g5['board_table']}` ADD `bo_mobile_skin` VARCHAR(255) NOT NULL DEFAULT '' AFTER `bo_skin` ", false);
}
@ -120,7 +116,6 @@ if ($w == '') {
$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') {
@ -769,20 +764,6 @@ $frm_submit .= '</div>';
<label for="chk_all_use_search">전체적용</label>
</td>
</tr>
<tr>
<th scope="row"><label for="bo_show_menu">메뉴보이기</label></th>
<td>
<?php echo help("사용에 체크하시면 게시판 제목을 메뉴에 출력합니다.") ?>
<input type="checkbox" name="bo_show_menu" value="1" id="bo_show_menu" <?php echo $board['bo_show_menu']?'checked':''; ?>>
사용
</td>
<td class="td_grpset">
<input type="checkbox" name="chk_grp_show_menu" value="1" id="chk_grp_show_menu">
<label for="chk_grp_show_menu">그룹적용</label>
<input type="checkbox" name="chk_all_show_menu" value="1" id="chk_all_show_menu">
<label for="chk_all_show_menu">전체적용</label>
</td>
</tr>
<tr>
<th scope="row"><label for="bo_order">출력 순서</label></th>
<td>

View File

@ -107,7 +107,6 @@ $sql_common = " gr_id = '{$_POST['gr_id']}',
bo_reply_order = '{$_POST['bo_reply_order']}',
bo_use_search = '{$_POST['bo_use_search']}',
bo_order = '{$_POST['bo_order']}',
bo_show_menu = '{$_POST['bo_show_menu']}',
bo_write_min = '{$_POST['bo_write_min']}',
bo_write_max = '{$_POST['bo_write_max']}',
bo_comment_min = '{$_POST['bo_comment_min']}',
@ -290,7 +289,6 @@ if (is_checked('chk_grp_mobile_content_tail')) $grp_fields .= " , bo_mob
if (is_checked('chk_grp_insert_content')) $grp_fields .= " , bo_insert_content = '{$bo_insert_content}' ";
if (is_checked('chk_grp_use_search')) $grp_fields .= " , bo_use_search = '{$bo_use_search}' ";
if (is_checked('chk_grp_order')) $grp_fields .= " , bo_order = '{$bo_order}' ";
if (is_checked('chk_grp_show_menu')) $grp_fields .= " , bo_show_menu = '{$bo_show_menu}' ";
for ($i=1; $i<=10; $i++) {
if (is_checked('chk_grp_'.$i)) {
$grp_fields .= " , bo_{$i}_subj = '".$_POST['bo_'.$i.'_subj']."' ";
@ -374,7 +372,6 @@ if (is_checked('chk_all_mobile_content_tail')) $all_fields .= " , bo_mob
if (is_checked('chk_all_insert_content')) $all_fields .= " , bo_insert_content = '{$bo_insert_content}' ";
if (is_checked('chk_all_use_search')) $all_fields .= " , bo_use_search = '{$bo_use_search}' ";
if (is_checked('chk_all_order')) $all_fields .= " , bo_order = '{$bo_order}' ";
if (is_checked('chk_all_show_menu')) $all_fields .= " , bo_show_menu = '{$bo_show_menu}' ";
for ($i=1; $i<=10; $i++) {
if (is_checked('chk_all_'.$i)) {
$all_fields .= " , bo_{$i}_subj = '".$_POST['bo_'.$i.'_subj']."' ";

View File

@ -51,7 +51,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
$g5['title'] = '게시판관리';
include_once('./admin.head.php');
$colspan = 16;
$colspan = 15;
?>
<div class="local_ov01 local_ov">
@ -107,7 +107,6 @@ $colspan = 16;
<th scope="col">다운P<span class="sound_only">포인트</span></th>
<th scope="col"><?php echo subject_sort_link('bo_use_sns') ?>SNS<br>사용</a></th>
<th scope="col"><?php echo subject_sort_link('bo_use_search') ?>검색<br>사용</a></th>
<th scope="col"><?php echo subject_sort_link('bo_show_menu') ?>메뉴<br>보임</a></th>
<th scope="col"><?php echo subject_sort_link('bo_order') ?>출력<br>순서</a></th>
<th scope="col">접속기기</th>
<th scope="col">관리</th>
@ -174,10 +173,6 @@ $colspan = 16;
<label for="bo_use_search_<?php echo $i; ?>" class="sound_only">검색 사용</label>
<input type="checkbox" name="bo_use_search[<?php echo $i ?>]" value="1" id="bo_use_search_<?php echo $i ?>" <?php echo $row['bo_use_search']?"checked":"" ?>>
</td>
<td class="td_chk">
<label for="bo_show_menu_<?php echo $i; ?>" class="sound_only">메인메뉴 보이기</label>
<input type="checkbox" name="bo_show_menu[<?php echo $i ?>]" value="1" id="bo_show_menu_<?php echo $i ?>" <?php echo $row['bo_show_menu']?"checked":"" ?>>
</td>
<td class="td_chk">
<label for="bo_order_<?php echo $i; ?>" class="sound_only">출력 순서</label>
<input type="text" name="bo_order[<?php echo $i ?>]" value="<?php echo $row['bo_order'] ?>" id="bo_order_<?php echo $i ?>" class="frm_input" size="2">

View File

@ -39,7 +39,6 @@ if ($_POST['act_button'] == "선택수정") {
bo_download_point = '{$_POST['bo_download_point'][$k]}',
bo_use_search = '{$_POST['bo_use_search'][$k]}',
bo_use_sns = '{$_POST['bo_use_sns'][$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

@ -26,9 +26,6 @@ if (!isset($group['gr_device'])) {
sql_query(" ALTER TABLE `{$g5['group_table']}` ADD `gr_device` ENUM('both','pc','mobile') NOT NULL DEFAULT 'both' AFTER `gr_subject` ", false);
}
if (!isset($group['gr_show_menu'])) {
sql_query(" ALTER TABLE `{$g5['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` ", false);
}
$g5['title'] = $html_title;
include_once('./admin.head.php');
@ -52,11 +49,11 @@ include_once('./admin.head.php');
<tbody>
<tr>
<th scope="row"><label for="gr_id">그룹 ID<?php echo $sound_only ?></label></th>
<td><input type="text" name="gr_id" value="<?php echo $group['gr_id'] ?>" id="gr_id" <?php echo $gr_id_attr; ?> class="<?php echo $gr_id_attr; ?> alnum_ frm_input" maxlength="10">
<?php
<td><input type="text" name="gr_id" value="<?php echo $group['gr_id'] ?>" id="gr_id" <?php echo $gr_id_attr; ?> class="<?php echo $gr_id_attr; ?> alnum_ frm_input" maxlength="10">
<?php
if ($w=='')
echo '영문자, 숫자, _ 만 가능 (공백없이)';
else
else
echo '<a href="'.G5_BBS_URL.'/group.php?gr_id='.$group['gr_id'].'" class="btn_frmline">게시판그룹 바로가기</a>';
?>
</td>
@ -112,14 +109,6 @@ include_once('./admin.head.php');
?>
</td>
</tr>
<tr>
<th scope="row"><label for="gr_show_menu">메뉴보이기</label></th>
<td>
<?php echo help("사용에 체크하시면 게시판그룹 제목을 메뉴에 출력합니다.") ?>
<input type="checkbox" name="gr_show_menu" value="1" id="gr_show_menu" <?php echo $gr['gr_show_menu']?'checked':''; ?>>
사용
</td>
</tr>
<?php for ($i=1;$i<=10;$i++) { ?>
<tr>
<th scope="row">여분필드<?php echo $i ?></th>

View File

@ -17,7 +17,6 @@ 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']}',
@ -38,7 +37,7 @@ $sql_common = " gr_subject = '{$_POST['gr_subject']}',
gr_8 = '{$_POST['gr_8']}',
gr_9 = '{$_POST['gr_9']}',
gr_10 = '{$_POST['gr_10']}' ";
if (isset($_POST['gr_use_access']))
if (isset($_POST['gr_use_access']))
$sql_common .= ", gr_use_access = '{$_POST['gr_use_access']}' ";
else
$sql_common .= ", gr_use_access = '' ";

View File

@ -55,7 +55,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">처음</a>';
$g5['title'] = '게시판그룹설정';
include_once('./admin.head.php');
$colspan = 11;
$colspan = 10;
?>
<div class="local_ov01 local_ov">
@ -105,7 +105,6 @@ $colspan = 11;
<th scope="col">게시판</th>
<th scope="col">접근<br>사용</th>
<th scope="col">접근<br>회원수</th>
<th scope="col">메뉴<br>보임</th>
<th scope="col"><?php echo subject_sort_link('gr_order') ?>출력<br>순서</a></th>
<th scope="col">접속기기</th>
<th scope="col">관리</th>
@ -153,10 +152,6 @@ $colspan = 11;
<input type="checkbox" name="gr_use_access[<?php echo $i ?>]" <?php echo $row['gr_use_access']?'checked':'' ?> value="1" id="gr_use_access_<?php echo $i ?>">
</td>
<td class="td_numsmall"><a href="./boardgroupmember_list.php?gr_id=<?php echo $row['gr_id'] ?>"><?php echo $row1['cnt'] ?></a></td>
<td class="td_chk">
<label for="gr_show_menu_<?php echo $i; ?>" class="sound_only">메인메뉴에 보이기</label>
<input type="checkbox" name="gr_show_menu[<?php echo $i ?>]" <?php echo $row['gr_show_menu']?'checked':'' ?> value="1" id="gr_show_menu_<?php echo $i ?>">
</td>
<td class="td_chk">
<label for="gr_order_<?php echo $i; ?>" class="sound_only">메인메뉴 출력순서</label>
<input type="text" name="gr_order[<?php echo $i ?>]" value="<?php echo $row['gr_order'] ?>" id="gr_order_<?php echo $i ?>" class="frm_input" size="2">

View File

@ -17,14 +17,13 @@ for ($i=0; $i<$count; $i++)
{
$k = $_POST['chk'][$i];
$gr_id = $_POST['group_id'][$k];
if($_POST['act_button'] == '선택수정') {
$sql = " update {$g5['group_table']}
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_show_menu = '{$_POST['gr_show_menu'][$k]}',
gr_order = '{$_POST['gr_order'][$k]}'
where gr_id = '{$gr_id}' ";
if ($is_admin != 'super')

View File

@ -134,6 +134,15 @@ if(!isset($config['cf_sms_use'])) {
ADD `cf_icode_server_port` varchar(255) NOT NULL DEFAULT '' AFTER `cf_icode_server_ip` ", true);
}
if(!isset($config['cf_faq_skin'])) {
sql_query(" ALTER TABLE `{$g5['config_table']}`
ADD `cf_faq_skin` varchar(255) NOT NULL DEFAULT '' AFTER `cf_connect_skin`,
ADD `cf_mobile_faq_skin` varchar(255) NOT NULL DEFAULT '' AFTER `cf_mobile_connect_skin` ", true);
}
if(!$config['cf_faq_skin']) $config['cf_faq_skin'] = "basic";
if(!$config['cf_mobile_faq_skin']) $config['cf_mobile_faq_skin'] = "basic";
$g5['title'] = '환경설정';
include_once ('./admin.head.php');
@ -360,6 +369,32 @@ if ($config['cf_icode_id'] && $config['cf_icode_pw']) {
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="cf_faq_skin">FAQ 스킨<strong class="sound_only">필수</strong></label></th>
<td>
<select name="cf_faq_skin" id="cf_faq_skin" required class="required">
<?php
$arr = get_skin_dir('faq');
for ($i=0; $i<count($arr); $i++) {
if ($i == 0) echo "<option value=\"\">선택</option>";
echo "<option value=\"".$arr[$i]."\"".get_selected($config['cf_faq_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
}
?>
</select>
</td>
<th scope="row"><label for="cf_mobile_faq_skin">모바일 FAQ 스킨<strong class="sound_only">필수</strong></label></th>
<td>
<select name="cf_mobile_faq_skin" id="cf_mobile_faq_skin" required class="required">
<?php
$arr = get_skin_dir('faq', G5_MOBILE_PATH.'/'.G5_SKIN_DIR);
for ($i=0; $i<count($arr); $i++) {
if ($i == 0) echo "<option value=\"\">선택</option>";
echo "<option value=\"".$arr[$i]."\"".get_selected($config['cf_mobile_faq_skin'], $arr[$i]).">".$arr[$i]."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="cf_editor">에디터 선택</label></th>
<td colspan="3">

View File

@ -39,6 +39,7 @@ $sql = " update {$g5['config_table']}
cf_new_rows = '{$_POST['cf_new_rows']}',
cf_search_skin = '{$_POST['cf_search_skin']}',
cf_connect_skin = '{$_POST['cf_connect_skin']}',
cf_faq_skin = '{$_POST['cf_faq_skin']}',
cf_read_point = '{$_POST['cf_read_point']}',
cf_write_point = '{$_POST['cf_write_point']}',
cf_comment_point = '{$_POST['cf_comment_point']}',
@ -107,6 +108,7 @@ $sql = " update {$g5['config_table']}
cf_mobile_new_skin = '{$_POST['cf_mobile_new_skin']}',
cf_mobile_search_skin = '{$_POST['cf_mobile_search_skin']}',
cf_mobile_connect_skin = '{$_POST['cf_mobile_connect_skin']}',
cf_mobile_faq_skin = '{$_POST['cf_mobile_faq_skin']}',
cf_mobile_member_skin = '{$_POST['cf_mobile_member_skin']}',
cf_captcha_mp3 = '{$_POST['cf_captcha_mp3']}',
cf_editor = '{$_POST['cf_editor']}',

View File

@ -22,6 +22,13 @@ else
$html_title .= ' 입력';
}
// 모바일 상하단 내용 필드추가
if(!sql_query(" select fm_mobile_head_html from {$g5['faq_master_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g5['faq_master_table']}`
ADD `fm_mobile_head_html` text NOT NULL AFTER `fm_tail_html`,
ADD `fm_mobile_tail_html` text NOT NULL AFTER `fm_mobile_head_html` ", true);
}
include_once (G5_ADMIN_PATH.'/admin.head.php');
?>
@ -37,6 +44,13 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="fm_order">출력순서</label></th>
<td>
<?php echo help('숫자가 작을수록 FAQ 분류에서 먼저 출력됩니다.'); ?>
<input type="text" name="fm_order" value="<?php echo $fm['fm_order']; ?>" id="fm_order" class="frm_input" maxlength="10" size="10">
</td>
</tr>
<tr>
<th scope="row"><label for="fm_subject">제목</label></th>
<td>
@ -107,6 +121,18 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
<?php echo editor_html('fm_tail_html', $fm['fm_tail_html']); ?>
</td>
</tr>
<tr>
<th scope="row">모바일상단 내용</th>
<td>
<?php echo editor_html('fm_mobile_head_html', $fm['fm_mobile_head_html']); ?>
</td>
</tr>
<tr>
<th scope="row">모바일하단 내용</th>
<td>
<?php echo editor_html('fm_mobile_tail_html', $fm['fm_mobile_tail_html']); ?>
</td>
</tr>
</tbody>
</table>
</div>
@ -123,6 +149,8 @@ function frmfaqmasterform_check(f)
{
<?php echo get_editor_js('fm_head_html'); ?>
<?php echo get_editor_js('fm_tail_html'); ?>
<?php echo get_editor_js('fm_mobile_head_html'); ?>
<?php echo get_editor_js('fm_mobile_tail_html'); ?>
}
// document.frmfaqmasterform.fm_subject.focus();

View File

@ -18,7 +18,10 @@ if ($fm_timg_del) @unlink(G5_DATA_PATH."/faq/{$fm_id}_t");
$sql_common = " set fm_subject = '$fm_subject',
fm_head_html = '$fm_head_html',
fm_tail_html = '$fm_tail_html' ";
fm_tail_html = '$fm_tail_html',
fm_mobile_head_html = '$fm_mobile_head_html',
fm_mobile_tail_html = '$fm_mobile_tail_html',
fm_order = '$fm_order' ";
if ($w == "")
{

View File

@ -59,7 +59,7 @@ $total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = "select * $sql_common order by fm_id desc limit $from_record, {$config['cf_page_rows']} ";
$sql = "select * $sql_common order by fm_order, fm_id limit $from_record, {$config['cf_page_rows']} ";
$result = sql_query($sql);
?>
@ -88,6 +88,7 @@ $result = sql_query($sql);
<th scope="col">ID</th>
<th scope="col">제목</th>
<th scope="col">FAQ수</th>
<th scope="col">순서</th>
<th scope="col">관리</th>
</tr>
</thead>
@ -102,6 +103,7 @@ $result = sql_query($sql);
<td class="td_num"><?php echo $row['fm_id']; ?></td>
<td><a href="./faqlist.php?fm_id=<?php echo $row['fm_id']; ?>&amp;fm_subject=<?php echo $row['fm_subject']; ?>"><?php echo stripslashes($row['fm_subject']); ?></a></td>
<td class="td_num"><?php echo $cnt; ?></td>
<td class="td_num"><?php echo $row['fm_order']?></td>
<td class="td_mng">
<a href="<?php echo G5_BBS_URL; ?>/faq.php?fm_id=<?php echo $row['fm_id']; ?>"><span class="sound_only"><?php echo stripslashes($row['fm_subject']); ?> </span>보기</a>
<a href="./faqmasterform.php?w=u&amp;fm_id=<?php echo $row['fm_id']; ?>"><span class="sound_only"><?php echo stripslashes($row['fm_subject']); ?> </span>수정</a>

View File

@ -1,96 +1,104 @@
<?php
include_once('./_common.php');
if (!$fm_id) $fm_id = 1;
//dbconfig파일에 $g5['faq_table'] , $g5['faq_master_table'] 배열변수가 있는지 체크
if( !isset($g5['faq_table']) || !isset($g5['faq_master_table']) ){
die('<meta charset="utf-8">관리자 모드에서 게시판관리->FAQ관리를 먼저 확인해 주세요.');
}
// FAQ MASTER
$sql = " select * from {$g5['faq_master_table']} where fm_id = '$fm_id' ";
$fm = sql_fetch($sql);
$faq_master_list = array();
$sql = " select * from {$g5['faq_master_table']} order by fm_order,fm_id ";
$result = sql_query($sql);
while ($row=sql_fetch_array($result))
{
$key = $row['fm_id'];
if (!$fm_id) $fm_id = $key;
$faq_master_list[$key] = $row;
}
if ($fm_id){
$qstr .= '&amp;fm_id=' . $fm_id; // 마스터faq key_id
}
$fm = $faq_master_list[$fm_id];
if (!$fm['fm_id'])
alert('등록된 내용이 없습니다.');
$g5['title'] = $fm['fm_subject'];
if(G5_IS_MOBILE){
$faq_skin = $config['cf_mobile_faq_skin'];
} else {
$faq_skin = $config['cf_faq_skin'];
}
if(!$faq_skin) $faq_skin = 'basic';
$faq_skin_path = (G5_IS_MOBILE ? G5_MOBILE_PATH : G5_PATH).'/'.G5_SKIN_DIR.'/faq/'.$faq_skin;
$faq_skin_url = (G5_IS_MOBILE ? G5_MOBILE_URL : G5_URL).'/'.G5_SKIN_DIR.'/faq/'.$faq_skin;
$skin_file = $faq_skin_path.'/list.skin.php';
include_once('./_head.php');
?>
<?php
if ($is_admin)
echo '<div class="faq_admin"><a href="'.G5_ADMIN_URL.'/faqmasterform.php?w=u&amp;fm_id='.$fm_id.'" class="btn_admin">FAQ 수정</a></div>';
?>
if(is_file($skin_file)) {
$admin_href = '';
$himg_src = '';
$timg_src = '';
if($is_admin)
$admin_href = G5_ADMIN_URL.'/faqmasterform.php?w=u&amp;fm_id='.$fm_id;
<!-- FAQ 시작 { -->
<?php
$himg = G5_DATA_PATH.'/faq/'.$fm_id.'_h';
if (file_exists($himg))
echo '<div id="faq_himg" class="faq_img"><img src="'.G5_DATA_URL.'/faq/'.$fm_id.'_h" alt=""></div>';
if(!G5_IS_MOBILE) {
$himg = G5_DATA_PATH.'/faq/'.$fm_id.'_h';
if (is_file($himg)){
$himg_src = G5_DATA_URL.'/faq/'.$fm_id.'_h';
}
// 상단 HTML
echo '<div id="faq_hhtml">'.stripslashes($fm['fm_head_html']).'</div>';
?>
$timg = G5_DATA_PATH.'/faq/'.$fm_id.'_t';
if (is_file($timg)){
$timg_src = G5_DATA_URL.'/faq/'.$fm_id.'_t';
}
}
<div id="faq_wrap" class="faq_<?php echo $fm_id; ?>">
<?php // FAQ 목차
$sql = " select * from {$g5['faq_table']}
where fm_id = '$fm_id'
order by fa_order , fa_id ";
$category_href = G5_BBS_URL.'/faq.php';
$category_stx = '';
$faq_list = array();
$stx = trim($stx);
$sql_search = '';
if($stx) {
$sql_search = " and ( INSTR(fa_subject, '$stx') > 0 or INSTR(fa_content, '$stx') > 0 ) ";
$category_stx = '&amp;stx='.$stx;
}
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$page_rows = G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'];
$sql = " select count(*) as cnt
from {$g5['faq_table']}
where fm_id = '$fm_id'
$sql_search ";
$total = sql_fetch($sql);
$total_count = $total['cnt'];
$total_page = ceil($total_count / $page_rows); // 전체 페이지 계산
$from_record = ($page - 1) * $page_rows; // 시작 열을 구함
$sql = " select *
from {$g5['faq_table']}
where fm_id = '$fm_id'
$sql_search
order by fa_order , fa_id
limit $from_record, $page_rows ";
$result = sql_query($sql);
for ($i=1; $row=sql_fetch_array($result); $i++)
{
if ($i == 1)
{
?>
<section id="faq_list">
<h2><?php echo $g5['title']; ?> 목차</h2>
<ol>
<?php } ?>
<li><a href="#faq_<?php echo $fm_id.'_'.$i; ?>"><?php echo stripslashes($row['fa_subject']); ?></a></li>
<?php }
if ($i > 1) echo '</ol></section>';
?>
<?php // FAQ 내용
$resultb = sql_query($sql);
for ($i=1; $row=sql_fetch_array($resultb); $i++)
{
if ($i == 1)
{
?>
<section id="faq_con">
<h2><?php echo $g5['title']; ?> 내용</h2>
<ol>
<?php } ?>
<li id="faq_<?php echo $fm_id.'_'.$i; ?>">
<h3><?php echo stripslashes($row['fa_subject']); ?></h3>
<div id="con_inner">
<?php echo stripslashes($row['fa_content']); ?>
</div>
<div class="faq_tolist"><a href="#faq_list" class="btn01">FAQ 목차</a></div>
</li>
<?php }
if ($i > 1) echo '</ol></section>';
if ($i == 1) echo '<p>등록된 FAQ가 없습니다.<br><a href="'.G5_ADMIN_URL.'/faqmasterlist.php">FAQ를 새로 등록하시려면 FAQ관리</a> 메뉴를 이용하십시오.</p>';
?>
</div>
<?php
// 하단 HTML
echo '<div id="faq_thtml">'.stripslashes($fm['fm_tail_html']).'</div>';
$timg = G5_DATA_PATH.'/faq/'.$fm_id.'_t';
if (file_exists($timg))
echo '<div id="faq_timg" class="faq_img"><img src="'.G5_DATA_URL.'/faq/'.$fm_id.'_t" alt=""></div>';
?>
<!-- } FAQ 끝 -->
<?php
if ($is_admin)
echo '<div class="faq_admin"><a href="'.G5_ADMIN_URL.'/faqmasterform.php?w=u&amp;fm_id='.$fm_id.'" class="btn_admin">FAQ 수정</a></div>';
while ($row=sql_fetch_array($result)){
$faq_list[] = $row;
}
include_once($skin_file);
} else {
echo '<p>'.str_replace(G5_PATH.'/', '', $skin_file).'이 존재하지 않습니다.</p>';
}
include_once('./_tail.php');
?>

View File

@ -36,6 +36,13 @@ a:hover, a:focus, a:active {color:#000;text-decoration:underline}
#hd_wrapper {position:relative;margin:0 auto;padding:26px 0;width:970px;zoom:1}
#hd_wrapper:after {display:block;visibility:hidden;clear:both;content:""}
#hd_pop {z-index:1000;position:relative;margin:0 auto;width:1000px;height:0}
#hd_pop h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
.hd_pops {position:absolute;border:1px solid #e9e9e9;background:#fff}
.hd_pops_con {margin:0 0 30px}
.hd_pops_footer {position:absolute;bottom:0;left:0;padding:10px 0;width:100%;background:#000;color:#fff;text-align:right}
.hd_pops_footer button {margin-right:5px;padding:5px 10px;border:0;background:#393939;color:#fff}
#logo {float:left;padding:5px 0 0}
/* 전체 검색 */

View File

@ -100,25 +100,7 @@ if($is_admin != 'super')
<nav id="gnb">
<h2>메인메뉴</h2>
<ul id="gnb_1dul">
<?php
$sql = " select * from {$g5['group_table']} where gr_show_menu = '1' and gr_device <> 'mobile' order by gr_order ";
$result = sql_query($sql);
for ($gi=0; $row=sql_fetch_array($result); $gi++) { // gi 는 group index
?>
<li class="gnb_1dli">
<a href="<?php echo G5_BBS_URL ?>/group.php?gr_id=<?php echo $row['gr_id'] ?>" class="gnb_1da"><?php echo $row['gr_subject'] ?></a>
<ul class="gnb_2dul">
<?php
$sql2 = " select * from {$g5['board_table']} where gr_id = '{$row['gr_id']}' and bo_show_menu = '1' and bo_device <> 'mobile' order by bo_order ";
$result2 = sql_query($sql2);
for ($bi=0; $row2=sql_fetch_array($result2); $bi++) { // bi 는 board index
?>
<li class="gnb_2dli"><a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $row2['bo_table'] ?>" class="gnb_2da"><?php echo $row2['bo_subject'] ?></a></li>
<?php } ?>
</ul>
</li>
<?php } ?>
<?php if ($gi == 0) { ?><li class="gnb_empty">생성된 메뉴가 없습니다.</li><?php } ?>
<li class="gnb_empty">메뉴는 표시하지 않습니다.</li>
</ul>
</nav>
</div>

View File

@ -141,25 +141,7 @@ document.onkeydown = noRefresh ;
<nav id="gnb">
<h2>메인메뉴</h2>
<ul id="gnb_1dul">
<?php
$sql = " select * from {$g5['group_table']} where gr_show_menu = '1' and gr_device <> 'mobile' order by gr_order ";
$result = sql_query($sql);
for ($gi=0; $row=sql_fetch_array($result); $gi++) { // gi 는 group index
?>
<li class="gnb_1dli">
<a href="<?php echo G5_BBS_URL ?>/group.php?gr_id=<?php echo $row['gr_id'] ?>" class="gnb_1da"><?php echo $row['gr_subject'] ?></a>
<ul class="gnb_2dul">
<?php
$sql2 = " select * from {$g5['board_table']} where gr_id = '{$row['gr_id']}' and bo_show_menu = '1' and bo_device <> 'mobile' order by bo_order ";
$result2 = sql_query($sql2);
for ($bi=0; $row2=sql_fetch_array($result2); $bi++) { // bi 는 board index
?>
<li class="gnb_2dli"><a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $row2['bo_table'] ?>" class="gnb_2da"><?php echo $row2['bo_subject'] ?></a></li>
<?php } ?>
</ul>
</li>
<?php } ?>
<?php if ($gi == 0) { ?><li class="gnb_empty">생성된 메뉴가 없습니다.</li><?php } ?>
<li class="gnb_empty">메뉴는 표시하지 않습니다.</li>
</ul>
</nav>
</div>

View File

@ -84,7 +84,6 @@ CREATE TABLE IF NOT EXISTS `g5_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_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',
@ -352,7 +351,6 @@ CREATE TABLE IF NOT EXISTS `g5_group` (
`gr_device` ENUM('both','pc','mobile') NOT NULL DEFAULT 'both',
`gr_admin` varchar(255) NOT NULL default '',
`gr_use_access` tinyint(4) NOT NULL default '0',
`gr_show_menu` tinyint(4) NOT NULL default '0',
`gr_order` int(11) NOT NULL default '0',
`gr_1_subj` varchar(255) NOT NULL default '',
`gr_2_subj` varchar(255) NOT NULL default '',
@ -836,6 +834,8 @@ CREATE TABLE IF NOT EXISTS `g5_faq_master` (
`fm_subject` varchar(255) NOT NULL DEFAULT '',
`fm_head_html` text NOT NULL,
`fm_tail_html` text NOT NULL,
`fm_mobile_head_html` text NOT NULL,
`fm_mobile_tail_html` text NOT NULL,
`fm_order` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`fm_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@ -864,3 +864,20 @@ CREATE TABLE IF NOT EXISTS `g5_new_win` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `g5_menu`
--
DROP TABLE IF EXISTS `g5_menu`;
CREATE TABLE IF NOT EXISTS `g5_menu` (
`me_id` int(11) NOT NULL AUTO_INCREMENT,
`me_code` varchar(255) NOT NULL DEFAULT '',
`me_name` varchar(255) NOT NULL DEFAULT '',
`me_link` varchar(255) NOT NULL DEFAULT '',
`me_target` varchar(255) NOT NULL DEFAULT '',
`me_order` int(11) NOT NULL DEFAULT '0',
`me_use` tinyint(4) NOT NULL DEFAULT '0',
`me_mobile_use` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`me_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

View File

@ -122,6 +122,7 @@ $sql = " insert into `{$table_prefix}config`
cf_mobile_search_skin = 'basic',
cf_mobile_connect_skin = 'basic',
cf_mobile_member_skin = 'basic',
cf_editor = 'ckeditor4',
cf_captcha_mp3 = 'basic',
cf_register_level = '2',
cf_register_point = '1000',
@ -254,6 +255,7 @@ fwrite($f, "\$g5['content_table'] = G5_TABLE_PREFIX.'content'; // 내용(컨텐
fwrite($f, "\$g5['faq_table'] = G5_TABLE_PREFIX.'faq'; // 자주하시는 질문 테이블\n");
fwrite($f, "\$g5['faq_master_table'] = G5_TABLE_PREFIX.'faq_master'; // 자주하시는 질문 마스터 테이블\n");
fwrite($f, "\$g5['new_win_table'] = G5_TABLE_PREFIX.'new_win'; // 새창 테이블\n");
fwrite($f, "\$g5['menu_table'] = G5_TABLE_PREFIX.'menu'; // 메뉴관리 테이블\n");
fwrite($f, "?>");
fclose($f);

View File

@ -70,6 +70,11 @@ function number_format(data)
var comma = ',';
var i;
var sign = data.match(/^[\+\-]/);
if(sign) {
data = data.replace(/^[\+\-]/, "");
}
len = data.length;
mod = (len % cutlen);
k = cutlen - mod;
@ -88,6 +93,9 @@ function number_format(data)
}
}
if(sign != null)
number = sign+number;
return number;
}

View File

@ -47,4 +47,47 @@
image_resize();
});
}
$.fn.viewimageresize2 = function(selector)
{
var cfg = {
selector: "img"
};
if(typeof selector == "object") {
cfg = $.extend(cfg, selector);
} else {
if(selector) {
cfg = $.extend({ selector: selector });
}
}
var $img = this.find(cfg.selector);
var $this = this;
function image_resize()
{
var width = $this.width();
$img.each(function() {
$(this).removeAttr("width")
.removeAttr("height")
.css("width","")
.css("height", "");
if($(this).data("width") == undefined)
$(this).data("width", $(this).width());
if($(this).data("width") > width) {
$(this).css("width", "100%");
}
});
}
$(window).on("resize", function() {
image_resize();
});
image_resize();
}
}(jQuery));

View File

@ -163,6 +163,7 @@ include_once(G5_LIB_PATH.'/popular.lib.php');
<ul id="hd_nb">
<li><a href="<?php echo G5_BBS_URL ?>/qalist.php" id="snb_new">1:1문의</a></li>
<li><a href="<?php echo G5_BBS_URL ?>/faq.php" id="snb_faq">FAQ</a></li>
<li><a href="<?php echo G5_BBS_URL ?>/current_connect.php" id="snb_cnt">접속자 <?php echo connect(); // 현재 접속자수 ?></a></li>
<li><a href="<?php echo G5_BBS_URL ?>/new.php" id="snb_new">새글</a></li>
<?php if ($is_member) { ?>

View File

@ -0,0 +1,118 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$faq_skin_url.'/style.css">', 0);
?>
<!-- FAQ 시작 { -->
<?php
// 상단 HTML
echo '<div id="faq_hhtml">'.stripslashes($fm['fm_mobile_head_html']).'</div>';
?>
<form name="faq_search_form" method="get">
<input type="hidden" name="fm_id" value="<?php echo $fm_id;?>">
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo $stx;?>" required id="stx" class="frm_input required" size="15" maxlength="15">
<input type="submit" value="검색" class="btn_submit">
</form>
<?php
if( count($faq_master_list) ){
?>
<nav id="bo_cate">
<h2>자주하시는질문 분류</h2>
<ul id="bo_cate_ul">
<?php
foreach( $faq_master_list as $v ){
$category_msg = '';
$category_option = '';
if($v['fm_id'] == $fm_id){ // 현재 선택된 카테고리라면
$category_option = ' id="bo_cate_on"';
$category_msg = '<span class="sound_only">열린 분류 </span>';
}
?>
<li><a href="<?php echo $category_href;?>?fm_id=<?php echo $v['fm_id'].$category_stx;?>" <?php echo $category_option;?> ><?php echo $category_msg.$v['fm_subject'];?></a></li>
<?php
}
?>
</ul>
</nav>
<?php } ?>
<div id="faq_wrap" class="faq_<?php echo $fm_id; ?>">
<?php // FAQ 내용
if( count($faq_list) ){
?>
<section id="faq_con">
<h2><?php echo $g5['title']; ?> 목록</h2>
<ol>
<?php
foreach($faq_list as $key=>$v){
if(empty($v))
continue;
?>
<li>
<h3><a href="#none" onclick="return faq_open(this);"><?php echo conv_content($v['fa_subject'], 1); ?></a></h3>
<div class="con_inner">
<?php echo conv_content($v['fa_content'], 1); ?>
<button type="button" class="btn_faq_close">닫기</button>
</div>
</li>
<?php
}
?>
</ol>
</section>
<?php
} else {
if($stx){
echo '<p>검색된 게시물이 없습니다.</p>';
} else {
echo '<p>등록된 FAQ가 없습니다.';
if($is_admin)
echo '<br><a href="'.G5_ADMIN_URL.'/faqmasterlist.php">FAQ를 새로 등록하시려면 FAQ관리</a> 메뉴를 이용하십시오.';
echo '</p>';
}
}
?>
</div>
<?php echo get_paging($page_rows, $page, $total_page, $_SERVER['PHP_SELF'].'?'.$qstr.'&amp;page='); ?>
<?php
// 하단 HTML
echo '<div id="faq_thtml">'.stripslashes($fm['fm_tail_html']).'</div>';
?>
<!-- } FAQ 끝 -->
<script src="<?php echo G5_JS_URL; ?>/viewimageresize.js"></script>
<script>
$(function() {
$(".btn_faq_close").on("click", function() {
$(this).closest(".con_inner").slideToggle();
});
});
function faq_open(el)
{
var $con = $(el).closest("li").find(".con_inner");
if($con.is(":visible")) {
$con.slideUp();
} else {
$("#faq_con .con_inner:visible").css("display", "none");
$con.slideDown(
function() {
// 이미지 리사이즈
$con.viewimageresize2();
}
);
}
return false;
}
</script>

View File

@ -0,0 +1,10 @@
@charset "utf-8";
#bo_cate h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#bo_cate ul {margin-bottom:10px;padding-left:1px;width:728px;zoom:1}
#bo_cate ul:after {display:block;visibility:hidden;clear:both;content:""}
#bo_cate li {float:left;margin-bottom:-1px}
#bo_cate a {display:block;position:relative;margin-left:-1px;padding:6px 0 5px;width:90px;border:1px solid #ddd;background:#f7f7f7;color:#888;text-align:center;letter-spacing:-0.1em;line-height:1.2em;cursor:pointer}
#bo_cate a:focus, #bo_cate a:hover, #bo_cate a:active {text-decoration:none}
#bo_cate #bo_cate_on {z-index:2;border:1px solid #565e60;background:#fff;color:#565e60;font-weight:bold}

View File

@ -26,11 +26,15 @@ if($resultCd != 'B000') {
* 모듈 호출 ; 생년월일 본인 확인서비스 결과 데이터를 복호화한다.
**************************************************************************/
$encInfo = $_POST['encInfo'];
if(preg_match('~[^0-9a-zA-Z+/=]~', $encInfo, $match)) {echo "입력 값 확인이 필요합니다"; exit;}
//KCB서버 공개키
$WEBPUBKEY = trim($_POST['WEBPUBKEY']);
if(preg_match('~[^0-9a-zA-Z+/=]~', $WEBPUBKEY, $match)) {echo "입력 값 확인이 필요합니다"; exit;}
//KCB서버 서명값
$WEBSIGNATURE = trim($_POST['WEBSIGNATURE']);
if(preg_match('~[^0-9a-zA-Z+/=]~', $WEBSIGNATURE, $match)) {echo "입력 값 확인이 필요합니다"; exit;}
// ########################################################################
// # 암호화키 파일 설정 (절대경로) - 파일은 주어진 파일명으로 자동 생성 됨

View File

@ -4,11 +4,15 @@ include_once('./ipin.config.php');
//아이핀팝업에서 조회한 PERSONALINFO이다.
@$encPsnlInfo = $_POST["encPsnlInfo"];
if(preg_match('~[^0-9a-zA-Z+/=]~', $encPsnlInfo, $match)) {echo "입력 값 확인이 필요합니다"; exit;}
//KCB서버 공개키
@$WEBPUBKEY = trim($_POST["WEBPUBKEY"]);
if(preg_match('~[^0-9a-zA-Z+/=]~', $WEBPUBKEY, $match)) {echo "입력 값 확인이 필요합니다"; exit;}
//KCB서버 서명값
@$WEBSIGNATURE = trim($_POST["WEBSIGNATURE"]);
if(preg_match('~[^0-9a-zA-Z+/=]~', $WEBSIGNATURE, $match)) {echo "입력 값 확인이 필요합니다"; exit;}
//아이핀 서버와 통신을 위한 키파일 생성
// 파라미터 정의

View File

@ -0,0 +1,132 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$faq_skin_url.'/style.css">', 0);
if ($admin_href)
echo '<div class="faq_admin"><a href="'.$admin_href.'" class="btn_admin">FAQ 수정</a></div>';
?>
<!-- FAQ 시작 { -->
<?php
if ($himg_src)
echo '<div id="faq_himg" class="faq_img"><img src="'.$himg_src.'" alt=""></div>';
// 상단 HTML
echo '<div id="faq_hhtml">'.stripslashes($fm['fm_head_html']).'</div>';
?>
<form name="faq_search_form" method="get">
<input type="hidden" name="fm_id" value="<?php echo $fm_id;?>">
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" value="<?php echo $stx;?>" required id="stx" class="frm_input required" size="15" maxlength="15">
<input type="submit" value="검색" class="btn_submit">
</form>
<?php
if( count($faq_master_list) ){
?>
<nav id="bo_cate">
<h2>자주하시는질문 분류</h2>
<ul id="bo_cate_ul">
<?php
foreach( $faq_master_list as $v ){
$category_msg = '';
$category_option = '';
if($v['fm_id'] == $fm_id){ // 현재 선택된 카테고리라면
$category_option = ' id="bo_cate_on"';
$category_msg = '<span class="sound_only">열린 분류 </span>';
}
?>
<li><a href="<?php echo $category_href;?>?fm_id=<?php echo $v['fm_id'].$category_stx;?>" <?php echo $category_option;?> ><?php echo $category_msg.$v['fm_subject'];?></a></li>
<?php
}
?>
</ul>
</nav>
<?php } ?>
<div id="faq_wrap" class="faq_<?php echo $fm_id; ?>">
<?php // FAQ 내용
if( count($faq_list) ){
?>
<section id="faq_con">
<h2><?php echo $g5['title']; ?> 목록</h2>
<ol>
<?php
foreach($faq_list as $key=>$v){
if(empty($v))
continue;
?>
<li>
<h3><a href="#none" onclick="return faq_open(this);"><?php echo conv_content($v['fa_subject'], 1); ?></a></h3>
<div class="con_inner">
<?php echo conv_content($v['fa_content'], 1); ?>
<button type="button" class="btn_faq_close">닫기</button>
</div>
</li>
<?php
}
?>
</ol>
</section>
<?php
} else {
if($stx){
echo '<p>검색된 게시물이 없습니다.</p>';
} else {
echo '<p>등록된 FAQ가 없습니다.';
if($is_admin)
echo '<br><a href="'.G5_ADMIN_URL.'/faqmasterlist.php">FAQ를 새로 등록하시려면 FAQ관리</a> 메뉴를 이용하십시오.';
echo '</p>';
}
}
?>
</div>
<?php echo get_paging($page_rows, $page, $total_page, $_SERVER['PHP_SELF'].'?'.$qstr.'&amp;page='); ?>
<?php
// 하단 HTML
echo '<div id="faq_thtml">'.stripslashes($fm['fm_tail_html']).'</div>';
if ($timg_src)
echo '<div id="faq_timg" class="faq_img"><img src="'.$timg_src.'" alt=""></div>';
?>
<!-- } FAQ 끝 -->
<?php
if ($admin_href)
echo '<div class="faq_admin"><a href="'.$admin_href.'" class="btn_admin">FAQ 수정</a></div>';
?>
<script src="<?php echo G5_JS_URL; ?>/viewimageresize.js"></script>
<script>
$(function() {
$(".btn_faq_close").on("click", function() {
$(this).closest(".con_inner").slideToggle();
});
});
function faq_open(el)
{
var $con = $(el).closest("li").find(".con_inner");
if($con.is(":visible")) {
$con.slideUp();
} else {
$("#faq_con .con_inner:visible").css("display", "none");
$con.slideDown(
function() {
// 이미지 리사이즈
$con.viewimageresize2();
}
);
}
return false;
}
</script>

10
skin/faq/basic/style.css Normal file
View File

@ -0,0 +1,10 @@
@charset "utf-8";
#bo_cate h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#bo_cate ul {margin-bottom:10px;padding-left:1px;width:728px;zoom:1}
#bo_cate ul:after {display:block;visibility:hidden;clear:both;content:""}
#bo_cate li {float:left;margin-bottom:-1px}
#bo_cate a {display:block;position:relative;margin-left:-1px;padding:6px 0 5px;width:90px;border:1px solid #ddd;background:#f7f7f7;color:#888;text-align:center;letter-spacing:-0.1em;line-height:1.2em;cursor:pointer}
#bo_cate a:focus, #bo_cate a:hover, #bo_cate a:active {text-decoration:none}
#bo_cate #bo_cate_on {z-index:2;border:1px solid #565e60;background:#fff;color:#565e60;font-weight:bold}