diff --git a/adm/config_form.php b/adm/config_form.php index 02da0575d..aaec76ca8 100644 --- a/adm/config_form.php +++ b/adm/config_form.php @@ -1282,7 +1282,10 @@ if($config['cf_cert_use']) { // kcp일 때 if($config['cf_cert_hp'] == 'kcp') { - $exe = G5_KCPCERT_PATH.'/bin/ct_cli'; + if(PHP_INT_MAX == 2147483647) // 32-bit + $exe = G5_KCPCERT_PATH . '/bin/ct_cli'; + else + $exe = G5_KCPCERT_PATH . '/bin/ct_cli_x64'; echo module_exec_check($exe, 'ct_cli'); } diff --git a/adm/contentform.php b/adm/contentform.php index 8f00030ff..a20bf373e 100644 --- a/adm/contentform.php +++ b/adm/contentform.php @@ -19,6 +19,20 @@ if(!sql_query(" select co_tag_filter_use from {$g5['content_table']} limit 1 ", sql_query(" update {$g5['content_table']} set co_tag_filter_use = '1' "); } +// 모바일 내용 추가 +if(!sql_query(" select co_mobile_content from {$g5['content_table']} limit 1", false)) { + sql_query(" ALTER TABLE `{$g5['content_table']}` + ADD `co_mobile_content` longtext NOT NULL AFTER `co_content` ", true); +} + +// 스킨 설정 추가 +if(!sql_query(" select co_skin from {$g5['content_table']} limit 1 ", false)) { + sql_query(" ALTER TABLE `{$g5['content_table']}` + ADD `co_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_mobile_content`, + ADD `co_mobile_skin` varchar(255) NOT NULL DEFAULT '' AFTER `co_skin` ", true); + sql_query(" update {$g5['content_table']} set co_skin = 'basic', co_mobile_skin = 'basic' "); +} + $html_title = "내용"; $g5['title'] = $html_title.' 관리'; @@ -36,6 +50,8 @@ else { $html_title .= ' 입력'; $co['co_html'] = 2; + $co['co_skin'] = 'basic'; + $co['co_mobile_skin'] = 'basic'; } include_once (G5_ADMIN_PATH.'/admin.head.php'); @@ -69,6 +85,22 @@ include_once (G5_ADMIN_PATH.'/admin.head.php'); 내용 + + 모바일 내용 + + + + + + + + + + + + + + @@ -160,6 +192,7 @@ function frmcontentform_check(f) + check_field(f.co_id, "ID를 입력하세요."); check_field(f.co_subject, "제목을 입력하세요."); diff --git a/adm/contentformupdate.php b/adm/contentformupdate.php index 4f9786ffd..57c26e172 100644 --- a/adm/contentformupdate.php +++ b/adm/contentformupdate.php @@ -21,7 +21,10 @@ $sql_common = " co_include_head = '$co_include_head', co_html = '$co_html', co_tag_filter_use = '$co_tag_filter_use', co_subject = '$co_subject', - co_content = '$co_content' "; + co_content = '$co_content', + co_mobile_content = '$co_mobile_content', + co_skin = '$co_skin', + co_mobile_skin = '$co_mobile_skin' "; if ($w == "") { diff --git a/adm/member_list_delete.php b/adm/member_list_delete.php index 0deced561..c4810fc8f 100644 --- a/adm/member_list_delete.php +++ b/adm/member_list_delete.php @@ -16,7 +16,7 @@ for ($i=0; $i - 주문상태에서만 삭제가 가능합니다. + 주문상태에서만 삭제가 가능합니다.
diff --git a/bbs/board.php b/bbs/board.php index 9d19b15ee..8e54a2434 100644 --- a/bbs/board.php +++ b/bbs/board.php @@ -236,7 +236,7 @@ if ($member['mb_level'] >= $board['bo_list_level'] && $board['bo_use_list_view'] include_once('./board_tail.php'); -echo "\n\n"; +echo "\n\n"; include_once(G5_PATH.'/tail.sub.php'); ?> diff --git a/bbs/content.php b/bbs/content.php index a8ba46f2a..f712cffc6 100644 --- a/bbs/content.php +++ b/bbs/content.php @@ -30,7 +30,6 @@ $str = conv_content($co['co_content'], $co['co_html'], $co['co_tag_filter_use']) unset($src); unset($dst); $src[] = "/{{쇼핑몰명}}|{{홈페이지제목}}/"; -//$dst[] = $default[de_subject]; $dst[] = $config['cf_title']; $src[] = "/{{회사명}}|{{상호}}/"; $dst[] = $default['de_admin_company_name']; @@ -59,39 +58,33 @@ $dst[] = $default['de_admin_info_email']; $str = preg_replace($src, $dst, $str); -if ($is_admin) - echo ''; -?> +// 스킨경로 +if(trim($co['co_skin']) == '') + $co['co_skin'] = 'basic'; - -
'; -?> - -
-
-

-
- -
- -
- -
- -'; +$content_skin_path = G5_SKIN_PATH.'/content/'.$co['co_skin']; +$content_skin_url = G5_SKIN_URL.'/content/'.$co['co_skin']; +$skin_file = $content_skin_path.'/content.skin.php'; if ($is_admin) echo '
내용 수정
'; ?> - '; + + include($skin_file); + + $timg = G5_DATA_PATH.'/content/'.$co_id.'_t'; + if (file_exists($timg)) // 하단 이미지 + echo '
'; +} else { + echo '

'.str_replace(G5_PATH.'/', '', $skin_file).'이 존재하지 않습니다.

'; +} + if ($co['co_include_tail']) @include_once($co['co_include_tail']); else diff --git a/bbs/db_table.optimize.php b/bbs/db_table.optimize.php index f676ce4ef..3d0c38c3a 100644 --- a/bbs/db_table.optimize.php +++ b/bbs/db_table.optimize.php @@ -50,6 +50,13 @@ if($config['cf_leave_day'] > 0) { } } +// 음성 캡챠 파일 삭제 +foreach (glob(G5_PATH.'/data/cache/kcaptcha-*.mp3') as $file) { + if (filemtime($file) + 86400 < G5_SERVER_TIME) { + @unlink($file); + } +} + // 실행일 기록 if(isset($config['cf_optimize_date'])) { sql_query(" update {$g5['config_table']} set cf_optimize_date = '".G5_TIME_YMD."' "); diff --git a/css/default.css b/css/default.css index 4c3fe46c6..881d14f6b 100644 --- a/css/default.css +++ b/css/default.css @@ -252,13 +252,6 @@ a.btn_admin:focus, a.btn_admin:hover {text-decoration:none} .new_win .win_btn a {display:inline-block;padding:0 10px;height:30px;background:#4b545e;color:#fff;vertical-align:middle;line-height:2.4em} .new_win .win_btn a:focus, .new_win .win_btn a:hover {text-decoration:none} -/* 내용관리 */ -#ctt {margin:10px 0;padding:10px;border:1px solid #e9e9e9} -.ctt_admin {text-align:right} -#ctt header h1 {position:absolute;font-size:0;line-height:0;overflow:hidden} -#ctt_con {padding:10px 0} -.ctt_img {text-align:center} - /* 검색결과 색상 */ .sch_word {color:#ff3061} diff --git a/css/mobile.css b/css/mobile.css index bb8334c73..412491a4e 100644 --- a/css/mobile.css +++ b/css/mobile.css @@ -225,13 +225,6 @@ a.btn_admin:focus, a.btn_admin:hover {text-decoration:none} .new_win .win_btn button {display:inline-block;padding:0 10px;height:2.5em;border:0;background:#666;color:#fff;text-decoration:none;line-height:2.5em} .new_win .win_btn input {padding:0 10px;height:2.5em;line-height:2.5em} -/* 내용관리 */ -#ctt {margin:10px 0;padding:10px;border-top:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9} -.ctt_admin {margin:0 5px;text-align:right} -#ctt header h1 {position:absolute;font-size:0;line-height:0;overflow:hidden} -#ctt_con {padding:10px 0} -.ctt_img {text-align:center} - /* 검색결과 색상 */ .sch_word {color:#ff3061} diff --git a/extend/shop.extend.php b/extend/shop.extend.php index fc82199a7..b76428664 100644 --- a/extend/shop.extend.php +++ b/extend/shop.extend.php @@ -131,6 +131,10 @@ if($default['de_card_test']) { define('G5_CASH_RECEIPT_URL', 'https://admin.kcp.co.kr/Modules/Service/Cash/Cash_Bill_Common_View.jsp?term_id=PGNW'); } +// 주문폼의 상품이 재고 차감에 포함되는 기준 시간설정 +// 0 이면 재고 차감에 계속 포함됨 +define('G5_CART_STOCK_LIMIT', 3); + // 아이코드 코인 최소금액 설정 // 코인 잔액이 설정 금액보다 작을 때는 주문시 SMS 발송 안함 define('G5_ICODE_COIN', 100); diff --git a/install/gnuboard5.sql b/install/gnuboard5.sql index 3271cbb85..4891d4fba 100644 --- a/install/gnuboard5.sql +++ b/install/gnuboard5.sql @@ -781,6 +781,9 @@ CREATE TABLE IF NOT EXISTS `g5_content` ( `co_html` tinyint(4) NOT NULL DEFAULT '0', `co_subject` varchar(255) NOT NULL DEFAULT '', `co_content` longtext NOT NULL, + `co_mobile_content` longtext NOT NULL, + `co_skin` varchar(255) NOT NULL DEFAULT '', + `co_mobile_skin` varchar(255) NOT NULL DEFAULT '', `co_tag_filter_use` tinyint(4) NOT NULL DEFAULT '0', `co_hit` int(11) NOT NULL DEFAULT '0', `co_include_head` varchar(255) NOT NULL, diff --git a/install/gnuboard5shop.sql b/install/gnuboard5shop.sql index 3a847cdfa..b3cfb1cbe 100644 --- a/install/gnuboard5shop.sql +++ b/install/gnuboard5shop.sql @@ -56,6 +56,7 @@ CREATE TABLE IF NOT EXISTS `g5_shop_cart` ( `ct_send_cost` tinyint(4) NOT NULL DEFAULT '0', `ct_direct` tinyint(4) NOT NULL DEFAULT '0', `ct_select` tinyint(4) NOT NULL DEFAULT '0', + `ct_select_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`ct_id`), KEY `od_id` (`od_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/install/install_db.php b/install/install_db.php index 4c3f54a60..4651d852a 100644 --- a/install/install_db.php +++ b/install/install_db.php @@ -201,9 +201,9 @@ if($g5_install || !$result) { @mysql_query($sql); // 내용관리 생성 - @mysql_query(" insert into `{$table_prefix}content` set co_id = 'company', co_html = '1', co_subject = '회사소개', co_content= '

회사소개에 대한 내용을 입력하십시오.

' ") or die(mysql_error() . "

" . $sql); - @mysql_query(" insert into `{$table_prefix}content` set co_id = 'privacy', co_html = '1', co_subject = '개인정보 처리방침', co_content= '

개인정보 처리방침에 대한 내용을 입력하십시오.

' ") or die(mysql_error() . "

" . $sql); - @mysql_query(" insert into `{$table_prefix}content` set co_id = 'provision', co_html = '1', co_subject = '서비스 이용약관', co_content= '

서비스 이용약관에 대한 내용을 입력하십시오.

' ") or die(mysql_error() . "

" . $sql); + @mysql_query(" insert into `{$table_prefix}content` set co_id = 'company', co_html = '1', co_subject = '회사소개', co_content= '

회사소개에 대한 내용을 입력하십시오.

', co_skin = 'basic', co_mobile_skin = 'basic' ") or die(mysql_error() . "

" . $sql); + @mysql_query(" insert into `{$table_prefix}content` set co_id = 'privacy', co_html = '1', co_subject = '개인정보 처리방침', co_content= '

개인정보 처리방침에 대한 내용을 입력하십시오.

', co_skin = 'basic', co_mobile_skin = 'basic' ") or die(mysql_error() . "

" . $sql); + @mysql_query(" insert into `{$table_prefix}content` set co_id = 'provision', co_html = '1', co_subject = '서비스 이용약관', co_content= '

서비스 이용약관에 대한 내용을 입력하십시오.

', co_skin = 'basic', co_mobile_skin = 'basic' ") or die(mysql_error() . "

" . $sql); // FAQ Master @mysql_query(" insert into `{$table_prefix}faq_master` set fm_id = '1', fm_subject = '자주하시는 질문' ") or die(mysql_error() . "

" . $sql); diff --git a/js/shop.order.js b/js/shop.order.js new file mode 100644 index 000000000..312eef4e9 --- /dev/null +++ b/js/shop.order.js @@ -0,0 +1,13 @@ +var order_stock_check = function() { + var result = ""; + $.ajax({ + type: "POST", + url: g5_url+"/shop/ajax.orderstock.php", + cache: false, + async: false, + success: function(data) { + result = data; + } + }); + return result; +} \ No newline at end of file diff --git a/lib/common.lib.php b/lib/common.lib.php index 509e7dfa0..d56693855 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -141,7 +141,7 @@ function get_cookie($cookie_name) { $cookie = md5($cookie_name); if (array_key_exists($cookie, $_COOKIE)) - return base64_decode($_COOKIE[md5($cookie_name)]); + return base64_decode($_COOKIE[$cookie]); else return ""; } @@ -214,11 +214,12 @@ function url_auto_link($str) // 140326 유창화님 제안코드로 수정 // http://sir.co.kr/bbs/board.php?bo_table=pg_lecture&wr_id=461 // http://sir.co.kr/bbs/board.php?bo_table=pg_lecture&wr_id=463 - $str = str_replace(array("<", ">", "&", """, " "), array("\t_lt_\t", "\t_gt_\t", "&", "\"", "\t_nbsp_\t"), $str); - $str = preg_replace("`(?:(?:(?:href|src)\s*=\s*(?:\"|'|)){0})((http|https|ftp|telnet|news|mms)://[^\"'\s()]+)`", "\\1", $str); - $str = preg_replace("/(^|[\"'\s(])(www\.[^\"'\s()]+)/i", "\\1\\2", $str); - $str = preg_replace("/[0-9a-z_-]+@[a-z0-9._-]{4,}/i", "\\0", $str); - $str = str_replace(array("\t_nbsp_\t", "\t_lt_\t", "\t_gt_\t"), array(" ", "<", ">"), $str); + $str = str_replace(array("<", ">", "&", """, " ", "'"), array("\t_lt_\t", "\t_gt_\t", "&", "\"", "\t_nbsp_\t", "'"), $str); + //$str = preg_replace("`(?:(?:(?:href|src)\s*=\s*(?:\"|'|)){0})((http|https|ftp|telnet|news|mms)://[^\"'\s()]+)`", "\\1", $str); + $str = preg_replace("/([^(href=\"?'?)|(src=\"?'?)]|\(|^)((http|https|ftp|telnet|news|mms):\/\/[a-zA-Z0-9\.-]+\.[가-힣\xA1-\xFEa-zA-Z0-9\.:&#=_\?\/~\+%@;\-\|\,\(\)]+)/i", "\\1\\2", $str); + $str = preg_replace("/(^|[\"'\s(])(www\.[^\"'\s()]+)/i", "\\1\\2", $str); + $str = preg_replace("/[0-9a-z_-]+@[a-z0-9._-]{4,}/i", "\\0", $str); + $str = str_replace(array("\t_nbsp_\t", "\t_lt_\t", "\t_gt_\t", "'"), array(" ", "<", ">", "'"), $str); /* // 속도 향상 031011 @@ -483,7 +484,7 @@ function search_font($stx, $str) // 제목을 변환 function conv_subject($subject, $len, $suffix='') { - return cut_str(get_text($subject), $len, $suffix); + return get_text(cut_str($subject, $len, $suffix)); } // 내용을 변환 @@ -528,7 +529,6 @@ function conv_content($content, $html, $filter=true) $content = str_replace("\n ", "\n ", $content); $content = get_text($content, 1); - $content = url_auto_link($content); } diff --git a/lib/shop.lib.php b/lib/shop.lib.php index 044776ce1..178d015d3 100644 --- a/lib/shop.lib.php +++ b/lib/shop.lib.php @@ -2138,12 +2138,38 @@ function cart_item_clean() { global $g5, $default; + // 장바구니 보관일 $keep_term = $default['de_cart_keep_term']; if(!$keep_term) $keep_term = 15; // 기본값 15일 - $beforetime = G5_SERVER_TIME - (86400 * $keep_term); - sql_query(" delete from {$g5['g5_shop_cart_table']} where ct_status = '쇼핑' and UNIX_TIMESTAMP(ct_time) < '$beforetime' "); + // ct_select_time이 기준시간 이상 경과된 경우 변경 + if(defined('G5_CART_STOCK_LIMIT')) + $cart_stock_limit = G5_CART_STOCK_LIMIT; + else + $cart_stock_limit = 3; + + $stocktime = 0; + if($cart_stock_limit > 0) { + if($cart_stock_limit > $keep_term * 24) + $cart_stock_limit = $keep_term * 24; + + $stocktime = G5_SERVER_TIME - (3600 * $cart_stock_limit); + $sql = " update {$g5['g5_shop_cart_table']} + set ct_select = '0' + where ct_select = '1' + and ct_status = '쇼핑' + and UNIX_TIMESTAMP(ct_select_time) < '$stocktime' "; + sql_query($sql); + } + + // 설정 시간이상 경과된 상품 삭제 + $statustime = G5_SERVER_TIME - (86400 * $keep_term); + + $sql = " delete from {$g5['g5_shop_cart_table']} + where ct_status = '쇼핑' + and UNIX_TIMESTAMP(ct_time) < '$statustime' "; + sql_query($sql); } //============================================================================== diff --git a/mobile/content.php b/mobile/content.php index 4ca181961..c789834b8 100644 --- a/mobile/content.php +++ b/mobile/content.php @@ -10,13 +10,13 @@ if (!$co['co_id']) $g5['title'] = $co['co_subject']; include_once('./_head.php'); -$str = conv_content($co['co_content'], $co['co_html'], $co['co_tag_filter_use']); +$co_content = $co['co_mobile_content'] ? $co['co_mobile_content'] : $co['co_content']; +$str = conv_content($co_content, $co['co_html'], $co['co_tag_filter_use']); // $src 를 $dst 로 변환 unset($src); unset($dst); $src[] = "/{{쇼핑몰명}}|{{홈페이지제목}}/"; -//$dst[] = $default[de_subject]; $dst[] = $config['cf_title']; $src[] = "/{{회사명}}|{{상호}}/"; $dst[] = $default['de_admin_company_name']; @@ -44,21 +44,20 @@ $src[] = "/{{정보관리책임자e-mail}}|{{정보책임자e-mail}}/i"; $dst[] = $default['de_admin_info_email']; $str = preg_replace($src, $dst, $str); -?> - -

-
-

-
+// 스킨경로 +if(trim($co['co_mobile_skin']) == '') + $co['co_mobile_skin'] = 'basic'; -
- -
+$content_skin_path = G5_MOBILE_PATH .'/'.G5_SKIN_DIR.'/content/'.$co['co_mobile_skin']; +$content_skin_url = G5_MOBILE_URL .'/'.G5_SKIN_DIR.'/content/'.$co['co_mobile_skin']; +$skin_file = $content_skin_path.'/content.skin.php'; -
- +if(is_file($skin_file)) { + include($skin_file); +} else { + echo '

'.str_replace(G5_PATH.'/', '', $skin_file).'이 존재하지 않습니다.

'; +} - diff --git a/mobile/shop/orderform.php b/mobile/shop/orderform.php index 77f4ed9ce..3ac4b333a 100644 --- a/mobile/shop/orderform.php +++ b/mobile/shop/orderform.php @@ -1130,6 +1130,13 @@ var temp_point = 0; function pay_approval() { + // 재고체크 + var stock_msg = order_stock_check(); + if(stock_msg != "") { + alert(stock_msg); + return false; + } + var f = document.sm_form; var pf = document.forderform; diff --git a/mobile/shop/orderformupdate.php b/mobile/shop/orderformupdate.php index 478b23241..4a9d8ed98 100644 --- a/mobile/shop/orderformupdate.php +++ b/mobile/shop/orderformupdate.php @@ -413,8 +413,26 @@ if($default['de_tax_flag_use']) { $od_free_mny = (int)$_POST['comm_free_mny']; } -$od_pg = $default['de_pg_service']; -$od_email = get_email_address($od_email); +$od_pg = $default['de_pg_service']; +$od_email = get_email_address($od_email); +$od_name = clean_xss_tags($od_name); +$od_tel = clean_xss_tags($od_tel); +$od_hp = clean_xss_tags($od_hp); +$od_zip1 = preg_replace('/[^0-9]/', '', $od_zip1); +$od_zip2 = preg_replace('/[^0-9]/', '', $od_zip2); +$od_addr1 = clean_xss_tags($od_addr1); +$od_addr2 = clean_xss_tags($od_addr2); +$od_addr3 = clean_xss_tags($od_addr3); +$od_addr_jibeon = preg_match("/^(N|R)$/", $od_addr_jibeon) ? $od_addr_jibeon : ''; +$od_b_name = clean_xss_tags($od_b_name); +$od_b_tel = clean_xss_tags($od_b_tel); +$od_b_hp = clean_xss_tags($od_b_hp); +$od_b_addr1 = clean_xss_tags($od_b_addr1); +$od_b_addr2 = clean_xss_tags($od_b_addr2); +$od_b_addr3 = clean_xss_tags($od_b_addr3); +$od_b_addr_jibeon = preg_match("/^(N|R)$/", $od_b_addr_jibeon) ? $od_b_addr_jibeon : ''; +$od_memo = clean_xss_tags($od_memo); +$od_deposit_name = clean_xss_tags($od_deposit_name); // 주문서에 입력 $sql = " insert {$g5['g5_shop_order_table']} diff --git a/mobile/skin/content/basic/content.skin.php b/mobile/skin/content/basic/content.skin.php new file mode 100644 index 000000000..79d47d932 --- /dev/null +++ b/mobile/skin/content/basic/content.skin.php @@ -0,0 +1,18 @@ +', 0); + +?> + +
+
+

+
+ +
+ +
+ +
\ No newline at end of file diff --git a/mobile/skin/content/basic/style.css b/mobile/skin/content/basic/style.css new file mode 100644 index 000000000..638229597 --- /dev/null +++ b/mobile/skin/content/basic/style.css @@ -0,0 +1,8 @@ +@charset "utf-8"; + +/* 내용관리 */ +#ctt {margin:10px 0;padding:10px;border-top:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9} +.ctt_admin {margin:0 5px;text-align:right} +#ctt header h1 {position:absolute;font-size:0;line-height:0;overflow:hidden} +#ctt_con {padding:10px 0} +.ctt_img {text-align:center} \ No newline at end of file diff --git a/mobile/skin/latest/basic/latest.skin.php b/mobile/skin/latest/basic/latest.skin.php index 89ac1b4b8..6a2e4e9c2 100644 --- a/mobile/skin/latest/basic/latest.skin.php +++ b/mobile/skin/latest/basic/latest.skin.php @@ -6,7 +6,7 @@ add_stylesheet('', ?>
- +