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

This commit is contained in:
gnuboard
2013-02-27 11:52:12 +09:00
12 changed files with 147 additions and 45 deletions

View File

@ -21,15 +21,27 @@ function get_skin_select($skin_gubun, $id, $name, $selected='', $event='')
return $str;
}
// 모바일 스킨디렉토리를 SELECT 형식으로 얻음
function get_mobile_skin_select($skin_gubun, $id, $name, $selected='', $event='')
{
$skins = get_skin_dir($skin_gubun, G4_MOBILE_PATH.'/'.G4_SKIN_DIR);
$str = "<select id=\"$id\" name=\"$name\" $event>\n";
for ($i=0; $i<count($skins); $i++) {
$str .= option_selected($skins[$i], $selected);
}
$str .= "</select>";
return $str;
}
// 스킨경로를 얻는다
function get_skin_dir($skin)
function get_skin_dir($skin, $skin_path=G4_SKIN_PATH)
{
global $g4;
$result_array = array();
$dirname = G4_SKIN_PATH.'/'.$skin.'/';
$dirname = $skin_path.'/'.$skin.'/';
$handle = opendir($dirname);
while ($file = readdir($handle)) {
if($file == '.'||$file == '..') continue;

View File

@ -12,10 +12,24 @@ 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 (!isset($board['bo_device'])) {
// 게시판 사용 필드 추가
// both : pc, mobile 둘다 사용
// pc : pc 전용 사용
// mobile : mobile 전용 사용
// none : 사용 안함
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_device` ENUM( 'both', 'pc', 'mobile' ) NOT NULL DEFAULT 'both' AFTER `bo_subject` ", true);
}
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` ", true);
}
if (!isset($board['bo_mobile_skin'])) {
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_mobile_skin` VARCHAR(255) NOT NULL DEFAULT '' AFTER `bo_skin` ", true);
}
if ($w == '') {
$html_title .= ' 생성';
@ -42,6 +56,7 @@ if ($w == '') {
$board['bo_reply_order'] = 1;
$board['bo_use_search'] = 1;
$board['bo_skin'] = 'basic';
$board['bo_mobile_skin'] = 'basic';
$board['gr_id'] = $gr_id;
$board['bo_use_secret'] = 0;
$board['bo_include_head'] = '_head.php';
@ -586,14 +601,24 @@ $pg_anchor = "<ul class=\"anchor\">
<tr>
<th scope="row"><label for="bo_skin">스킨 디렉토리<strong class="sound_only">필수</strong></label></th>
<td>
<?=get_skin_select("board", "bo_skin", "bo_skin", $board['bo_skin'], 'required');?>
<a href="" class="goto_sirskin" target="_blank">스킨자료실</a>
<?=get_skin_select('board', 'bo_skin', 'bo_skin', $board['bo_skin'], 'required');?>
</td>
<td class="group_setting">
<input type="checkbox" id="chk_skin" name="chk_skin" value="1">
<label for="chk_skin">동일그룹 모두 적용</label>
</td>
</tr>
<tbody>
<tr>
<th scope="row"><label for="bo_mobile_skin">모바일<br>스킨 디렉토리<strong class="sound_only">필수</strong></label></th>
<td>
<?=get_mobile_skin_select('board', 'bo_mobile_skin', 'bo_mobile_skin', $board['bo_mobile_skin'], 'required');?>
</td>
<td class="group_setting">
<input type="checkbox" id="chk_mobile_skin" name="chk_mobile_skin" value="1">
<label for="chk_mobile_skin">동일그룹 모두 적용</label>
</td>
</tr>
<tr>
<th scope="row"><label for="bo_include_head">상단 파일 경로</label></th>
<td>

View File

@ -92,6 +92,7 @@ $sql_common = " gr_id = '{$_POST['gr_id']}',
bo_hot = '{$_POST['bo_hot']}',
bo_image_width = '{$_POST['bo_image_width']}',
bo_skin = '{$_POST['bo_skin']}',
bo_mobile_skin = '{$_POST['bo_mobile_skin']}',
bo_include_head = '{$_POST['bo_include_head']}',
bo_include_tail = '{$_POST['bo_include_tail']}',
bo_content_head = '{$_POST['bo_content_head']}',

View File

@ -4,15 +4,6 @@ include_once('./_common.php');
auth_check($auth[$sub_menu], 'r');
if (!isset($board['bo_device'])) {
// 게시판 사용 필드 추가
// both : pc, mobile 둘다 사용
// pc : pc 전용 사용
// mobile : mobile 전용 사용
// none : 사용 안함
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_device` ENUM( 'both', 'pc', 'mobile' ) NOT NULL DEFAULT 'both' AFTER `bo_subject` ", false);
}
$sql_common = " from {$g4['board_table']} a ";
$sql_search = " where (1) ";
@ -106,6 +97,7 @@ $colspan = 8;
<th scope="col"><?=subject_sort_link('a.gr_id')?>그룹</a></th>
<th scope="col"><?=subject_sort_link('bo_table')?>TABLE</a></th>
<th scope="col"><?=subject_sort_link('bo_skin', '', 'desc')?>스킨</a></th>
<th scope="col"><?=subject_sort_link('bo_mobile_skin', '', 'desc')?>모바일<br>스킨</a></th>
<th scope="col"><?=subject_sort_link('bo_subject')?>제목</a></th>
<th scope="col">읽기P<span class="sound_only">포인트</span></th>
<th scope="col">쓰기P<span class="sound_only">포인트</span></th>
@ -141,7 +133,10 @@ $colspan = 8;
<a href="<?=G4_BBS_URL?>/board.php?bo_table=<?=$row['bo_table']?>"><?=$row['bo_table']?></a>
</td>
<td>
<?=get_skin_select("board", "bo_skin_$i", "bo_skin[$i]", $row['bo_skin']);?>
<?=get_skin_select('board', 'bo_skin_'.$i, "bo_skin[$i]", $row['bo_skin']);?>
</td>
<td>
<?=get_mobile_skin_select('board', 'bo_skin_'.$i, "bo_skin[$i]", $row['bo_skin']);?>
</td>
<td><input type="text" id="bo_subject[<?=$i?>]" name="bo_subject[<?=$i?>]" class="required frm_input" value="<?=get_text($row['bo_subject'])?>" title="게시판제목" size="10" required="required"></td>
<td><input type="text" name="bo_read_point[<?=$i?>]" class="frm_input" value="<?=$row['bo_read_point']?>" size="2" title="읽기포인트"></td>

View File

@ -32,6 +32,7 @@ if ($_POST['act_button'] == "선택수정") {
bo_subject = '{$_POST['bo_subject'][$k]}',
bo_device = '{$_POST['bo_device'][$k]}',
bo_skin = '{$_POST['bo_skin'][$k]}',
bo_mobile_skin = '{$_POST['bo_mobile_skin'][$k]}',
bo_read_point = '{$_POST['bo_read_point'][$k]}',
bo_write_point = '{$_POST['bo_write_point'][$k]}',
bo_comment_point = '{$_POST['bo_comment_point'][$k]}',

View File

@ -14,8 +14,15 @@ if (!isset($config['cf_include_index'])) {
ADD `cf_include_index` VARCHAR(255) NOT NULL AFTER `cf_admin`,
ADD `cf_include_head` VARCHAR(255) NOT NULL AFTER `cf_include_index`,
ADD `cf_include_tail` VARCHAR(255) NOT NULL AFTER `cf_include_head`,
ADD `cf_add_script` TEXT NOT NULL AFTER `cf_include_tail`
", TRUE);
ADD `cf_add_script` TEXT NOT NULL AFTER `cf_include_tail` ", true);
}
if (!isset($config['cf_mobile_new_skin'])) {
sql_query(" ALTER TABLE `{$g4['config_table']}`
ADD `cf_mobile_new_skin` VARCHAR(255) NOT NULL AFTER `cf_memo_send_point`,
ADD `cf_mobile_search_skin` VARCHAR(255) NOT NULL AFTER `cf_mobile_new_skin`,
ADD `cf_mobile_connect_skin` VARCHAR(255) NOT NULL AFTER `cf_mobile_search_skin`,
ADD `cf_mobile_member_skin` VARCHAR(255) NOT NULL AFTER `cf_mobile_connect_skin` ", true);
}
$g4['title'] = '환경설정';
@ -148,6 +155,13 @@ $pg_anchor = "
<input type="text" id="cf_page_rows" name="cf_page_rows" class="frm_input" value="<?=$config['cf_page_rows']?>" size="2"> 라인
</td>
</tr>
<tr>
<th scope="row"><label for="cf_new_rows">최근게시물 라인수</label></th>
<td colspan="3">
<?=help('목록 한페이지당 라인수')?>
<input type="text" id="cf_new_rows" name="cf_new_rows" class="frm_input" value="<?=$config['cf_new_rows']?>" size="2"> 라인
</td>
</tr>
<tr>
<th scope="row"><label for="cf_new_skin">최근게시물 스킨<strong class="sound_only">필수</strong></label></th>
<td>
@ -159,31 +173,46 @@ $pg_anchor = "
}
?>
</select>
<a href="" class="goto_sirskin" target="_blank">스킨자료실</a>
</td>
<th scope="row"><label for="cf_new_rows">최근게시물 라인수</label></th>
<th scope="row"><label for="cf_mobile_new_skin">모바일<br>최근게시물 스킨<strong class="sound_only">필수</strong></label></th>
<td>
<?=help('목록 한페이지당 라인수')?>
<input type="text" id="cf_new_rows" name="cf_new_rows" class="frm_input" value="<?=$config['cf_new_rows']?>" size="2"> 라인
<select id="cf_mobile_new_skin" name="cf_mobile_new_skin" class="required" required>
<?
$arr = get_skin_dir('new', G4_MOBILE_PATH.'/'.G4_SKIN_DIR);
for ($i=0; $i<count($arr); $i++) {
echo "<option value=\"".$arr[$i]."\"".get_selected($config['cf_mobile_new_skin'], $arr[$i]).">".$arr[$i]."</option>".PHP_EOL;
}
?>
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="cf_search_skin">검색 스킨<strong class="sound_only">필수</strong></label></th>
<td colspan="3">
<td>
<select id="cf_search_skin" name="cf_search_skin" class="required" required>
<?
$arr = get_skin_dir("search");
$arr = get_skin_dir('search');
for ($i=0; $i<count($arr); $i++) {
echo "<option value=\"".$arr[$i]."\"".get_selected($config['cf_search_skin'], $arr[$i]).">".$arr[$i]."</option>".PHP_EOL;
}
?>
</select>
<a href="" class="goto_sirskin" target="_blank">스킨자료실</a>
</td>
<th scope="row"><label for="cf_mobile_search_skin">모바일<br>검색 스킨<strong class="sound_only">필수</strong></label></th>
<td>
<select id="cf_mobile_search_skin" name="cf_mobile_search_skin" class="required" required>
<?
$arr = get_skin_dir('search', G4_MOBILE_PATH.'/'.G4_SKIN_DIR);
for ($i=0; $i<count($arr); $i++) {
echo "<option value=\"".$arr[$i]."\"".get_selected($config['cf_mobile_search_skin'], $arr[$i]).">".$arr[$i]."</option>".PHP_EOL;
}
?>
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="cf_connect_skin">접속자 스킨<strong class="sound_only">필수</strong></label></th>
<td colspan="3">
<td>
<select id="cf_connect_skin" name="cf_connect_skin" class="required" required>
<?
$arr = get_skin_dir('connect');
@ -192,7 +221,17 @@ $pg_anchor = "
}
?>
</select>
<a href="" class="goto_sirskin" target="_blank">스킨자료실</a>
</td>
<th scope="row"><label for="cf_mobile_connect_skin">모바일<br>접속자 스킨<strong class="sound_only">필수</strong></label></th>
<td>
<select id="cf_mobile_connect_skin" name="cf_mobile_connect_skin" class="required" required>
<?
$arr = get_skin_dir('connect', G4_MOBILE_PATH.'/'.G4_SKIN_DIR);
for ($i=0; $i<count($arr); $i++) {
echo "<option value=\"".$arr[$i]."\"".get_selected($config['cf_mobile_connect_skin'], $arr[$i]).">".$arr[$i]."</option>".PHP_EOL;
}
?>
</select>
</td>
</tr>
<tr>
@ -310,16 +349,26 @@ $pg_anchor = "
<tbody>
<tr>
<th scope="row"><label for="cf_member_skin">회원 스킨<strong class="sound_only">필수</strong></label></th>
<td colspan="3">
<td>
<select id="cf_member_skin" name="cf_member_skin" class="required" required>
<?
$arr = get_skin_dir('member');
for ($i=0; $i<count($arr); $i++) {
echo "<option value=\"".$arr[$i]."\"".get_selected($config['cf_member_skin'], $arr[$i]).">".$arr[$i]."</option>".PHP_EOL;
echo '<option value="'.$arr[$i].'"'.get_selected($config['cf_member_skin'], $arr[$i]).'>'.$arr[$i].'</option>'.PHP_EOL;
}
?>
</select>
</td>
<th scope="row"><label for="cf_mobile_member_skin">모바일<br>회원 스킨<strong class="sound_only">필수</strong></label></th>
<td>
<select id="cf_mobile_member_skin" name="cf_mobile_member_skin" class="required" required>
<?
$arr = get_skin_dir('member', G4_MOBILE_PATH.'/'.G4_SKIN_DIR);
for ($i=0; $i<count($arr); $i++) {
echo '<option value="'.$arr[$i].'"'.get_selected($config['cf_member_skin'], $arr[$i]).'>'.$arr[$i].'</option>'.PHP_EOL;
}
?>
</select>
<a href="" class="goto_sirskin" target="_blank">스킨자료실</a>
</td>
</tr>
<tr>

View File

@ -99,6 +99,10 @@ $sql = " update {$g4['config_table']}
cf_privacy = '{$_POST['cf_privacy']}',
cf_open_modify = '{$_POST['cf_open_modify']}',
cf_memo_send_point = '{$_POST['cf_memo_send_point']}',
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_member_skin = '{$_POST['cf_mobile_member_skin']}',
cf_1_subj = '{$_POST['cf_1_subj']}',
cf_2_subj = '{$_POST['cf_2_subj']}',
cf_3_subj = '{$_POST['cf_3_subj']}',

View File

@ -185,7 +185,7 @@ if ($member['mb_level'] >= $board['bo_list_level'] && $board['bo_use_list_view']
include_once('./board_tail.php');
echo "\n<!-- 사용스킨 : {$board['bo_skin']} -->\n";
echo "\n<!-- 사용스킨 : {$board_skin_url} -->\n";
include_once(G4_PATH.'/tail.sub.php');
?>

View File

@ -134,6 +134,11 @@ if( $cert_enc_use == "Y" )
$md5_cert_no = md5($cert_no);
$hash_data = md5($phone_no.$user_name.$md5_cert_no);
set_session('ss_kcpcert_hash', $hash_data);
// 성인인증결과
$adult_day = date("Ymd", strtotime("-19 years", G4_SERVER_TIME));
if((int)$birth_day <= (int)$adult_day)
set_session('ss_adult_check', 'Y');
}
else if( $res_cd != "0000" )
{

View File

@ -409,21 +409,21 @@ if ($is_admin != 'super') {
// 스킨경로
//------------------------------------------------------------------------------
if (G4_IS_MOBILE) {
$board_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/board/'.$board['bo_skin'];
$board_skin_url = G4_SKIN_URL.'/board/'.$board['bo_skin'];
$member_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/member/'.$config['cf_member_skin'];
$member_skin_url = G4_SKIN_URL.'/member/'.$config['cf_member_skin'];
$new_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/new/'.$config['cf_new_skin'];
$search_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/search/'.$config['cf_search_skin'];
$connect_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/connect/'.$config['cf_connect_skin'];
$board_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/board/'.$board['bo_mobile_skin'];
$board_skin_url = G4_MOBILE_URL .'/'.G4_SKIN_DIR.'/board/'.$board['bo_mobile_skin'];
$member_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/member/'.$config['cf_mobile_member_skin'];
$member_skin_url = G4_MOBILE_URL .'/'.G4_SKIN_DIR.'/member/'.$config['cf_mobile_member_skin'];
$new_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/new/'.$config['cf_mobile_new_skin'];
$search_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/search/'.$config['cf_mobile_search_skin'];
$connect_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/connect/'.$config['cf_mobile_connect_skin'];
$poll_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/poll/basic';
if (isset($_GET['skin_dir']))
$poll_skin_path = G4_SKIN_PATH.'/poll/'.$_GET['skin_dir'];
$poll_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/poll/'.$_GET['skin_dir'];
} else {
$board_skin_path = G4_SKIN_PATH.'/board/'.$board['bo_skin'];
$board_skin_url = G4_SKIN_URL.'/board/'.$board['bo_skin'];
$board_skin_url = G4_SKIN_URL .'/board/'.$board['bo_skin'];
$member_skin_path = G4_SKIN_PATH.'/member/'.$config['cf_member_skin'];
$member_skin_url = G4_SKIN_URL.'/member/'.$config['cf_member_skin'];
$member_skin_url = G4_SKIN_URL .'/member/'.$config['cf_member_skin'];
$new_skin_path = G4_SKIN_PATH.'/new/'.$config['cf_new_skin'];
$search_skin_path = G4_SKIN_PATH.'/search/'.$config['cf_search_skin'];
$connect_skin_path = G4_SKIN_PATH.'/connect/'.$config['cf_connect_skin'];

View File

@ -4,7 +4,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 자신만의 코드를 넣어주세요.
/* ======================================================================================================= */
/* = 휴대폰인증 = */
/* = 휴대폰인증 및 성인인증 = */
/* ======================================================================================================= */
if($w == '') {
// 본인인증체크
@ -17,6 +17,12 @@ if($w == '') {
$reg_hash = md5($reg_hp.$mb_name.$kcpcert_no);
if(get_session('ss_kcpcert_hash') != $reg_hash)
alert('휴대폰인증 정보가 올바르지 않습니다. 정상적인 방법으로 이용해 주세요.', "", true, true);
// 성인인증을 사용한다면
if($config['cf_adult_check']) {
if(get_session('ss_adult_check') != 'Y')
alert('성인인증이 되지 않았습니다. 다음에 다시 가입해 주세요.', "", true, true);
}
} else if($w == 'u') {
// 휴대폰번호 변경체크
$patt = "/[^0-9]/";

View File

@ -4,12 +4,16 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 자신만의 코드를 넣어주세요.
/* =========================================================================== */
/* = 휴대폰인증 = */
/* = 휴대폰인증 및 성인인증 = */
/* =========================================================================== */
if($_POST['kcpcert_no']) {
// 휴대폰인증 시간기록
$mb_adult = 'N';
if(get_session('ss_adult_check') == 'Y')
$mb_adult = 'Y';
$sql = " update {$g4['member_table']}
set mb_hp_certify = '{$_POST['kcpcert_time']}'
set mb_hp_certify = '{$_POST['kcpcert_time']}',
mb_adult = '$mb_adult'
where mb_id = '$mb_id' ";
sql_query($sql);
}