Merge branch 'gnuboard:master' into master
This commit is contained in:
BIN
lib/Excel/itemexcel.xls
Normal file
BIN
lib/Excel/itemexcel.xls
Normal file
Binary file not shown.
@ -850,12 +850,14 @@ function get_admin($admin='super', $fields='*')
|
||||
$is = true;
|
||||
}
|
||||
|
||||
if (($is && !$mb['mb_id']) || $admin == 'group') {
|
||||
// if (($is && !$mb['mb_id']) || $admin == 'group') {
|
||||
if (($is && !isset($mb['mb_id'])) || $admin == 'group') {
|
||||
$mb = sql_fetch("select {$fields} from {$g5['member_table']} where mb_id in ('{$group['gr_admin']}') limit 1 ");
|
||||
$is = true;
|
||||
}
|
||||
|
||||
if (($is && !$mb['mb_id']) || $admin == 'super') {
|
||||
// if (($is && !$mb['mb_id']) || $admin == 'super') {
|
||||
if (($is && !isset($mb['mb_id'])) || $admin == 'super') {
|
||||
$mb = sql_fetch("select {$fields} from {$g5['member_table']} where mb_id in ('{$config['cf_admin']}') limit 1 ");
|
||||
}
|
||||
|
||||
@ -1525,7 +1527,7 @@ function sql_connect($host, $user, $pass, $db=G5_MYSQL_DB)
|
||||
global $g5;
|
||||
|
||||
if(function_exists('mysqli_connect') && G5_MYSQLI_USE) {
|
||||
$link = mysqli_connect($host, $user, $pass, $db);
|
||||
$link = @mysqli_connect($host, $user, $pass, $db) or die('MySQL Host, User, Password, DB 정보에 오류가 있습니다.');
|
||||
|
||||
// 연결 오류 발생 시 스크립트 종료
|
||||
if (mysqli_connect_errno()) {
|
||||
@ -2217,7 +2219,10 @@ function get_checked($field, $value)
|
||||
|
||||
function is_mobile()
|
||||
{
|
||||
return preg_match('/'.G5_MOBILE_AGENT.'/i', $_SERVER['HTTP_USER_AGENT']);
|
||||
if (isset($_SERVER['HTTP_USER_AGENT']))
|
||||
return preg_match('/'.G5_MOBILE_AGENT.'/i', $_SERVER['HTTP_USER_AGENT']);
|
||||
else
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
@ -2344,8 +2349,9 @@ function delete_editor_thumbnail($contents)
|
||||
for($i=0; $i<count($matchs[1]); $i++) {
|
||||
// 이미지 path 구함
|
||||
$imgurl = @parse_url($matchs[1][$i]);
|
||||
$srcfile = dirname(G5_PATH).$imgurl['path'];
|
||||
if(! preg_match('/(\.jpe?g|\.gif|\.png)$/i', $srcfile)) continue;
|
||||
// $srcfile = dirname(G5_PATH).$imgurl['path'];
|
||||
$srcfile = (G5_PATH).$imgurl['path'];
|
||||
if(!preg_match('/(\.jpe?g|\.gif|\.png|\.webp)$/i', $srcfile)) continue;
|
||||
$filename = preg_replace("/\.[^\.]+$/i", "", basename($srcfile));
|
||||
$filepath = dirname($srcfile);
|
||||
$files = glob($filepath.'/thumb-'.$filename.'*');
|
||||
@ -2742,6 +2748,41 @@ function insert_cert_history($mb_id, $company, $method)
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
// 본인확인 변경내역 기록
|
||||
function insert_member_cert_history($mb_id, $name, $hp, $birth, $type)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
// 본인인증 내역 테이블 정보가 dbconfig에 없으면 소셜 테이블 정의
|
||||
if( !isset($g5['member_cert_history']) ){
|
||||
$g5['member_cert_history_table'] = G5_TABLE_PREFIX.'member_cert_history';
|
||||
}
|
||||
|
||||
// 멤버 본인인증 정보 변경 내역 테이블 없을 경우 생성
|
||||
if(isset($g5['member_cert_history_table']) && !sql_query(" DESC {$g5['member_cert_history_table']} ", false)) {
|
||||
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['member_cert_history_table']}` (
|
||||
`ch_id` int(11) NOT NULL auto_increment,
|
||||
`mb_id` varchar(20) NOT NULL DEFAULT '',
|
||||
`ch_name` varchar(255) NOT NULL DEFAULT '',
|
||||
`ch_hp` varchar(255) NOT NULL DEFAULT '',
|
||||
`ch_birth` varchar(255) NOT NULL DEFAULT '',
|
||||
`ch_type` varchar(20) NOT NULL DEFAULT '',
|
||||
`ch_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`ch_id`),
|
||||
KEY `mb_id` (`mb_id`)
|
||||
) ", true);
|
||||
}
|
||||
|
||||
$sql = " insert into {$g5['member_cert_history_table']}
|
||||
set mb_id = '{$mb_id}',
|
||||
ch_name = '{$name}',
|
||||
ch_hp = '{$hp}',
|
||||
ch_birth = '{$birth}',
|
||||
ch_type = '{$type}',
|
||||
ch_datetime = '".G5_TIME_YMD." ".G5_TIME_HIS."'";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
// 인증시도회수 체크
|
||||
function certify_count_check($mb_id, $type)
|
||||
{
|
||||
@ -2766,6 +2807,9 @@ function certify_count_check($mb_id, $type)
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
switch($type) {
|
||||
case 'simple' :
|
||||
$cert = '간편인증';
|
||||
break;
|
||||
case 'hp':
|
||||
$cert = '휴대폰';
|
||||
break;
|
||||
@ -2889,6 +2933,21 @@ function module_exec_check($exe, $type)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'pp_cli':
|
||||
exec($exe.' -h 2>&1', $out, $return_var);
|
||||
|
||||
if($return_var == 139) {
|
||||
$isbinary = false;
|
||||
break;
|
||||
}
|
||||
|
||||
for($i=0; $i<count($out); $i++) {
|
||||
if(strpos($out[$i], 'CLIENT') !== false) {
|
||||
$search = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'okname':
|
||||
exec($exe.' D 2>&1', $out, $return_var);
|
||||
|
||||
@ -3001,6 +3060,9 @@ function get_search_string($stx)
|
||||
// XSS 관련 태그 제거
|
||||
function clean_xss_tags($str, $check_entities=0, $is_remove_tags=0, $cur_str_len=0)
|
||||
{
|
||||
// tab('\t'), formfeed('\f'), vertical tab('\v'), newline('\n'), carriage return('\r') 를 제거한다.
|
||||
$str = preg_replace("#[\t\f\v\n\r]#", '', $str);
|
||||
|
||||
if( $is_remove_tags ){
|
||||
$str = strip_tags($str);
|
||||
}
|
||||
@ -3107,7 +3169,7 @@ function member_delete($mb_id)
|
||||
}
|
||||
|
||||
// 회원자료는 정보만 없앤 후 아이디는 보관하여 다른 사람이 사용하지 못하도록 함 : 061025
|
||||
$sql = " update {$g5['member_table']} set mb_password = '', mb_level = 1, mb_email = '', mb_homepage = '', mb_tel = '', mb_hp = '', mb_zip1 = '', mb_zip2 = '', mb_addr1 = '', mb_addr2 = '', mb_birth = '', mb_sex = '', mb_signature = '', mb_memo = '".date('Ymd', G5_SERVER_TIME)." 삭제함\n".sql_real_escape_string($mb['mb_memo'])."' where mb_id = '{$mb_id}' ";
|
||||
$sql = " update {$g5['member_table']} set mb_password = '', mb_level = 1, mb_email = '', mb_homepage = '', mb_tel = '', mb_hp = '', mb_zip1 = '', mb_zip2 = '', mb_addr1 = '', mb_addr2 = '', mb_addr3 = '', mb_point = 0, mb_profile = '', mb_birth = '', mb_sex = '', mb_signature = '', mb_memo = '".date('Ymd', G5_SERVER_TIME)." 삭제함\n".sql_real_escape_string($mb['mb_memo'])."', mb_certify = '', mb_adult = 0, mb_dupinfo = '' where mb_id = '{$mb_id}' ";
|
||||
|
||||
sql_query($sql);
|
||||
|
||||
@ -3262,7 +3324,13 @@ function check_url_host($url, $msg='', $return_url=G5_URL, $is_redirect=false)
|
||||
if(!$msg)
|
||||
$msg = 'url에 타 도메인을 지정할 수 없습니다.';
|
||||
|
||||
$p = @parse_url($url);
|
||||
// KVE-2021-1277 Open Redirect 취약점 해결
|
||||
if (preg_match('#\\\0#', $url)) {
|
||||
alert('url 에 올바르지 않은 값이 포함되어 있습니다.');
|
||||
}
|
||||
|
||||
$url = urldecode($url);
|
||||
$p = @parse_url(trim($url));
|
||||
$host = preg_replace('/:[0-9]+$/', '', $_SERVER['HTTP_HOST']);
|
||||
$is_host_check = false;
|
||||
|
||||
@ -3282,10 +3350,10 @@ function check_url_host($url, $msg='', $return_url=G5_URL, $is_redirect=false)
|
||||
}
|
||||
}
|
||||
|
||||
if(stripos($url, 'http:') !== false) {
|
||||
if(!isset($p['scheme']) || !$p['scheme'] || !isset($p['host']) || !$p['host'])
|
||||
alert('url 정보가 올바르지 않습니다.', $return_url);
|
||||
}
|
||||
// if(stripos($url, 'http:') !== false) {
|
||||
// if(!isset($p['scheme']) || !$p['scheme'] || !isset($p['host']) || !$p['host'])
|
||||
// alert('url 정보가 올바르지 않습니다.', $return_url);
|
||||
// }
|
||||
|
||||
//php 5.6.29 이하 버전에서는 parse_url 버그가 존재함
|
||||
//php 7.0.1 ~ 7.0.5 버전에서는 parse_url 버그가 존재함
|
||||
|
||||
13
lib/etc.lib.php
Normal file
13
lib/etc.lib.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit;
|
||||
|
||||
// 로그를 파일에 쓴다
|
||||
function write_log($file, $log) {
|
||||
$fp = fopen($file, "a+");
|
||||
ob_start();
|
||||
print_r($log);
|
||||
$msg = ob_get_contents();
|
||||
ob_end_clean();
|
||||
fwrite($fp, $msg);
|
||||
fclose($fp);
|
||||
}
|
||||
@ -294,7 +294,7 @@ function get_thumbnail_find_cache($bo_table, $wr_id, $wr_key){
|
||||
return get_write($write_table, $wr_id, true);
|
||||
}
|
||||
|
||||
return get_board_file_db($bo_table, $wr_id, 'bf_file, bf_content', "and bf_type between '1' and '3'", true);
|
||||
return get_board_file_db($bo_table, $wr_id, 'bf_file, bf_content', "and bf_type in (1, 2, 3, 18) ", true);
|
||||
}
|
||||
|
||||
function get_write_table_name($bo_table){
|
||||
@ -457,6 +457,20 @@ function get_board_sfl_select_options($sfl){
|
||||
return run_replace('get_board_sfl_select_options', $str, $sfl);
|
||||
}
|
||||
|
||||
function get_qa_sfl_select_options($sfl) {
|
||||
|
||||
global $is_admin;
|
||||
|
||||
$str = '';
|
||||
$str .= '<option value="qa_subject" '.get_selected($sfl, 'qa_subject', true).'>제목</option>';
|
||||
$str .= '<option value="qa_content" '.get_selected($sfl, 'qa_content').'>내용</option>';
|
||||
$str .= '<option value="qa_name" '.get_selected($sfl, 'qa_name').'>글쓴이</option>';
|
||||
if ($is_admin)
|
||||
$str .= '<option value="mb_id" '.get_selected($sfl, 'mb_id').'>회원아이디</option>';
|
||||
|
||||
return run_replace('get_qa_sfl_select_options', $str, $sfl);
|
||||
}
|
||||
|
||||
// 읽지 않은 메모 갯수 반환
|
||||
function get_memo_not_read($mb_id, $add_where='')
|
||||
{
|
||||
|
||||
559
lib/iteminfo.lib.php
Normal file
559
lib/iteminfo.lib.php
Normal file
@ -0,0 +1,559 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit;
|
||||
|
||||
// 품목별 재화등에 관한 상품요약 정보
|
||||
$item_info = array(
|
||||
"wear"=>array(
|
||||
"title"=>"의류",
|
||||
"article"=>array(
|
||||
"material"=>array("제품소재", "섬유의 조성 또는 혼용률을 백분율로 표시, 기능성인 경우 성적서 또는 허가서"),
|
||||
"color"=>array("색상", ""),
|
||||
"size"=>array("치수", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"caution"=>array("세탁방법 및 취급시 주의사항", ""),
|
||||
"manufacturing_ym"=>array("제조연월", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"shoes"=>array(
|
||||
"title"=>"구두/신발",
|
||||
"article"=>array(
|
||||
"material"=>array("제품소재", "운동화인 경우에는 겉감, 안감을 구분하여 표시"),
|
||||
"color"=>array("색상", ""),
|
||||
"size"=>array("치수-발길이", "해외사이즈 표기 시 국내사이즈 병행 표기 (mm)"),
|
||||
"height"=>array("치수-굽높이", "굽 재료를 사용하는 여성화에 한함 (cm)"),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", ""),
|
||||
"caution"=>array("취급시 주의사항", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"bag"=>array(
|
||||
"title"=>"가방",
|
||||
"article"=>array(
|
||||
"kind"=>array("종류", ""),
|
||||
"material"=>array("소재", ""),
|
||||
"color"=>array("색상", ""),
|
||||
"size"=>array("크기", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", ""),
|
||||
"caution"=>array("취급시 주의사항", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"fashion"=>array(
|
||||
"title"=>"패션잡화(모자/벨트/액세서리)",
|
||||
"article"=>array(
|
||||
"kind"=>array("종류", ""),
|
||||
"material"=>array("소재", ""),
|
||||
"size"=>array("치수", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", ""),
|
||||
"caution"=>array("취급시 주의사항", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"bedding"=>array(
|
||||
"title"=>"침구류/커튼",
|
||||
"article"=>array(
|
||||
"material"=>array("제품소재", "(섬유의 조성 또는 혼용률을 백분율로 표시) 충전재를 사용한 제품은 충전재를 함께 표기"),
|
||||
"color"=>array("색상", ""),
|
||||
"size"=>array("치수", ""),
|
||||
"component" =>array("제품구성", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", ""),
|
||||
"caution"=>array("세탁방법 및 취급시 주의사항", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"furniture"=>array(
|
||||
"title"=>"가구(침대/소파/싱크대/DIY제품)",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"certification"=>array("KC 인증 필 유무", "(품질경영 및 공산품안전관리법 상 안전·품질표시대상공산품에 한함)"),
|
||||
"color"=>array("색상", ""),
|
||||
"component" =>array("구성품", ""),
|
||||
"material"=>array("주요소재", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)<br />구성품 별 제조자가 다른 경우 각 구성품의 제조자, 수입자"),
|
||||
"madein"=>array("제조국", "구성품 별 제조국이 다른 경우 각 구성품의 제조국"),
|
||||
"size"=>array("크기", ""),
|
||||
"delivery"=>array("배송·설치비용", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"image_appliances"=>array(
|
||||
"title"=>"영상가전 (TV류)",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"certification"=>array("전기용품 안전인증 필 유무", "전기용품안전관리법 상 안전인증대상전기용품, 자율안전확인대상전기용품, 공급자적합성확인대상전기용품에 한함"),
|
||||
"rated_voltage"=>array("정격전압", "에너지이용합리화법 상 의무대상상품에 한함"),
|
||||
"power_consumption"=>array("소비전력", "에너지이용합리화법 상 의무대상상품에 한함"),
|
||||
"energy_efficiency"=>array("에너지효율등급", "에너지이용합리화법 상 의무대상상품에 한함"),
|
||||
"released_date"=>array("동일모델의 출시년월", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", "구성품 별 제조국이 다른 경우 각 구성품의 제조국"),
|
||||
"size"=>array("크기", "형태포함"),
|
||||
"display_specification"=>array("화면사양", "크기, 해상도, 화면비율 등"),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"home_appliances"=>array(
|
||||
"title"=>"가정용전기제품(냉장고/세탁기/식기세척기/전자레인지)",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"certification"=>array("전기용품 안전인증 필 유무", "전기용품안전관리법 상 안전인증대상전기용품, 자율안전확인대상전기용품, 공급자적합성확인대상전기용품에 한함"),
|
||||
"rated_voltage"=>array("정격전압", "에너지이용합리화법 상 의무대상상품에 한함"),
|
||||
"power_consumption"=>array("소비전력", "에너지이용합리화법 상 의무대상상품에 한함"),
|
||||
"energy_efficiency"=>array("에너지효율등급", "에너지이용합리화법 상 의무대상상품에 한함"),
|
||||
"released_date"=>array("동일모델의 출시년월", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", ""),
|
||||
"size"=>array("크기", "형태포함"),
|
||||
"display_specification"=>array("화면사양", "크기, 해상도, 화면비율 등"),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"season_appliances"=>array(
|
||||
"title"=>"계절가전(에어컨/온풍기)",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"certification"=>array("전기용품 안전인증 필 유무", "전기용품안전관리법 상 안전인증대상전기용품, 자율안전확인대상전기용품, 공급자적합성확인대상전기용품에 한함"),
|
||||
"rated_voltage"=>array("정격전압", "에너지이용합리화법 상 의무대상상품에 한함"),
|
||||
"power_consumption"=>array("소비전력", "에너지이용합리화법 상 의무대상상품에 한함"),
|
||||
"energy_efficiency"=>array("에너지효율등급", "에너지이용합리화법 상 의무대상상품에 한함"),
|
||||
"released_date"=>array("동일모델의 출시년월", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", ""),
|
||||
"size"=>array("크기", "형태 및 실외기 포함"),
|
||||
"area"=>array("냉난방면적", ""),
|
||||
"installation_costs"=>array("추가설치비용", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"office_appliances"=>array(
|
||||
"title"=>"사무용기기(컴퓨터/노트북/프린터)",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"certification"=>array("KCC 인증 필 유무", "전파법 상 인증대상상품에 한함, MIC 인증 필 혼용 가능"),
|
||||
"rated_voltage"=>array("정격전압", "에너지이용합리화법 상 의무대상상품에 한함"),
|
||||
"power_consumption"=>array("소비전력", "에너지이용합리화법 상 의무대상상품에 한함"),
|
||||
"energy_efficiency"=>array("에너지효율등급", "에너지이용합리화법 상 의무대상상품에 한함"),
|
||||
"released_date"=>array("동일모델의 출시년월", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", "구성품 별 제조국이 다른 경우 각 구성품의 제조국"),
|
||||
"size"=>array("크기", ""),
|
||||
"weight"=>array("무게", "무게는 노트북에 한함"),
|
||||
"specification"=>array("주요사양", "컴퓨터와 노트북의 경우 성능, 용량, 운영체제 포함여부 등 / 프린터의 경우 인쇄 속도 등"),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"optics_appliances"=>array(
|
||||
"title"=>"광학기기(디지털카메라/캠코더)",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"certification"=>array("KCC 인증 필 유무", "전파법 상 인증대상상품에 한함, MIC 인증 필 혼용 가능"),
|
||||
"released_date"=>array("동일모델의 출시년월", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", ""),
|
||||
"size"=>array("크기", ""),
|
||||
"weight"=>array("무게", ""),
|
||||
"specification"=>array("주요사양", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"microelectronics"=>array(
|
||||
"title"=>"소형전자(MP3/전자사전등)",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"certification"=>array("KCC 인증 필 유무", "전파법 상 인증대상상품에 한함, MIC 인증 필 혼용 가능"),
|
||||
"rated_voltage"=>array("정격전압", ""),
|
||||
"power_consumption"=>array("소비전력", ""),
|
||||
"released_date"=>array("동일모델의 출시년월", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", ""),
|
||||
"size"=>array("크기", ""),
|
||||
"weight"=>array("무게", ""),
|
||||
"specification"=>array("주요사양", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"mobile"=>array(
|
||||
"title"=>"휴대폰",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"certification"=>array("KCC 인증 필 유무", "전파법 상 인증대상상품에 한함, MIC 인증 필 혼용 가능"),
|
||||
"released_date"=>array("동일모델의 출시년월", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", ""),
|
||||
"size"=>array("크기", ""),
|
||||
"weight"=>array("무게", ""),
|
||||
"telecom"=>array("이동통신사", ""),
|
||||
"join_process"=>array("가입절차", ""),
|
||||
"extra_burden"=>array("소비자의 추가적인 부담사항 ", "가입비, 유심카드 구입비 등 추가로 부담하여야 할 금액, 부가서비스, 의무사용기간, 위약금 등"),
|
||||
"specification"=>array("주요사양", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"navigation"=>array(
|
||||
"title"=>"네비게이션",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"certification"=>array("KCC 인증 필 유무", "전파법 상 인증대상상품에 한함, MIC 인증 필 혼용 가능"),
|
||||
"rated_voltage"=>array("정격전압", ""),
|
||||
"power_consumption"=>array("소비전력", ""),
|
||||
"released_date"=>array("동일모델의 출시년월", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", ""),
|
||||
"size"=>array("크기", ""),
|
||||
"weight"=>array("무게", ""),
|
||||
"specification"=>array("주요사양", ""),
|
||||
"update_cost"=>array("맵 업데이트 비용", ""),
|
||||
"freecost_period"=>array("무상기간", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"car"=>array(
|
||||
"title"=>"자동차용품(자동차부품/기타자동차용품)",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"released_date"=>array("동일모델의 출시년월", ""),
|
||||
"certification"=>array("자동차부품 자기인증 유무 ", "자동차 관리법 상 인증 대상 자동차 부품에 한함"),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", "구성품 별 제조국이 다른 경우 각 구성품의 제조국"),
|
||||
"size"=>array("크기", ""),
|
||||
"apply_model"=>array("적용차종", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"medical"=>array(
|
||||
"title"=>"의료기기",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"license_number"=>array("의료기기법상 허가·신고 번호", "허가·신고 대상 의료기기에 한함"),
|
||||
"advertising"=>array("광고사전심의필 유무", ""),
|
||||
"certification"=>array("전기용품안전관리법상 KC 인증 필 유무 ", "안전인증 또는 자율안전확인 대상 전기용품에 한함"),
|
||||
"rated_voltage"=>array("정격전압", "전기용품에 한함"),
|
||||
"power_consumption"=>array("소비전력", "전기용품에 한함"),
|
||||
"released_date"=>array("동일모델의 출시년월", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", ""),
|
||||
"appliances_purpose"=>array("제품의 사용목적", ""),
|
||||
"appliances_usage"=>array("제품의 사용목적", ""),
|
||||
"display_specification"=>array("화면사양", "(크기, 해상도, 화면비율 등)"),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"kitchenware"=>array(
|
||||
"title"=>"주방용품",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"material"=>array("재질", ""),
|
||||
"component"=>array("구성품", ""),
|
||||
"size"=>array("크기", ""),
|
||||
"released_date"=>array("동일모델의 출시년월", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", ""),
|
||||
"import_declaration"=>array("식품위생법에 따른 수입 신고", "식품위생법에 따른 수입 기구·용기의 경우 \"식품위생법에 따른 수입신고를 필함\"의 문구"),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"cosmetics"=>array(
|
||||
"title"=>"화장품",
|
||||
"article"=>array(
|
||||
"capacity"=>array("용량 또는 중량", ""),
|
||||
"specification"=>array("제품 주요사양", "피부타입, 색상(호, 번) 등"),
|
||||
"expiration_date"=>array("사용기한 또는 개봉 후 사용기간", "개봉 후 사용기간을 기재할 경우에는 제조연월일을 병행표기"),
|
||||
"usage"=>array("사용방법", ""),
|
||||
"maker"=>array("제조자", ""),
|
||||
"distributor"=>array("제조판매업자", ""),
|
||||
"madein"=>array("제조국", ""),
|
||||
"mainingredient"=>array("주요성분", "유기농 화장품의 경우 유기농 원료 함량 포함"),
|
||||
"certification"=>array("식품의약품안전청 심사 필 유무", "기능성 화장품의 경우 화장품법에 따른 식품의약품안전청 심사 필 유무 (미백, 주름개선, 자외선차단 등)"),
|
||||
"caution"=>array("사용할 때 주의사항", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"jewelry"=>array(
|
||||
"title"=>"귀금속/보석/시계류",
|
||||
"article"=>array(
|
||||
"material"=>array("소재", ""),
|
||||
"purity"=>array("순도", ""),
|
||||
"band"=>array("밴드재질", "시계의 경우"),
|
||||
"weight"=>array("중량", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", "원산지와 가공지 등이 다를 경우 함께 표기"),
|
||||
"size"=>array("치수", ""),
|
||||
"caution"=>array("착용 시 주의사항", ""),
|
||||
"specification"=>array("주요사양", "귀금속, 보석류는 등급, 시계는 기능, 방수 등"),
|
||||
"provide_warranty"=>array("보증서 제공여부", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("A/S 책임자와 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"food"=>array(
|
||||
"title"=>"식품(농수산물)",
|
||||
"article"=>array(
|
||||
"weight"=>array("포장단위별 용량(중량)", ""),
|
||||
"quantity"=>array("포장단위별 수량", ""),
|
||||
"size"=>array("포장단위별 크기", ""),
|
||||
"producer"=>array("생산자", "수입품의 경우 수입자를 함께 표기"),
|
||||
"origin"=>array("원산지", "농수산물의 원산지 표시에 관한 법률에 따른 원산지"),
|
||||
"manufacturing_ymd"=>array("제조연월일", "포장일 또는 생산연도"),
|
||||
"expiration_date"=>array("유통기한 또는 품질유지기한", ""),
|
||||
"law_content"=>array("관련법상 표시사항", "농산물 - 농산물품질관리법상 유전자변형농산물 표시, 지리적표시<br />축산물 - 축산법에 따른 등급 표시, 쇠고기의 경우 이력관리에 따른 표시 유무<br />수산물 - 수산물품질관리법상 유전자변형수산물 표시, 지리적표시<br />수입식품에 해당하는 경우 \"식품위생법에 따른 수입신고를 필함\"의 문구"),
|
||||
"product_composition"=>array("상품구성", ""),
|
||||
"keep"=>array("보관방법 또는 취급방법", ""),
|
||||
"as"=>array("소비자상담 관련 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"general_food"=>array(
|
||||
"title"=>"가공식품",
|
||||
"article"=>array(
|
||||
"food_type"=>array("식품의 유형", ""),
|
||||
"producer"=>array("생산자", ""),
|
||||
"location"=>array("소재지", "수입품의 경우 수입자를 함께 표기"),
|
||||
"manufacturing_ymd"=>array("제조연월일", ""),
|
||||
"expiration_date"=>array("유통기한 또는 품질유지기한", ""),
|
||||
"weight"=>array("포장단위별 용량(중량)", ""),
|
||||
"quantity"=>array("포장단위별 수량", ""),
|
||||
"ingredients"=>array("원재료명 및 함량", "농수산물의 원산지 표시에 관한 법률에 따른 원산지 표시 포함"),
|
||||
"nutrition_component"=>array("영양성분", "식품위생법에 따른 영양성분 표시대상 식품에 한함"),
|
||||
"genetically_modified"=>array("유전자재조합식품에 해당하는 경우의 표시", ""),
|
||||
"baby_food"=>array("영유아식 또는 체중조절식품 등에 해당하는 경우 표시광고 사전심의필", ""),
|
||||
"imported_food"=>array("수입식품에 해당하는 경우 “식품위생법에 따른 수입신고를 필함”의 문구", ""),
|
||||
"as"=>array("소비자상담 관련 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"diet_food"=>array(
|
||||
"title"=>"건강기능식품",
|
||||
"article"=>array(
|
||||
"food_type"=>array("식품의 유형", ""),
|
||||
"producer"=>array("생산자", ""),
|
||||
"location"=>array("소재지", "수입품의 경우 수입자를 함께 표기"),
|
||||
"manufacturing_ymd"=>array("제조연월일", ""),
|
||||
"expiration_date"=>array("유통기한 또는 품질유지기한", ""),
|
||||
"waight"=>array("포장단위별 용량(중량)", ""),
|
||||
"quantity"=>array("포장단위별 수량", ""),
|
||||
"ingredients"=>array("원재료명 및 함량", "농수산물의 원산지 표시에 관한 법률에 따른 원산지 표시 포함"),
|
||||
"nutrition"=>array("영양정보", ""),
|
||||
"specification"=>array("기능정보", ""),
|
||||
"intake"=>array("섭취량, 섭취방법 및 섭취 시 주의사항", ""),
|
||||
"disease"=>array("질병의 예방 및 치료를 위한 의약품이 아니라는 내용의 표현", ""),
|
||||
"genetically_modified"=>array("유전자재조합식품에 해당하는 경우의 표시", ""),
|
||||
"display_ad"=>array("표시광고 사전심의필", ""),
|
||||
"imported_food"=>array("수입식품에 해당하는 경우 \"건강기능식품에 관한 법률에 따른 수입신고를 필함\"의 문구", ""),
|
||||
"as"=>array("소비자상담 관련 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"kids"=>array(
|
||||
"title"=>"영유아용품",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"certification"=>array("KC 인증 필", "품질경영 및 공산품안전관리법 상 안전인증대상 또는 자율안전확인대상 공산품에 한함"),
|
||||
"size"=>array("크기", ""),
|
||||
"weight"=>array("중량", ""),
|
||||
"color"=>array("색상", ""),
|
||||
"material"=>array("재질", "섬유의 경우 혼용률"),
|
||||
"age"=>array("사용연령", ""),
|
||||
"released_date"=>array("동일모델의 출시년월", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", ""),
|
||||
"caution"=>array("취급방법 및 취급시 주의사항, 안전표시 (주의, 경고 등)", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("소비자상담 관련 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"instrument"=>array(
|
||||
"title"=>"악기",
|
||||
"article"=>array(
|
||||
"size"=>array("크기", ""),
|
||||
"color"=>array("색상", ""),
|
||||
"material"=>array("재질", ""),
|
||||
"components"=>array("제품구성", ""),
|
||||
"released_date"=>array("동일모델의 출시년월", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", ""),
|
||||
"detailed_specifications"=>array("상품별 세부 사양", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("소비자상담 관련 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"sports"=>array(
|
||||
"title"=>"스포츠용품",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"size"=>array("크기", ""),
|
||||
"weight"=>array("중량", ""),
|
||||
"color"=>array("색상", ""),
|
||||
"material"=>array("재질", ""),
|
||||
"components"=>array("제품구성", ""),
|
||||
"released_date"=>array("동일모델의 출시년월", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"madein"=>array("제조국", ""),
|
||||
"detailed_specifications"=>array("상품별 세부 사양", ""),
|
||||
"warranty"=>array("품질보증기준", ""),
|
||||
"as"=>array("소비자상담 관련 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"books"=>array(
|
||||
"title"=>"서적",
|
||||
"article"=>array(
|
||||
"product_name"=>array("도서명", ""),
|
||||
"author"=>array("저자", ""),
|
||||
"publisher"=>array("출판사", ""),
|
||||
"size"=>array("크기", "전자책의 경우 파일의 용량"),
|
||||
"pages"=>array("쪽수", "전자책의 경우 제외"),
|
||||
"components"=>array("제품구성", "전집 또는 세트일 경우 낱권 구성, CD 등"),
|
||||
"publish_date"=>array("출간일", ""),
|
||||
"description"=>array("목차 또는 책소개", ""),
|
||||
)
|
||||
),
|
||||
"reserve"=>array(
|
||||
"title"=>"호텔/펜션예약",
|
||||
"article"=>array(
|
||||
"location"=>array("국가 또는 지역명", ""),
|
||||
"lodgment_type"=>array("숙소형태", ""),
|
||||
"grade"=>array("등급", ""),
|
||||
"room_type"=>array("객실타입", ""),
|
||||
"room_capacity"=>array("사용가능인원", ""),
|
||||
"extra_person_charge"=>array("인원 추가시 비용", ""),
|
||||
"facilities"=>array("부대시설", ""),
|
||||
"provided_service"=>array("제공서비스", "조식 등"),
|
||||
"cancellation_policy"=>array("취소규정", "환불 위약금 등"),
|
||||
"booking_contacts"=>array("예약담당 연락처", ""),
|
||||
)
|
||||
),
|
||||
"travel"=>array(
|
||||
"title"=>"여행패키지",
|
||||
"article"=>array(
|
||||
"travel_agency"=>array("여행사", ""),
|
||||
"flight"=>array("이용항공편", ""),
|
||||
"travel_period"=>array("여행기간", ""),
|
||||
"schedule"=>array("일정", ""),
|
||||
"maximum_people"=>array("총예정인원", ""),
|
||||
"minimum_people"=>array("출발가능인원", ""),
|
||||
"accomodation_info"=>array("숙박정보", ""),
|
||||
"details"=>array("포함내역", "식사, 인솔자, 공연관람 등"),
|
||||
"additional_charge"=>array("추가 경비 항목과 금액", "유류할증료, 공항이용료, 관광지 입장료, 안내원수수료, 식사비용, 선택사항 등"),
|
||||
"cancellation_policy"=>array("취소규정", "환불, 위약금 등"),
|
||||
"travel_warnings"=>array("해외여행의 경우 외교통상부가 지정하는 여행경보단계", ""),
|
||||
"booking_contacts"=>array("예약담당 연락처", ""),
|
||||
)
|
||||
),
|
||||
"airline_ticket"=>array(
|
||||
"title"=>"항공권",
|
||||
"article"=>array(
|
||||
"charge_condition"=>array("요금조건", ""),
|
||||
"round_trip"=>array("왕복·편도 여부", ""),
|
||||
"expiration_date"=>array("유효기간", ""),
|
||||
"restriction"=>array("제한사항", "출발일, 귀국일 변경가능 여부 등"),
|
||||
"ticket_delivery_mean"=>array("티켓수령방법", ""),
|
||||
"seat_type"=>array("좌석종류", ""),
|
||||
"additional_charge"=>array("추가 경비 항목과 금액", "유류할증료, 공항이용료 등"),
|
||||
"cancellation_policy"=>array("취소 규정", "환불, 위약금 등"),
|
||||
"booking_contacts"=>array("예약담당 연락처", ""),
|
||||
)
|
||||
),
|
||||
"rent_car"=>array(
|
||||
"title"=>"자동차대여서비스(렌터카)",
|
||||
"article"=>array(
|
||||
"model"=>array("차종", ""),
|
||||
"ownership_transfer"=>array("소유권 이전 조건", "소유권이 이전되는 경우에 한함"),
|
||||
"additional_charge"=>array("추가 선택 시 비용", "자차면책제도, 내비게이션 등"),
|
||||
"fuel_cost"=>array("차량 반환 시 연료대금 정산 방법", ""),
|
||||
"vehicle_breakdown"=>array("차량의 고장·훼손 시 소비자 책임", ""),
|
||||
"cancellation_policy"=>array("예약취소 또는 중도 해약 시 환불 기준", ""),
|
||||
"as"=>array("소비자상담 관련 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"rental_water"=>array(
|
||||
"title"=>"물품대여서비스(정수기,비데,공기청정기 등)",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"transfer_of_ownership"=>array("소유권 이전 조건", "소유권이 이전되는 경우에 한함"),
|
||||
"maintenance"=>array("유지보수 조건", "점검·필터교환 주기, 추가 비용 등"),
|
||||
"consumer_responsibility"=>array("상품의 고장·분실·훼손 시 소비자 책임", ""),
|
||||
"refund"=>array("중도 해약 시 환불 기준", ""),
|
||||
"specification"=>array("제품 사양", "용량, 소비전력 등"),
|
||||
"as"=>array("소비자상담 관련 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"rental_etc"=>array(
|
||||
"title"=>"물품대여서비스(서적,유아용품,행사용품 등)",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"transfer_of_ownership"=>array("소유권 이전 조건", "소유권이 이전되는 경우에 한함"),
|
||||
"consumer_responsibility"=>array("상품의 고장·분실·훼손 시 소비자 책임", ""),
|
||||
"refund"=>array("중도 해약 시 환불 기준", ""),
|
||||
"as"=>array("소비자상담 관련 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"digital_contents"=>array(
|
||||
"title"=>"디지털콘텐츠(음원,게임,인터넷강의 등)",
|
||||
"article"=>array(
|
||||
"producer"=>array("제작자 또는 공급자", ""),
|
||||
"terms_of_use"=>array("이용조건", ""),
|
||||
"use_period"=>array("이용기간", ""),
|
||||
"product_offers"=>array("상품 제공 방식", "CD, 다운로드, 실시간 스트리밍 등"),
|
||||
"minimum_system"=>array("최소 시스템 사양, 필수 소프트웨어", ""),
|
||||
"transfer_of_ownership"=>array("소유권 이전 조건", "소유권이 이전되는 경우에 한함"),
|
||||
"maintenance"=>array("청약철회 또는 계약의 해제·해지에 따른 효과", ""),
|
||||
"as"=>array("소비자상담 관련 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"gift_card"=>array(
|
||||
"title"=>"상품권/쿠폰",
|
||||
"article"=>array(
|
||||
"isseur"=>array("발행자", ""),
|
||||
"expiration_date"=>array("유효기간", ""),
|
||||
"terms_of_use"=>array("이용조건", "유효기간 경과 시 보상 기준, 사용제한품목 및 기간 등"),
|
||||
"use_store"=>array("이용 가능 매장", ""),
|
||||
"refund_policy"=>array("잔액 환급 조건", ""),
|
||||
"as"=>array("소비자상담 관련 전화번호", ""),
|
||||
)
|
||||
),
|
||||
"etc"=>array(
|
||||
"title"=>"기타",
|
||||
"article"=>array(
|
||||
"product_name"=>array("품명", ""),
|
||||
"model_name"=>array("모델명", ""),
|
||||
"certified_by_law"=>array("법에 의한 인증·허가 등을 받았음을 확인할 수 있는 경우 그에 대한 사항", ""),
|
||||
"origin"=>array("제조국 또는 원산지", ""),
|
||||
"maker"=>array("제조자", "수입품의 경우 수입자를 함께 표기 (병행수입의 경우 병행수입 여부로 대체 가능)"),
|
||||
"as"=>array("A/S 책임자와 전화번호 또는 소비자상담 관련 전화번호", ""),
|
||||
)
|
||||
),
|
||||
);
|
||||
@ -70,7 +70,7 @@ function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $cache_time=
|
||||
}
|
||||
$list[$i] = get_list($row, $board, $latest_skin_url, $subject_len);
|
||||
|
||||
$list[$i]['first_file_thumb'] = (isset($row['wr_file']) && $row['wr_file']) ? get_board_file_db($bo_table, $row['wr_id'], 'bf_file, bf_content', "and bf_type between '1' and '3'", true) : array('bf_file'=>'', 'bf_content'=>'');
|
||||
$list[$i]['first_file_thumb'] = (isset($row['wr_file']) && $row['wr_file']) ? get_board_file_db($bo_table, $row['wr_id'], 'bf_file, bf_content', "and bf_type in (1, 2, 3, 18) ", true) : array('bf_file'=>'', 'bf_content'=>'');
|
||||
$list[$i]['bo_table'] = $bo_table;
|
||||
// 썸네일 추가
|
||||
if($options && is_string($options)) {
|
||||
|
||||
@ -18,35 +18,48 @@ function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc=
|
||||
|
||||
$result = run_replace('mailer', $fname, $fmail, $to, $subject, $content, $type, $file, $cc, $bcc);
|
||||
|
||||
if( isset($result['return']) ){
|
||||
if( is_array($result) && isset($result['return']) ){
|
||||
return $result['return'];
|
||||
}
|
||||
|
||||
$mail = new PHPMailer(); // defaults to using php "mail()"
|
||||
if (defined('G5_SMTP') && G5_SMTP) {
|
||||
$mail->IsSMTP(); // telling the class to use SMTP
|
||||
$mail->Host = G5_SMTP; // SMTP server
|
||||
if(defined('G5_SMTP_PORT') && G5_SMTP_PORT)
|
||||
$mail->Port = G5_SMTP_PORT;
|
||||
}
|
||||
$mail->CharSet = 'UTF-8';
|
||||
$mail->From = $fmail;
|
||||
$mail->FromName = $fname;
|
||||
$mail->Subject = $subject;
|
||||
$mail->AltBody = ""; // optional, comment out and test
|
||||
$mail->msgHTML($content);
|
||||
$mail->addAddress($to);
|
||||
if ($cc)
|
||||
$mail->addCC($cc);
|
||||
if ($bcc)
|
||||
$mail->addBCC($bcc);
|
||||
//print_r2($file); exit;
|
||||
if ($file != "") {
|
||||
foreach ($file as $f) {
|
||||
$mail->addAttachment($f['path'], $f['name']);
|
||||
$mail_send_result = false;
|
||||
|
||||
try {
|
||||
$mail = new PHPMailer(); // defaults to using php "mail()"
|
||||
if (defined('G5_SMTP') && G5_SMTP) {
|
||||
$mail->IsSMTP(); // telling the class to use SMTP
|
||||
$mail->Host = G5_SMTP; // SMTP server
|
||||
if(defined('G5_SMTP_PORT') && G5_SMTP_PORT)
|
||||
$mail->Port = G5_SMTP_PORT;
|
||||
}
|
||||
$mail->CharSet = 'UTF-8';
|
||||
$mail->From = $fmail;
|
||||
$mail->FromName = $fname;
|
||||
$mail->Subject = $subject;
|
||||
$mail->AltBody = ""; // optional, comment out and test
|
||||
$mail->msgHTML($content);
|
||||
$mail->addAddress($to);
|
||||
if ($cc)
|
||||
$mail->addCC($cc);
|
||||
if ($bcc)
|
||||
$mail->addBCC($bcc);
|
||||
//print_r2($file); exit;
|
||||
if ($file != "") {
|
||||
foreach ($file as $f) {
|
||||
$mail->addAttachment($f['path'], $f['name']);
|
||||
}
|
||||
}
|
||||
|
||||
$mail = run_replace('mail_options', $mail, $fname, $fmail, $to, $subject, $content, $type, $file, $cc, $bcc);
|
||||
|
||||
$mail_send_result = $mail->send();
|
||||
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
return $mail->send();
|
||||
|
||||
run_event('mail_send_result', $mail_send_result, $mail, $to, $cc, $bcc);
|
||||
|
||||
return $mail_send_result;
|
||||
}
|
||||
|
||||
// 파일을 첨부함
|
||||
|
||||
335
lib/naverpay.lib.php
Normal file
335
lib/naverpay.lib.php
Normal file
@ -0,0 +1,335 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit;
|
||||
|
||||
class naverpay_register
|
||||
{
|
||||
public $options;
|
||||
public $keys;
|
||||
public $send_cost;
|
||||
public $total_price;
|
||||
|
||||
function __construct($options, $send_cost)
|
||||
{
|
||||
$this->options = $options;
|
||||
$this->send_cost = $send_cost;
|
||||
}
|
||||
|
||||
function get_sendcost()
|
||||
{
|
||||
global $g5, $default;
|
||||
|
||||
$options = $this->options;
|
||||
$send_cost = $this->send_cost;
|
||||
$keys = $this->keys;
|
||||
|
||||
$data = array();
|
||||
|
||||
if($send_cost == 1)
|
||||
return array('type' => 'ONDELIVERY', 'cost' => 0);
|
||||
|
||||
$cost = 0;
|
||||
$cnt = 0;
|
||||
$diff = 0;
|
||||
$total_price = 0;
|
||||
$diff_cost = 0;
|
||||
|
||||
foreach($keys as $it_id) {
|
||||
$it = get_shop_item($it_id, true);
|
||||
if(!$it['it_id'])
|
||||
continue;
|
||||
|
||||
if($it['it_sc_type'] > 1 && $it['it_sc_method'] == 1) { // 착불
|
||||
$cnt++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$qty = 0;
|
||||
$price = 0;
|
||||
$opts = $options[$it_id];
|
||||
$uprice = get_price($it);
|
||||
|
||||
foreach($opts as $opt) {
|
||||
if($opt['type'])
|
||||
$price += ((int)$opt['price'] * (int)$opt['qty']);
|
||||
else
|
||||
$price += (((int)$uprice + (int)$opt['price']) * (int)$opt['qty']);
|
||||
|
||||
$qty += $opt['qty'];
|
||||
}
|
||||
|
||||
if($it['it_sc_type'] > 1) {
|
||||
if($it['it_sc_type'] == 2) { // 조건부무료
|
||||
if($price >= $it['it_sc_minimum'])
|
||||
$cost += 0;
|
||||
else
|
||||
$cost += $it['it_sc_price'];
|
||||
} else if($it['it_sc_type'] == 3) { // 유료배송
|
||||
$cost += $it['it_sc_price'];
|
||||
} else { // 수량별 부과
|
||||
if(!$it['it_sc_qty'])
|
||||
$it['it_sc_qty'] = 1;
|
||||
|
||||
$q = ceil((int)$qty / (int)$it['it_sc_qty']);
|
||||
$cost += (int)$it['it_sc_price'] * $q;
|
||||
}
|
||||
} else if($it['it_sc_type'] == 1) { // 무료배송
|
||||
$cost += 0;
|
||||
} else {
|
||||
if($default['de_send_cost_case'] == '차등') {
|
||||
$total_price += $price;
|
||||
$diff++;
|
||||
} else {
|
||||
$cost += 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($default['de_send_cost_case'] == '차등' && $total_price >= 0 && $diff > 0) {
|
||||
// 금액별차등 : 여러단계의 배송비 적용 가능
|
||||
$send_cost_limit = explode(";", $default['de_send_cost_limit']);
|
||||
$send_cost_list = explode(";", $default['de_send_cost_list']);
|
||||
|
||||
for ($k=0; $k<count($send_cost_limit); $k++) {
|
||||
// 총판매금액이 배송비 상한가 보다 작다면
|
||||
if ($total_price < preg_replace('/[^0-9]/', '', $send_cost_limit[$k])) {
|
||||
$diff_cost = preg_replace('/[^0-9]/', '', $send_cost_list[$k]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$cost += $diff_cost;
|
||||
|
||||
// 모두 착불상품이면
|
||||
if(count($keys) == $cnt && $cnt > 0)
|
||||
return array('type' => 'ONDELIVERY', 'cost' => 0);
|
||||
|
||||
if($cost > 0)
|
||||
$data = array('type' => 'PAYED', 'cost' => $cost);
|
||||
else
|
||||
$data = array('type' => 'FREE', 'cost' => 0);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
function query()
|
||||
{
|
||||
global $g5, $default;
|
||||
|
||||
$keys = array();
|
||||
$opts = array();
|
||||
|
||||
$item = '';
|
||||
$query = '';
|
||||
$total = 0;
|
||||
$shipping = '';
|
||||
|
||||
$keys = array_unique(array_keys($this->options));
|
||||
$this->keys = $keys;
|
||||
|
||||
foreach($keys as $it_id) {
|
||||
$sql = " select * from {$g5['g5_shop_item_table']} where it_id = '$it_id' and it_use = '1' and it_soldout = '0' and it_tel_inq = '0' ";
|
||||
$it = sql_fetch($sql);
|
||||
if(!$it['it_id'])
|
||||
continue;
|
||||
|
||||
$opts = $this->options[$it_id];
|
||||
|
||||
if(empty($opts) || !is_array($opts))
|
||||
continue;
|
||||
|
||||
$it_name = $it['it_name'];
|
||||
$uprice = get_price($it);
|
||||
$tprice = 0;
|
||||
|
||||
foreach($opts as $opt) {
|
||||
if($opt['type'])
|
||||
$tprice = ((int)$opt['price'] * (int)$opt['qty']);
|
||||
else
|
||||
$tprice = (((int)$uprice + (int)$opt['price']) * (int)$opt['qty']);
|
||||
|
||||
$item .= '&ITEM_ID='.urlencode($it_id);
|
||||
if($it['ec_mall_pid'])
|
||||
$item .= '&EC_MALL_PID='.urlencode($it['ec_mall_pid']);
|
||||
$item .= '&ITEM_NAME='.urlencode($it_name);
|
||||
$item .= '&ITEM_COUNT='.$opt['qty'];
|
||||
$item .= '&ITEM_OPTION='.urlencode($opt['option']);
|
||||
$item .= '&ITEM_TPRICE='.$tprice;
|
||||
$item .= '&ITEM_UPRICE='.$uprice;
|
||||
|
||||
$total += $tprice;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$sendcost = $this->get_sendcost();
|
||||
|
||||
if($sendcost['cost'] > 0)
|
||||
$total += $sendcost['cost'];
|
||||
|
||||
$this->total_price = $total;
|
||||
|
||||
$shipping .= '&SHIPPING_TYPE='.$sendcost['type'];
|
||||
$shipping .= '&SHIPPING_PRICE='.$sendcost['cost'];
|
||||
if(defined('SHIPPING_ADDITIONAL_PRICE') && SHIPPING_ADDITIONAL_PRICE)
|
||||
$shipping .= '&SHIPPING_ADDITIONAL_PRICE='.urlencode(SHIPPING_ADDITIONAL_PRICE);
|
||||
|
||||
if($item) {
|
||||
$na_co_val = isset($_COOKIE['NA_CO']) ? urlencode($_COOKIE['NA_CO']) : '';
|
||||
$query .= 'SHOP_ID='.urlencode($default['de_naverpay_mid']);
|
||||
$query .= '&CERTI_KEY='.urlencode($default['de_naverpay_cert_key']);
|
||||
$query .= $shipping;
|
||||
$query .= '&BACK_URL='.urlencode(NAVERPAY_BACK_URL);
|
||||
$query .= '&NAVER_INFLOW_CODE='.$na_co_val;
|
||||
$query .= $item;
|
||||
$query .= '&TOTAL_PRICE='.$total;
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
||||
function get_naverpay_item_image_url($it_id)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
$row = get_shop_item($it_id, true);
|
||||
|
||||
if(!$row['it_id'])
|
||||
return '';
|
||||
|
||||
$url = '';
|
||||
|
||||
for($i=1;$i<=10; $i++) {
|
||||
$file = G5_DATA_PATH.'/item/'.$row['it_img'.$i];
|
||||
if(is_file($file) && $row['it_img'.$i]) {
|
||||
$size = @getimagesize($file);
|
||||
if($size[2] < 1 || $size[2] > 3)
|
||||
continue;
|
||||
|
||||
$url = str_replace(G5_PATH, G5_URL, $file);
|
||||
|
||||
if( isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ){
|
||||
$url = preg_replace('#^https:#', '', $url);
|
||||
|
||||
$port_str = ':'.$_SERVER['SERVER_PORT'];
|
||||
|
||||
if( strpos($url, $port_str) !== false ){
|
||||
$url = str_replace($port_str, '', $url);
|
||||
}
|
||||
}
|
||||
|
||||
//TLS(SSL/HTTPS) 프로토콜 사용 시 네이버페이/네이버 쇼핑 서버가 해당 경로로 접근하여 데이터를 취득할 수 없으므로, 반드시 http 를 사용해야 함
|
||||
$url = (preg_match('#^http:#', $url) ? '' : 'http:').$url;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
function get_naverpay_item_stock($it_id)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
$it = get_shop_item($it_id, true);
|
||||
if(!$it['it_id'] || !$it['it_use'] || $it['it_soldout'])
|
||||
return 0;
|
||||
|
||||
// 옵션체크
|
||||
$sql = " select count(io_no) as cnt, sum(io_stock_qty) as qty from {$g5['g5_shop_item_option_table']} where it_id = '$it_id' and io_type = '0' and io_use = '1' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if($row['cnt'] > 0)
|
||||
return $row['qty'];
|
||||
else
|
||||
return $it['it_stock_qty'];
|
||||
}
|
||||
|
||||
function get_naverpay_item_option($it_id, $subject)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
if(!$it_id || !$subject)
|
||||
return '';
|
||||
|
||||
$sql = " select * from {$g5['g5_shop_item_option_table']} where io_type = '0' and it_id = '$it_id' and io_use = '1' order by io_no asc ";
|
||||
$result = sql_query($sql);
|
||||
if(!sql_num_rows($result))
|
||||
return '';
|
||||
|
||||
$str = '';
|
||||
$subj = explode(',', $subject);
|
||||
$subj_count = count($subj);
|
||||
|
||||
$option = '';
|
||||
|
||||
if($subj_count > 1) {
|
||||
$options = array();
|
||||
|
||||
// 옵션항목 배열에 저장
|
||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
$osl_id = explode(chr(30), $row['io_id']);
|
||||
|
||||
for($k=0; $k<$subj_count; $k++) {
|
||||
if(!is_array($options[$k]))
|
||||
$options[$k] = array();
|
||||
|
||||
if($osl_id[$k] && !in_array($osl_id[$k], $options[$k]))
|
||||
$options[$k][] = $osl_id[$k];
|
||||
}
|
||||
}
|
||||
|
||||
// 옵션선택목록 만들기
|
||||
for($i=0; $i<$subj_count; $i++) {
|
||||
$opt = $options[$i];
|
||||
$osl_count = count($opt);
|
||||
if($osl_count) {
|
||||
$option .= '<option name="'.get_text($subj[$i]).'">'.PHP_EOL;
|
||||
for($k=0; $k<$osl_count; $k++) {
|
||||
$osl_val = $opt[$k];
|
||||
if(strlen($osl_val)) {
|
||||
$option .= '<select><![CDATA['.$osl_val.']]></select>'.PHP_EOL;
|
||||
}
|
||||
}
|
||||
$option .= '</option>'.PHP_EOL;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$option .= '<option name="'.get_text($subj[0]).'">'.PHP_EOL;
|
||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
$option .= '<select><![CDATA['.$row['io_id'].']]></select>'.PHP_EOL;
|
||||
}
|
||||
$option .= '</option>'.PHP_EOL;
|
||||
}
|
||||
|
||||
return '<options>'.$option.'</options>';
|
||||
}
|
||||
|
||||
function get_naverpay_return_info($mb_id)
|
||||
{
|
||||
global $default;
|
||||
|
||||
$data = '';
|
||||
$address1 = trim($default['de_admin_company_addr']);
|
||||
$address2 = ' ';
|
||||
|
||||
$data .= '<returnInfo>';
|
||||
$data .= '<zipcode><![CDATA['.$default['de_admin_company_zip'].']]></zipcode>';
|
||||
$data .= '<address1><![CDATA['.$address1.']]></address1>';
|
||||
$data .= '<address2><![CDATA['.$address2.']]></address2>';
|
||||
$data .= '<sellername><![CDATA['.$default['de_admin_company_name'].']]></sellername>';
|
||||
$data .= '<contact1><![CDATA['.$default['de_admin_company_tel'].']]></contact1>';
|
||||
$data .= '</returnInfo>';
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
function return_error2json($str, $fld='error')
|
||||
{
|
||||
$data = array();
|
||||
$data[$fld] = trim($str);
|
||||
|
||||
die(json_encode($data));
|
||||
}
|
||||
271
lib/shop.data.lib.php
Normal file
271
lib/shop.data.lib.php
Normal file
@ -0,0 +1,271 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit;
|
||||
|
||||
function get_shop_item($it_id, $is_cache=false, $add_query=''){
|
||||
|
||||
global $g5, $g5_object;
|
||||
|
||||
$add_query_key = $add_query ? 'shop_'.md5($add_query) : '';
|
||||
|
||||
$item = $is_cache ? $g5_object->get('shop', $it_id, $add_query_key) : null;
|
||||
|
||||
if( !$item ){
|
||||
$sql = " select * from {$g5['g5_shop_item_table']} where it_id = '{$it_id}' $add_query ";
|
||||
$item = sql_fetch($sql);
|
||||
|
||||
$g5_object->set('shop', $it_id, $item, $add_query_key);
|
||||
}
|
||||
|
||||
if( isset($item['it_basic']) ) {
|
||||
$item['it_basic'] = conv_content($item['it_basic'], 1);
|
||||
}
|
||||
|
||||
if( ! isset($item['it_id']) ){
|
||||
$item['it_id'] = '';
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
function get_shop_item_with_category($it_id, $seo_title='', $add_query=''){
|
||||
|
||||
global $g5, $default;
|
||||
|
||||
if( $seo_title ){
|
||||
$sql = " select a.*, b.ca_name, b.ca_use from {$g5['g5_shop_item_table']} a, {$g5['g5_shop_category_table']} b where a.it_seo_title = '".sql_real_escape_string(generate_seo_title($seo_title))."' and a.ca_id = b.ca_id $add_query";
|
||||
} else {
|
||||
$sql = " select a.*, b.ca_name, b.ca_use from {$g5['g5_shop_item_table']} a, {$g5['g5_shop_category_table']} b where a.it_id = '$it_id' and a.ca_id = b.ca_id $add_query";
|
||||
}
|
||||
|
||||
$item = sql_fetch($sql);
|
||||
|
||||
if( isset($item['it_basic']) ) {
|
||||
$item['it_basic'] = conv_content($item['it_basic'], 1);
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
function get_shop_navigation_data($is_cache, $ca_id, $ca_id2='', $ca_id3=''){
|
||||
|
||||
$all_categories = get_shop_category_array($is_cache);
|
||||
|
||||
$datas = array();
|
||||
|
||||
if( strlen($ca_id) >= 2 && $all_categories ){
|
||||
foreach((array) $all_categories as $category1 ){
|
||||
$datas[0][] = $category1['text'];
|
||||
}
|
||||
}
|
||||
|
||||
$select_ca_id = $ca_id2 ? $ca_id2 : $ca_id;
|
||||
$item_categories2 = $select_ca_id ? get_shop_category_by($is_cache, 'ca_id', $select_ca_id) : array();
|
||||
|
||||
if( strlen($select_ca_id) >= 4 && $item_categories2 ){
|
||||
foreach((array) $item_categories2 as $key=>$category2 ){
|
||||
if( $key === 'text' ) continue;
|
||||
|
||||
$datas[1][] = $category2['text'];
|
||||
}
|
||||
}
|
||||
|
||||
$select_ca_id = $ca_id3 ? $ca_id3 : $ca_id;
|
||||
$item_categories3 = $select_ca_id ? get_shop_category_by($is_cache, 'ca_id', $select_ca_id) : array();
|
||||
|
||||
if( strlen($select_ca_id) >= 6 && $item_categories3 && isset($item_categories3[substr($select_ca_id,0,4)]) ){
|
||||
$sub_categories = $item_categories3[substr($select_ca_id,0,4)];
|
||||
|
||||
foreach((array) $sub_categories as $key=>$category3 ){
|
||||
if( $key === 'text' ) continue;
|
||||
|
||||
$datas[2][] = $category3['text'];
|
||||
}
|
||||
}
|
||||
|
||||
return $datas;
|
||||
}
|
||||
|
||||
function get_shop_category_by($is_cache, $case, $value){
|
||||
|
||||
if( $case === 'ca_id' ){
|
||||
$categories = get_shop_category_array($is_cache);
|
||||
|
||||
$key = substr(preg_replace('/[^0-9a-z]/i', '', $value), 0, 2);
|
||||
|
||||
if( isset($categories[$key]) ){
|
||||
return $categories[$key];
|
||||
}
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
function get_shop_category_array($is_cache=false){
|
||||
|
||||
static $categories = array();
|
||||
|
||||
$categories = run_replace('get_shop_category_array', $categories, $is_cache);
|
||||
|
||||
if( $is_cache && !empty($categories) ){
|
||||
return $categories;
|
||||
}
|
||||
|
||||
$result = sql_query(get_shop_category_sql('', 2));
|
||||
|
||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
|
||||
$row['url'] = shop_category_url($row['ca_id']);
|
||||
$categories[$row['ca_id']]['text'] = $row;
|
||||
|
||||
if( $row['ca_id'] ){
|
||||
$result2 = sql_query(get_shop_category_sql($row['ca_id'], 4));
|
||||
|
||||
for($j=0; $row2=sql_fetch_array($result2); $j++) {
|
||||
|
||||
$row2['url'] = shop_category_url($row2['ca_id']);
|
||||
$categories[$row['ca_id']][$row2['ca_id']]['text'] = $row2;
|
||||
|
||||
if( $row2['ca_id'] ){
|
||||
$result3 = sql_query(get_shop_category_sql($row2['ca_id'], 6));
|
||||
for($k=0; $row3=sql_fetch_array($result3); $k++) {
|
||||
|
||||
$row3['url'] = shop_category_url($row3['ca_id']);
|
||||
$categories[$row['ca_id']][$row2['ca_id']][$row3['ca_id']]['text'] = $row3;
|
||||
}
|
||||
} //end if
|
||||
} //end for
|
||||
} //end if
|
||||
} //end for
|
||||
|
||||
return $categories;
|
||||
}
|
||||
|
||||
function get_shop_category_sql($ca_id, $len){
|
||||
global $g5;
|
||||
|
||||
$sql = " select * from {$g5['g5_shop_category_table']}
|
||||
where ca_use = '1' ";
|
||||
if($ca_id)
|
||||
$sql .= " and ca_id like '$ca_id%' ";
|
||||
$sql .= " and length(ca_id) = '$len' order by ca_order, ca_id ";
|
||||
|
||||
return $sql;
|
||||
}
|
||||
|
||||
function get_shop_member_coupon_count($mb_id='', $is_cache=false){
|
||||
global $g5, $member;
|
||||
|
||||
static $cache = array();
|
||||
|
||||
$key = md5($mb_id);
|
||||
|
||||
if( $is_cache && isset($cache[$key]) ){
|
||||
return $cache[$key];
|
||||
}
|
||||
|
||||
if( !$mb_id ){
|
||||
$mb_id = $member['mb_id'];
|
||||
}
|
||||
|
||||
// 쿠폰
|
||||
$cp_count = 0;
|
||||
$sql = " select cp_id
|
||||
from {$g5['g5_shop_coupon_table']}
|
||||
where mb_id IN ( '{$mb_id}', '전체회원' )
|
||||
and cp_start <= '".G5_TIME_YMD."'
|
||||
and cp_end >= '".G5_TIME_YMD."' ";
|
||||
$res = sql_query($sql);
|
||||
|
||||
for($k=0; $cp=sql_fetch_array($res); $k++) {
|
||||
if(!is_used_coupon($mb_id, $cp['cp_id']))
|
||||
$cp_count++;
|
||||
}
|
||||
|
||||
$cache[$key] = $cp_count;
|
||||
|
||||
return $cp_count;
|
||||
}
|
||||
|
||||
// 상품리스트에서 옵션항목
|
||||
function get_shop_item_options($it_id, $subject, $no)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
if(!$it_id || !$subject)
|
||||
return '';
|
||||
|
||||
$sql = " select * from {$g5['g5_shop_item_option_table']} where io_type = '0' and it_id = '$it_id' and io_use = '1' order by io_no asc ";
|
||||
$result = sql_query($sql);
|
||||
if(!sql_num_rows($result))
|
||||
return '';
|
||||
|
||||
$str = '';
|
||||
$subj = explode(',', $subject);
|
||||
$subj_count = count($subj);
|
||||
|
||||
if($subj_count > 1) {
|
||||
$options = array();
|
||||
|
||||
// 옵션항목 배열에 저장
|
||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
$opt_id = explode(chr(30), $row['io_id']);
|
||||
|
||||
for($k=0; $k<$subj_count; $k++) {
|
||||
if(! (isset($options[$k]) && is_array($options[$k])))
|
||||
$options[$k] = array();
|
||||
|
||||
if(isset($opt_id[$k]) && $opt_id[$k] && !in_array($opt_id[$k], $options[$k]))
|
||||
$options[$k][] = $opt_id[$k];
|
||||
}
|
||||
}
|
||||
|
||||
// 옵션선택목록 만들기
|
||||
for($i=0; $i<$subj_count; $i++) {
|
||||
$opt = $options[$i];
|
||||
$opt_count = count($opt);
|
||||
$disabled = '';
|
||||
if($opt_count) {
|
||||
$seq = $no.'_'.($i + 1);
|
||||
if($i > 0)
|
||||
$disabled = ' disabled="disabled"';
|
||||
|
||||
$str .= '<label for="it_option_'.$seq.'" class="sound_only">'.$subj[$i].'</label>'.PHP_EOL;
|
||||
|
||||
$select = '<select id="it_option_'.$seq.'" class="it_option"'.$disabled.'>'.PHP_EOL;
|
||||
$select .= '<option value="">'.$subj[$i].'</option>'.PHP_EOL;
|
||||
for($k=0; $k<$opt_count; $k++) {
|
||||
$opt_val = $opt[$k];
|
||||
if(strlen($opt_val)) {
|
||||
$select .= '<option value="'.$opt_val.'">'.$opt_val.'</option>'.PHP_EOL;
|
||||
}
|
||||
}
|
||||
$select .= '</select>'.PHP_EOL;
|
||||
|
||||
$str .= $select.PHP_EOL;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$str .= '<label for="it_option_1">'.$subj[0].'</label>'.PHP_EOL;
|
||||
|
||||
$select = '<select id="it_option_1" class="it_option">'.PHP_EOL;
|
||||
$select .= '<option value="">선택</option>'.PHP_EOL;
|
||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
if($row['io_price'] >= 0)
|
||||
$price = ' + '.number_format($row['io_price']).'원';
|
||||
else
|
||||
$price = ' '.number_format($row['io_price']).'원';
|
||||
|
||||
if(!$row['io_stock_qty'])
|
||||
$soldout = ' [품절]';
|
||||
else
|
||||
$soldout = '';
|
||||
|
||||
$select .= '<option value="'.$row['io_id'].','.$row['io_price'].','.$row['io_stock_qty'].'">'.$row['io_id'].$price.$soldout.'</option>'.PHP_EOL;
|
||||
}
|
||||
$select .= '</select>'.PHP_EOL;
|
||||
|
||||
$str .= $select.PHP_EOL;
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
2800
lib/shop.lib.php
Normal file
2800
lib/shop.lib.php
Normal file
File diff suppressed because it is too large
Load Diff
225
lib/shop.uri.lib.php
Normal file
225
lib/shop.uri.lib.php
Normal file
@ -0,0 +1,225 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit;
|
||||
|
||||
function shop_type_url($type, $add_param=''){
|
||||
global $config;
|
||||
|
||||
if( $config['cf_bbs_rewrite'] ){
|
||||
return get_pretty_url('shop', 'type-'.$type, $add_param);
|
||||
}
|
||||
|
||||
$add_params = $add_param ? '&'.$add_param : '';
|
||||
return G5_SHOP_URL.'/listtype.php?type='.urlencode($type).$add_params;
|
||||
}
|
||||
|
||||
function shop_item_url($it_id, $add_param=''){
|
||||
global $config;
|
||||
|
||||
if( $config['cf_bbs_rewrite'] ){
|
||||
return get_pretty_url('shop', $it_id, $add_param);
|
||||
}
|
||||
|
||||
$add_params = $add_param ? '&'.$add_param : '';
|
||||
return G5_SHOP_URL.'/item.php?it_id='.urlencode($it_id).$add_params;
|
||||
}
|
||||
|
||||
function shop_category_url($ca_id, $add_param=''){
|
||||
global $config;
|
||||
|
||||
if( $config['cf_bbs_rewrite'] ){
|
||||
return get_pretty_url('shop', 'list-'.$ca_id, $add_param);
|
||||
}
|
||||
|
||||
$add_params = $add_param ? '&'.$add_param : '';
|
||||
return G5_SHOP_URL.'/list.php?ca_id='.urlencode($ca_id).$add_params;
|
||||
}
|
||||
|
||||
function add_pretty_shop_url($url, $folder, $no='', $query_string='', $action=''){
|
||||
global $g5, $config;
|
||||
|
||||
if( $folder !== 'shop' ){
|
||||
return $url;
|
||||
}
|
||||
|
||||
$segments = array();
|
||||
$url = $add_query = '';
|
||||
|
||||
if( $config['cf_bbs_rewrite'] ){
|
||||
$segments[0] = G5_URL;
|
||||
$segments[1] = urlencode($folder);
|
||||
|
||||
if( $config['cf_bbs_rewrite'] > 1 && ! preg_match('/^(list|type)\-([^\/]+)/i', $no) ){
|
||||
$item = get_shop_item($no, true);
|
||||
$segments[2] = (isset($item['it_seo_title']) && $item['it_seo_title']) ? urlencode($item['it_seo_title']).'/' : urlencode($no);
|
||||
} else {
|
||||
$segments[2] = urlencode($no);
|
||||
}
|
||||
|
||||
if($query_string) {
|
||||
// If the first character of the query string is '&', replace it with '?'.
|
||||
if(substr($query_string, 0, 1) == '&') {
|
||||
$add_query = preg_replace("/\&/", "?", $query_string, 1);
|
||||
} else {
|
||||
$add_query = '?'. $query_string;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
if( preg_match('/^list\-([^\/]+)/i', $no) ){
|
||||
$url = G5_SHOP_URL. '/list.php?ca_id='.urlencode($no);
|
||||
} else if( preg_match('/^type\-([^\/]+)/i', $no) ){
|
||||
$url = G5_SHOP_URL. '/listtype.php?type='.urlencode($no);
|
||||
} else {
|
||||
$url = G5_SHOP_URL. '/item.php?it_id='.urlencode($no);
|
||||
}
|
||||
|
||||
if($query_string) {
|
||||
$url .= ($no ? '?' : '&'). $query_string;
|
||||
}
|
||||
|
||||
$segments[0] = $url;
|
||||
}
|
||||
|
||||
return implode('/', $segments).$add_query;
|
||||
}
|
||||
|
||||
function shop_short_url_clean($string_url, $url, $page_name, $array_page_names){
|
||||
|
||||
global $config, $g5;
|
||||
|
||||
if( $config['cf_bbs_rewrite'] && stripos($string_url, G5_SHOP_URL) !== false && in_array($page_name, array('item', 'list', 'listtype')) ){
|
||||
|
||||
parse_str($url['query'], $vars);
|
||||
|
||||
$allow_param_keys = array('it_id'=>'', 'ca_id'=>'', 'type'=>'');
|
||||
|
||||
$s = array('shop_dir'=>G5_SHOP_DIR);
|
||||
|
||||
foreach( $allow_param_keys as $key=>$v ){
|
||||
if( !isset($vars[$key]) || empty($vars[$key]) ) continue;
|
||||
|
||||
$key_value = $vars[$key];
|
||||
|
||||
if( $key === 'ca_id' ){
|
||||
$key_value = 'list-'.$vars[$key];
|
||||
} else if ( $key === 'type' ){
|
||||
$key_value = 'type-'.$vars[$key];
|
||||
}
|
||||
|
||||
$s[$key] = $key_value;
|
||||
}
|
||||
|
||||
if( $config['cf_bbs_rewrite'] > 1 && $page_name === 'item' && (isset($s['it_id']) && $s['it_id']) ){
|
||||
$get_item = get_shop_item($s['it_id'], true);
|
||||
|
||||
if( $get_item['it_seo_title'] ){
|
||||
unset($s['it_id']);
|
||||
$s['it_seo_title'] = urlencode($get_item['it_seo_title']).'/';
|
||||
}
|
||||
}
|
||||
|
||||
$fragment = isset($url['fragment']) ? '#'.$url['fragment'] : '';
|
||||
|
||||
$host = G5_URL;
|
||||
|
||||
if( isset($url['host']) ){
|
||||
|
||||
$array_file_paths = run_replace('url_clean_page_paths', array('/'.G5_SHOP_DIR.'/item.php', '/'.G5_SHOP_DIR.'/list.php', '/'.G5_SHOP_DIR.'/listtype.php'));
|
||||
|
||||
$str_path = isset($url['path']) ? $url['path'] : '';
|
||||
$http = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ? 'https://' : 'http://';
|
||||
$port = (isset($url['port']) && ($url['port']!==80 || $url['port']!==443)) ? ':'.$url['port'] : '';
|
||||
$host = $http.$url['host'].$port.str_replace($array_file_paths, '', $str_path);
|
||||
}
|
||||
|
||||
$add_param = '';
|
||||
|
||||
if( $result = array_diff_key($vars, $allow_param_keys ) ){
|
||||
$add_param = '?'.http_build_query($result,'','&');
|
||||
}
|
||||
|
||||
if( $add_qry ){
|
||||
$add_param .= $add_param ? '&'.$add_qry : '?'.$add_qry;
|
||||
}
|
||||
|
||||
foreach($s as $k => $v) { $return_url .= '/'.$v; }
|
||||
|
||||
return $host.$return_url.$add_param.$fragment;
|
||||
}
|
||||
|
||||
return $string_url;
|
||||
}
|
||||
|
||||
function add_shop_nginx_conf_rules($rules, $get_path_url, $base_path, $return_string=false){
|
||||
|
||||
$add_rules = array();
|
||||
|
||||
$add_rules[] = "rewrite ^{$base_path}shop/list-([0-9a-z]+)$ {$base_path}".G5_SHOP_DIR."/list.php?ca_id=$1&rewrite=1 break;";
|
||||
$add_rules[] = "rewrite ^{$base_path}shop/type-([0-9a-z]+)$ {$base_path}".G5_SHOP_DIR."/listtype.php?type=$1&rewrite=1 break;";
|
||||
$add_rules[] = "rewrite ^{$base_path}shop/([0-9a-zA-Z_\-]+)$ {$base_path}".G5_SHOP_DIR."/item.php?it_id=$1&rewrite=1 break;";
|
||||
$add_rules[] = "rewrite ^{$base_path}shop/([^/]+)/$ {$base_path}".G5_SHOP_DIR."/item.php?it_seo_title=$1&rewrite=1 break;";
|
||||
|
||||
return implode("\n", $add_rules).$rules;
|
||||
|
||||
}
|
||||
|
||||
function add_shop_mod_rewrite_rules($rules, $get_path_url, $base_path, $return_string=false){
|
||||
|
||||
$add_rules = array();
|
||||
|
||||
$add_rules[] = 'RewriteRule ^shop/list-([0-9a-z]+)$ '.G5_SHOP_DIR.'/list.php?ca_id=$1&rewrite=1 [QSA,L]';
|
||||
$add_rules[] = 'RewriteRule ^shop/type-([0-9a-z]+)$ '.G5_SHOP_DIR.'/listtype.php?type=$1&rewrite=1 [QSA,L]';
|
||||
$add_rules[] = 'RewriteRule ^shop/([0-9a-zA-Z_\-]+)$ '.G5_SHOP_DIR.'/item.php?it_id=$1&rewrite=1 [QSA,L]';
|
||||
$add_rules[] = 'RewriteRule ^shop/([^/]+)/$ '.G5_SHOP_DIR.'/item.php?it_seo_title=$1&rewrite=1 [QSA,L]';
|
||||
|
||||
return implode("\n", $add_rules).$rules;
|
||||
|
||||
}
|
||||
|
||||
function add_shop_admin_dbupgrade($is_check){
|
||||
global $g5;
|
||||
|
||||
// 내용 관리 짧은 주소
|
||||
$sql = " SHOW COLUMNS FROM `{$g5['g5_shop_item_table']}` LIKE 'it_seo_title' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if( !$row ){
|
||||
sql_query("ALTER TABLE `{$g5['g5_shop_item_table']}`
|
||||
ADD `it_seo_title` varchar(200) NOT NULL DEFAULT '' AFTER `it_name`,
|
||||
ADD INDEX `it_seo_title` (`it_seo_title`);
|
||||
", false);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
return $is_check;
|
||||
|
||||
}
|
||||
|
||||
function shop_exist_check_seo_title($seo_title, $type, $shop_item_table, $it_id){
|
||||
|
||||
$sql = "select it_seo_title FROM {$shop_item_table} WHERE it_seo_title = '".sql_real_escape_string($seo_title)."' AND it_id <> '$it_id' limit 1";
|
||||
$row = sql_fetch($sql, false);
|
||||
|
||||
if( isset($row['it_seo_title']) && $row['it_seo_title'] ){
|
||||
return 'is_exists';
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
function shop_seo_title_update($it_id, $is_edit=false){
|
||||
global $g5;
|
||||
|
||||
$shop_item_cache = $is_edit ? false : true;
|
||||
$item = get_shop_item($it_id, $shop_item_cache);
|
||||
|
||||
if( (! $item['it_seo_title'] || $is_edit) && $item['it_name'] ){
|
||||
$it_seo_title = exist_seo_title_recursive('shop', generate_seo_title($item['it_name']), $g5['g5_shop_item_table'], $item['it_id']);
|
||||
|
||||
if( isset($item['it_seo_title']) && $it_seo_title !== $item['it_seo_title'] ){
|
||||
$sql = " update `{$g5['g5_shop_item_table']}` set it_seo_title = '{$it_seo_title}' where it_id = '{$item['it_id']}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -85,7 +85,7 @@ function get_file_thumbnail($file){
|
||||
|
||||
if( ! is_array($file) ) return '';
|
||||
|
||||
if( preg_match('/(\.jpg|\.jpeg|\.gif|\.png|\.bmp)$/i', $file['file']) && $contents = run_replace('get_file_thumbnail_tags', '', $file) ){
|
||||
if( preg_match('/(\.jpg|\.jpeg|\.gif|\.png|\.bmp|\.webp)$/i', $file['file']) && $contents = run_replace('get_file_thumbnail_tags', '', $file) ){
|
||||
return $contents;
|
||||
} else if ($file['view']) {
|
||||
return get_view_thumbnail($file['view']);
|
||||
@ -108,6 +108,8 @@ function get_view_thumbnail($contents, $thumb_width=0)
|
||||
if(empty($matches))
|
||||
return $contents;
|
||||
|
||||
$extensions = array(1=>'gif', 2=>'jpg', 3=>'png', 18=>'webp');
|
||||
|
||||
for($i=0; $i<count($matches[1]); $i++) {
|
||||
|
||||
$img = $matches[1][$i];
|
||||
@ -138,8 +140,11 @@ function get_view_thumbnail($contents, $thumb_width=0)
|
||||
if(empty($size))
|
||||
continue;
|
||||
|
||||
$file_ext = $extensions[$size[2]];
|
||||
if (!$file_ext) continue;
|
||||
|
||||
// jpg 이면 exif 체크
|
||||
if($size[2] == 2 && function_exists('exif_read_data')) {
|
||||
if( $file_ext === 'jpg' && function_exists('exif_read_data')) {
|
||||
$degree = 0;
|
||||
$exif = @exif_read_data($srcfile);
|
||||
if(!empty($exif['Orientation'])) {
|
||||
@ -166,7 +171,7 @@ function get_view_thumbnail($contents, $thumb_width=0)
|
||||
|
||||
// Animated GIF 체크
|
||||
$is_animated = false;
|
||||
if($size[2] == 1) {
|
||||
if($file_ext === 'gif') {
|
||||
$is_animated = is_animated_gif($srcfile);
|
||||
|
||||
if($replace_content = run_replace('thumbnail_is_animated_gif_content', '', $contents, $srcfile, $is_animated, $img_tag, $data_path, $size)){
|
||||
@ -226,9 +231,20 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
if(!is_file($source_file)) // 원본 파일이 없다면
|
||||
return;
|
||||
|
||||
|
||||
$size = @getimagesize($source_file);
|
||||
if(!isset($size[2]) || $size[2] < 1 || $size[2] > 3) // gif, jpg, png 에 대해서만 적용
|
||||
return;
|
||||
|
||||
$extensions = array(1 => 'gif', 2 => 'jpg', 3 => 'png', 18 => 'webp');
|
||||
$file_ext = $extensions[$size[2]]; // 파일 확장자
|
||||
if (!$file_ext) return;
|
||||
|
||||
// gif, jpg, png, webp 에 대해서만 적용
|
||||
// if ( !(isset($size[2]) && ($size[2] == 1 || $size[2] == 2 || $size[2] == 3 || $size[2] == 18)) )
|
||||
// return;
|
||||
|
||||
// $extensions 배열에 없는 확장자 라면 썸네일 만들지 않음
|
||||
// if (!in_array($file_ext, $extensions))
|
||||
// return;
|
||||
|
||||
if (!is_dir($target_path)) {
|
||||
@mkdir($target_path, G5_DIR_PERMISSION);
|
||||
@ -240,16 +256,19 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
return '';
|
||||
|
||||
// Animated GIF는 썸네일 생성하지 않음
|
||||
if($size[2] == 1) {
|
||||
if($file_ext === 'gif') {
|
||||
if(is_animated_gif($source_file))
|
||||
return basename($source_file);
|
||||
} else if ($file_ext === 'webp') {
|
||||
if(is_animated_webp($source_file))
|
||||
return basename($source_file);
|
||||
}
|
||||
|
||||
$ext = array(1 => 'gif', 2 => 'jpg', 3 => 'png');
|
||||
|
||||
$thumb_filename = preg_replace("/\.[^\.]+$/i", "", $filename); // 확장자제거
|
||||
$thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.".$ext[$size[2]];
|
||||
|
||||
// $thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.".$ext[$size[2]];
|
||||
$thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.".$file_ext;
|
||||
|
||||
$thumb_time = @filemtime($thumb_file);
|
||||
$source_time = @filemtime($source_file);
|
||||
|
||||
@ -263,10 +282,10 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
$src = null;
|
||||
$degree = 0;
|
||||
|
||||
if ($size[2] == 1) {
|
||||
if ($file_ext === 'gif') {
|
||||
$src = @imagecreatefromgif($source_file);
|
||||
$src_transparency = @imagecolortransparent($src);
|
||||
} else if ($size[2] == 2) {
|
||||
} else if ($file_ext === 'jpg') {
|
||||
$src = @imagecreatefromjpeg($source_file);
|
||||
|
||||
if(function_exists('exif_read_data')) {
|
||||
@ -298,9 +317,12 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ($size[2] == 3) {
|
||||
} else if ($file_ext === 'png') {
|
||||
$src = @imagecreatefrompng($source_file);
|
||||
@imagealphablending($src, true);
|
||||
} else if ($file_ext === 'webp') {
|
||||
$src = @imagecreatefromwebp($source_file);
|
||||
@imagealphablending($src, true);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
@ -363,10 +385,10 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
|
||||
$dst = imagecreatetruecolor($dst_w, $dst_h);
|
||||
|
||||
if($size[2] == 3) {
|
||||
if($file_ext === 'png') {
|
||||
imagealphablending($dst, false);
|
||||
imagesavealpha($dst, true);
|
||||
} else if($size[2] == 1) {
|
||||
} else if($file_ext === 'gif') {
|
||||
$palletsize = imagecolorstotal($src);
|
||||
if($src_transparency >= 0 && $src_transparency < $palletsize) {
|
||||
$transparent_color = imagecolorsforindex($src, $src_transparency);
|
||||
@ -391,12 +413,12 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
}
|
||||
}
|
||||
|
||||
if($size[2] == 3) {
|
||||
if($file_ext === 'png') {
|
||||
$bgcolor = imagecolorallocatealpha($dst, 0, 0, 0, 127);
|
||||
imagefill($dst, 0, 0, $bgcolor);
|
||||
imagealphablending($dst, false);
|
||||
imagesavealpha($dst, true);
|
||||
} else if($size[2] == 1) {
|
||||
} else if($file_ext === 'gif') {
|
||||
$palletsize = imagecolorstotal($src);
|
||||
if($src_transparency >= 0 && $src_transparency < $palletsize) {
|
||||
$transparent_color = imagecolorsforindex($src, $src_transparency);
|
||||
@ -474,12 +496,12 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
}
|
||||
}
|
||||
|
||||
if($size[2] == 3) {
|
||||
if($file_ext === 'png') {
|
||||
$bgcolor = imagecolorallocatealpha($dst, 0, 0, 0, 127);
|
||||
imagefill($dst, 0, 0, $bgcolor);
|
||||
imagealphablending($dst, false);
|
||||
imagesavealpha($dst, true);
|
||||
} else if($size[2] == 1) {
|
||||
} else if($file_ext === 'gif') {
|
||||
$palletsize = imagecolorstotal($src);
|
||||
if($src_transparency >= 0 && $src_transparency < $palletsize) {
|
||||
$transparent_color = imagecolorsforindex($src, $src_transparency);
|
||||
@ -502,22 +524,24 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
UnsharpMask($dst, $val[0], $val[1], $val[2]);
|
||||
}
|
||||
|
||||
if($size[2] == 1) {
|
||||
if($file_ext === 'gif') {
|
||||
imagegif($dst, $thumb_file);
|
||||
} else if($size[2] == 3) {
|
||||
} else if($file_ext === 'png') {
|
||||
if(!defined('G5_THUMB_PNG_COMPRESS'))
|
||||
$png_compress = 5;
|
||||
else
|
||||
$png_compress = G5_THUMB_PNG_COMPRESS;
|
||||
|
||||
imagepng($dst, $thumb_file, $png_compress);
|
||||
} else {
|
||||
} else if ($file_ext === 'jpg') {
|
||||
if(!defined('G5_THUMB_JPG_QUALITY'))
|
||||
$jpg_quality = 90;
|
||||
else
|
||||
$jpg_quality = G5_THUMB_JPG_QUALITY;
|
||||
|
||||
imagejpeg($dst, $thumb_file, $jpg_quality);
|
||||
} else if ($file_ext === 'webp') {
|
||||
imagewebp($dst, $thumb_file);
|
||||
}
|
||||
|
||||
chmod($thumb_file, G5_FILE_PERMISSION); // 추후 삭제를 위하여 파일모드 변경
|
||||
@ -695,6 +719,22 @@ and the roundoff errors in the Gaussian blur process, are welcome.
|
||||
|
||||
}
|
||||
|
||||
// 움직이는 webp 파일인지 검사한다.
|
||||
// 출처) https://stackoverflow.com/questions/45190469/how-to-identify-whether-webp-image-is-static-or-animated?answertab=votes#tab-top
|
||||
function is_animated_webp($filename) {
|
||||
$contents = file_get_contents($filename);
|
||||
$where = strpos($contents, "ANMF");
|
||||
if ($where !== false){
|
||||
// animated
|
||||
$is_animated = true;
|
||||
}
|
||||
else{
|
||||
// non animated
|
||||
$is_animated = false;
|
||||
}
|
||||
return $is_animated;
|
||||
}
|
||||
|
||||
function is_animated_gif($filename) {
|
||||
|
||||
static $cache = array();
|
||||
|
||||
@ -193,7 +193,7 @@ function correct_goto_url($url){
|
||||
return $url;
|
||||
}
|
||||
|
||||
function generate_seo_title($string, $wordLimit=G5_SEO_TITEL_WORD_CUT){
|
||||
function generate_seo_title($string, $wordLimit=G5_SEO_TITLE_WORD_CUT){
|
||||
$separator = '-';
|
||||
|
||||
if($wordLimit != 0){
|
||||
|
||||
Reference in New Issue
Block a user