1:1문의 상단 하단 설정 항목 추가

This commit is contained in:
chicpro
2014-03-12 11:56:25 +09:00
parent 2d13c3b4b4
commit 7952268226
8 changed files with 110 additions and 12 deletions

View File

@ -1,6 +1,7 @@
<?php
$sub_menu = "300500";
include_once('./_common.php');
include_once(G5_EDITOR_LIB);
auth_check($auth[$sub_menu], 'r');
@ -31,6 +32,12 @@ if(!sql_query(" DESCRIBE `{$g5['qa_config_table']}` ", false)) {
`qa_image_width` int(11) NOT NULL DEFAULT '0',
`qa_upload_size` int(11) NOT NULL DEFAULT '0',
`qa_insert_content` text NOT NULL,
`qa_include_head` varchar(255) NOT NULL DEFAULT '',
`qa_include_tail` varchar(255) NOT NULL DEFAULT '',
`qa_content_head` text NOT NULL,
`qa_content_tail` text NOT NULL,
`qa_mobile_content_head` text NOT NULL,
`qa_mobile_content_tail` text NOT NULL,
`qa_1_subj` varchar(255) NOT NULL DEFAULT '',
`qa_2_subj` varchar(255) NOT NULL DEFAULT '',
`qa_3_subj` varchar(255) NOT NULL DEFAULT '',
@ -98,6 +105,17 @@ if(!isset($qaconfig['qa_admin_email'])) {
sql_query(" ALTER TABLE `{$g5['qa_config_table']}`
ADD `qa_admin_email` varchar(255) NOT NULL DEFAULT '' AFTER `qa_admin_hp` ", true);
}
// 상단 하단 설정 필드 추가
if(!isset($qaconfig['qa_include_head'])) {
sql_query(" ALTER TABLE `{$g5['qa_config_table']}`
ADD `qa_include_head` varchar(255) NOT NULL DEFAULT '' AFTER `qa_insert_content`,
ADD `qa_include_tail` varchar(255) NOT NULL DEFAULT '' AFTER `qa_include_head`,
ADD `qa_content_head` text NOT NULL AFTER `qa_include_tail`,
ADD `qa_content_tail` text NOT NULL AFTER `qa_content_head`,
ADD `qa_mobile_content_head` text NOT NULL AFTER `qa_content_tail`,
ADD `qa_mobile_content_tail` text NOT NULL AFTER `qa_mobile_content_head` ", true);
}
?>
<form name="fqaconfigform" id="fqaconfigform" method="post" onsubmit="return fqaconfigform_submit(this);" autocomplete="off">
@ -235,6 +253,42 @@ if(!isset($qaconfig['qa_admin_email'])) {
업로드 파일 한개당 <input type="text" name="qa_upload_size" value="<?php echo $qaconfig['qa_upload_size'] ?>" id="qa_upload_size" required class="required numeric frm_input" size="10"> bytes 이하
</td>
</tr>
<tr>
<th scope="row"><label for="qa_include_head">상단 파일 경로</label></th>
<td>
<input type="text" name="qa_include_head" value="<?php echo $qaconfig['qa_include_head'] ?>" id="qa_include_head" class="frm_input" size="50">
</td>
</tr>
<tr>
<th scope="row"><label for="qa_include_tail">하단 파일 경로</label></th>
<td>
<input type="text" name="qa_include_tail" value="<?php echo $qaconfig['qa_include_tail'] ?>" id="qa_include_tail" class="frm_input" size="50">
</td>
</tr>
<tr>
<th scope="row"><label for="qa_content_head">상단 내용</label></th>
<td>
<?php echo editor_html("qa_content_head", $qaconfig['qa_content_head']); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="qa_content_tail">하단 내용</label></th>
<td>
<?php echo editor_html("qa_content_tail", $qaconfig['qa_content_tail']); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="qa_mobile_content_head">모바일 상단 내용</label></th>
<td>
<?php echo editor_html("qa_mobile_content_head", $qaconfig['qa_mobile_content_head']); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="qa_mobile_content_tail">모바일 하단 내용</label></th>
<td>
<?php echo editor_html("qa_mobile_content_tail", $qaconfig['qa_mobile_content_tail']); ?>
</td>
</tr>
<tr>
<th scope="row"><label for="qa_insert_content">글쓰기 기본 내용</label></th>
<td>
@ -266,6 +320,11 @@ if(!isset($qaconfig['qa_admin_email'])) {
<script>
function fqaconfigform_submit(f)
{
<?php echo get_editor_js("qa_content_head"); ?>
<?php echo get_editor_js("qa_content_tail"); ?>
<?php echo get_editor_js("qa_mobile_content_head"); ?>
<?php echo get_editor_js("qa_mobile_content_tail"); ?>
f.action = "./qa_config_update.php";
return true;
}

View File

@ -29,6 +29,12 @@ $sql = " update {$g5['qa_config_table']}
qa_image_width = '{$_POST['qa_image_width']}',
qa_upload_size = '{$_POST['qa_upload_size']}',
qa_insert_content = '{$_POST['qa_insert_content']}',
qa_include_head = '{$_POST['qa_include_head']}',
qa_include_tail = '{$_POST['qa_include_tail']}',
qa_content_head = '{$_POST['qa_content_head']}',
qa_content_tail = '{$_POST['qa_content_tail']}',
qa_mobile_content_head = '{$_POST['qa_mobile_content_head']}',
qa_mobile_content_tail = '{$_POST['qa_mobile_content_tail']}',
qa_1_subj = '{$_POST['qa_1_subj']}',
qa_2_subj = '{$_POST['qa_2_subj']}',
qa_3_subj = '{$_POST['qa_3_subj']}',

18
bbs/qahead.php Normal file
View File

@ -0,0 +1,18 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
$qa_skin_path = (G5_IS_MOBILE ? G5_MOBILE_PATH : G5_PATH).'/'.G5_SKIN_DIR.'/qa/'.$qaconfig['qa_skin'];
$qa_skin_url = (G5_IS_MOBILE ? G5_MOBILE_URL : G5_URL).'/'.G5_SKIN_DIR.'/qa/'.$qaconfig['qa_skin'];
if (G5_IS_MOBILE) {
// 모바일의 경우 설정을 따르지 않는다.
include_once('./_head.php');
echo stripslashes($qaconfig['qa_mobile_content_head']);
} else {
if($qaconfig['qa_include_head'])
@include ($qaconfig['qa_include_head']);
else
include ('./_head.php');
echo stripslashes($qaconfig['qa_content_head']);
}
?>

View File

@ -7,10 +7,8 @@ if($is_guest)
$qaconfig = get_qa_config();
$g5['title'] = $qaconfig['qa_title'];
include_once('./_head.php');
include_once('./qahead.php');
$qa_skin_path = (G5_IS_MOBILE ? G5_MOBILE_PATH : G5_PATH).'/'.G5_SKIN_DIR.'/qa/'.$qaconfig['qa_skin'];
$qa_skin_url = (G5_IS_MOBILE ? G5_MOBILE_URL : G5_URL).'/'.G5_SKIN_DIR.'/qa/'.$qaconfig['qa_skin'];
$skin_file = $qa_skin_path.'/list.skin.php';
$category_option = '';
@ -120,5 +118,5 @@ if(is_file($skin_file)) {
echo '<div>'.str_replace(G5_PATH.'/', '', $skin_file).'이 존재하지 않습니다.</div>';
}
include_once('./_tail.php');
include_once('./qatail.php');
?>

15
bbs/qatail.php Normal file
View File

@ -0,0 +1,15 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if (G5_IS_MOBILE) {
echo stripslashes($qaconfig['qa_mobile_content_tail']);
// 모바일의 경우 설정을 따르지 않는다.
include_once('./_tail.php');
} else {
echo stripslashes($qaconfig['qa_mobile_content_tail']);
if($qaconfig['qa_include_tail'])
@include ($board['bo_include_tail']);
else
include ('./_tail.php');
}
?>

View File

@ -8,10 +8,8 @@ if($is_guest)
$qaconfig = get_qa_config();
$g5['title'] = $qaconfig['qa_title'];
include_once('./_head.php');
include_once('./qahead.php');
$qa_skin_path = (G5_IS_MOBILE ? G5_MOBILE_PATH : G5_PATH).'/'.G5_SKIN_DIR.'/qa/'.$qaconfig['qa_skin'];
$qa_skin_url = (G5_IS_MOBILE ? G5_MOBILE_URL : G5_URL).'/'.G5_SKIN_DIR.'/qa/'.$qaconfig['qa_skin'];
$skin_file = $qa_skin_path.'/view.skin.php';
if(is_file($skin_file)) {
@ -173,5 +171,5 @@ if(is_file($skin_file)) {
echo '<div>'.str_replace(G5_PATH.'/', '', $skin_file).'이 존재하지 않습니다.</div>';
}
include_once('./_tail.php');
include_once('./qatail.php');
?>

View File

@ -12,10 +12,8 @@ if($is_guest)
$qaconfig = get_qa_config();
$g5['title'] = $qaconfig['qa_title'];
include_once('./_head.php');
include_once('./qahead.php');
$qa_skin_path = (G5_IS_MOBILE ? G5_MOBILE_PATH : G5_PATH).'/'.G5_SKIN_DIR.'/qa/'.$qaconfig['qa_skin'];
$qa_skin_url = (G5_IS_MOBILE ? G5_MOBILE_URL : G5_URL).'/'.G5_SKIN_DIR.'/qa/'.$qaconfig['qa_skin'];
$skin_file = $qa_skin_path.'/write.skin.php';
if(is_file($skin_file)) {
@ -137,5 +135,5 @@ if(is_file($skin_file)) {
echo '<div>'.str_replace(G5_PATH.'/', '', $skin_file).'이 존재하지 않습니다.</div>';
}
include_once('./_tail.php');
include_once('./qatail.php');
?>

View File

@ -732,6 +732,12 @@ CREATE TABLE IF NOT EXISTS `g5_qa_config` (
`qa_image_width` int(11) NOT NULL DEFAULT '0',
`qa_upload_size` int(11) NOT NULL DEFAULT '0',
`qa_insert_content` text NOT NULL,
`qa_include_head` varchar(255) NOT NULL DEFAULT '',
`qa_include_tail` varchar(255) NOT NULL DEFAULT '',
`qa_content_head` text NOT NULL,
`qa_content_tail` text NOT NULL,
`qa_mobile_content_head` text NOT NULL,
`qa_mobile_content_tail` text NOT NULL,
`qa_1_subj` varchar(255) NOT NULL DEFAULT '',
`qa_2_subj` varchar(255) NOT NULL DEFAULT '',
`qa_3_subj` varchar(255) NOT NULL DEFAULT '',