g4를 g5로 변경
This commit is contained in:
@ -122,9 +122,9 @@ function get_session($session_name)
|
||||
// 쿠키변수 생성
|
||||
function set_cookie($cookie_name, $value, $expire)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
setcookie(md5($cookie_name), base64_encode($value), G4_SERVER_TIME + $expire, '/', G4_COOKIE_DOMAIN);
|
||||
setcookie(md5($cookie_name), base64_encode($value), G5_SERVER_TIME + $expire, '/', G5_COOKIE_DOMAIN);
|
||||
}
|
||||
|
||||
|
||||
@ -142,16 +142,16 @@ function get_cookie($cookie_name)
|
||||
// 경고메세지를 경고창으로
|
||||
function alert($msg='', $url='', $error=true, $post=false)
|
||||
{
|
||||
global $g4, $config, $member;
|
||||
global $g5, $config, $member;
|
||||
global $is_admin;
|
||||
|
||||
if (!$msg) $msg = '올바른 방법으로 이용해 주십시오.';
|
||||
|
||||
$header = '';
|
||||
if (isset($g4['title'])) {
|
||||
$header = $g4['title'];
|
||||
if (isset($g5['title'])) {
|
||||
$header = $g5['title'];
|
||||
}
|
||||
include_once(G4_BBS_PATH.'/alert.php');
|
||||
include_once(G5_BBS_PATH.'/alert.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -159,13 +159,13 @@ function alert($msg='', $url='', $error=true, $post=false)
|
||||
// 경고메세지 출력후 창을 닫음
|
||||
function alert_close($msg, $error=true)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$header = '';
|
||||
if (isset($g4['title'])) {
|
||||
$header = $g4['title'];
|
||||
if (isset($g5['title'])) {
|
||||
$header = $g5['title'];
|
||||
}
|
||||
include_once(G4_BBS_PATH.'/alert_close.php');
|
||||
include_once(G5_BBS_PATH.'/alert_close.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -173,13 +173,13 @@ function alert_close($msg, $error=true)
|
||||
// 경고메세지 출력후 창을 닫음
|
||||
function alert_login($msg, $url)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$header = '';
|
||||
if (isset($g4['title'])) {
|
||||
$header = $g4['title'];
|
||||
if (isset($g5['title'])) {
|
||||
$header = $g5['title'];
|
||||
}
|
||||
include_once(G4_BBS_PATH.'/alert_login.php');
|
||||
include_once(G5_BBS_PATH.'/alert_login.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ function alert_login($msg, $url)
|
||||
// confirm 창
|
||||
function confirm($msg, $url1='', $url2='', $url3='')
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
if (!$msg) {
|
||||
$msg = '올바른 방법으로 이용해 주십시오.';
|
||||
@ -204,10 +204,10 @@ function confirm($msg, $url1='', $url2='', $url3='')
|
||||
$msg = str_replace("\\n", "<br>", $msg);
|
||||
|
||||
$header = '';
|
||||
if (isset($g4['title'])) {
|
||||
$header = $g4['title'];
|
||||
if (isset($g5['title'])) {
|
||||
$header = $g5['title'];
|
||||
}
|
||||
include_once(G4_BBS_PATH.'/confirm.php');
|
||||
include_once(G5_BBS_PATH.'/confirm.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -215,7 +215,7 @@ function confirm($msg, $url1='', $url2='', $url3='')
|
||||
// way.co.kr 의 wayboard 참고
|
||||
function url_auto_link($str)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
global $config;
|
||||
|
||||
// 속도 향상 031011
|
||||
@ -272,18 +272,18 @@ function get_filesize($size)
|
||||
// 게시글에 첨부된 파일을 얻는다. (배열로 반환)
|
||||
function get_file($bo_table, $wr_id)
|
||||
{
|
||||
global $g4, $qstr;
|
||||
global $g5, $qstr;
|
||||
|
||||
$file['count'] = 0;
|
||||
$sql = " select * from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no ";
|
||||
$sql = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no ";
|
||||
$result = sql_query($sql);
|
||||
while ($row = sql_fetch_array($result))
|
||||
{
|
||||
$no = $row['bf_no'];
|
||||
$file[$no]['href'] = G4_BBS_URL."/download.php?bo_table=$bo_table&wr_id=$wr_id&no=$no" . $qstr;
|
||||
$file[$no]['href'] = G5_BBS_URL."/download.php?bo_table=$bo_table&wr_id=$wr_id&no=$no" . $qstr;
|
||||
$file[$no]['download'] = $row['bf_download'];
|
||||
// 4.00.11 - 파일 path 추가
|
||||
$file[$no]['path'] = G4_DATA_URL.'/file/'.$bo_table;
|
||||
$file[$no]['path'] = G5_DATA_URL.'/file/'.$bo_table;
|
||||
$file[$no]['size'] = get_filesize($row['bf_filesize']);
|
||||
$file[$no]['datetime'] = $row['bf_datetime'];
|
||||
$file[$no]['source'] = addslashes($row['bf_source']);
|
||||
@ -305,9 +305,9 @@ function get_file($bo_table, $wr_id)
|
||||
// 게시글 리스트에 쓰일 1개의 파일 정보를 얻는다.
|
||||
function get_list_file($bo_table, $wr_id)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$sql = " select * from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no ";
|
||||
$sql = " select * from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
return $row;
|
||||
@ -339,7 +339,7 @@ function get_dirsize($dir)
|
||||
// 게시물 정보($write_row)를 출력하기 위하여 $list로 가공된 정보를 복사 및 가공
|
||||
function get_list($write_row, $board, $skin_url, $subject_len=40)
|
||||
{
|
||||
global $g4, $config;
|
||||
global $g5, $config;
|
||||
global $qstr, $page;
|
||||
|
||||
//$t = get_microtime();
|
||||
@ -374,14 +374,14 @@ function get_list($write_row, $board, $skin_url, $subject_len=40)
|
||||
// 당일인 경우 시간으로 표시함
|
||||
$list['datetime'] = substr($list['wr_datetime'],0,10);
|
||||
$list['datetime2'] = $list['wr_datetime'];
|
||||
if ($list['datetime'] == G4_TIME_YMD)
|
||||
if ($list['datetime'] == G5_TIME_YMD)
|
||||
$list['datetime2'] = substr($list['datetime2'],11,5);
|
||||
else
|
||||
$list['datetime2'] = substr($list['datetime2'],5,5);
|
||||
// 4.1
|
||||
$list['last'] = substr($list['wr_last'],0,10);
|
||||
$list['last2'] = $list['wr_last'];
|
||||
if ($list['last'] == G4_TIME_YMD)
|
||||
if ($list['last'] == G5_TIME_YMD)
|
||||
$list['last2'] = substr($list['last2'],11,5);
|
||||
else
|
||||
$list['last2'] = substr($list['last2'],5,5);
|
||||
@ -407,13 +407,13 @@ function get_list($write_row, $board, $skin_url, $subject_len=40)
|
||||
$list['icon_link'] = '<img src="'.$skin_url.'/img/icon_link.gif" alt="관련링크">';
|
||||
|
||||
// 분류명 링크
|
||||
$list['ca_name_href'] = G4_BBS_URL.'/board.php?bo_table='.$board['bo_table'].'&sca='.urlencode($list['ca_name']);
|
||||
$list['ca_name_href'] = G5_BBS_URL.'/board.php?bo_table='.$board['bo_table'].'&sca='.urlencode($list['ca_name']);
|
||||
|
||||
$list['href'] = G4_BBS_URL.'/board.php?bo_table='.$board['bo_table'].'&wr_id='.$list['wr_id'].$qstr;
|
||||
$list['href'] = G5_BBS_URL.'/board.php?bo_table='.$board['bo_table'].'&wr_id='.$list['wr_id'].$qstr;
|
||||
$list['comment_href'] = $list['href'];
|
||||
|
||||
$list['icon_new'] = '';
|
||||
if ($list['wr_datetime'] >= date("Y-m-d H:i:s", G4_SERVER_TIME - ($board['bo_new'] * 3600)))
|
||||
if ($list['wr_datetime'] >= date("Y-m-d H:i:s", G5_SERVER_TIME - ($board['bo_new'] * 3600)))
|
||||
$list['icon_new'] = '<img src="'.$skin_url.'/img/icon_new.gif" alt="새글">';
|
||||
|
||||
$list['icon_hot'] = '';
|
||||
@ -425,9 +425,9 @@ function get_list($write_row, $board, $skin_url, $subject_len=40)
|
||||
$list['icon_secret'] = '<img src="'.$skin_url.'/img/icon_secret.gif" alt="비밀글">';
|
||||
|
||||
// 링크
|
||||
for ($i=1; $i<=G4_LINK_COUNT; $i++) {
|
||||
for ($i=1; $i<=G5_LINK_COUNT; $i++) {
|
||||
$list['link'][$i] = set_http(get_text($list["wr_link{$i}"]));
|
||||
$list['link_href'][$i] = G4_BBS_URL.'/link.php?bo_table='.$board['bo_table'].'&wr_id='.$list['wr_id'].'&no='.$i.$qstr;
|
||||
$list['link_href'][$i] = G5_BBS_URL.'/link.php?bo_table='.$board['bo_table'].'&wr_id='.$list['wr_id'].'&no='.$i.$qstr;
|
||||
$list['link_hit'][$i] = (int)$list["wr_link{$i}_hit"];
|
||||
}
|
||||
|
||||
@ -548,7 +548,7 @@ function conv_content($content, $html)
|
||||
// Open : HTML Purifier is open-source and highly customizable
|
||||
function html_purifier($html)
|
||||
{
|
||||
$f = file(G4_PLUGIN_PATH.'/htmlpurifier/safeiframe.txt');
|
||||
$f = file(G5_PLUGIN_PATH.'/htmlpurifier/safeiframe.txt');
|
||||
$domains = array();
|
||||
foreach($f as $domain){
|
||||
// 첫행이 # 이면 주석 처리
|
||||
@ -562,10 +562,10 @@ function html_purifier($html)
|
||||
array_push($domains, $_SERVER['HTTP_HOST'].'/');
|
||||
$safeiframe = implode('|', $domains);
|
||||
|
||||
include_once(G4_PLUGIN_PATH.'/htmlpurifier/HTMLPurifier.standalone.php');
|
||||
include_once(G5_PLUGIN_PATH.'/htmlpurifier/HTMLPurifier.standalone.php');
|
||||
$config = HTMLPurifier_Config::createDefault();
|
||||
// data/cache 디렉토리에 CSS, HTML, URI 디렉토리 등을 만든다.
|
||||
$config->set('Cache.SerializerPath', G4_DATA_PATH.'/cache');
|
||||
$config->set('Cache.SerializerPath', G5_DATA_PATH.'/cache');
|
||||
$config->set('HTML.SafeEmbed', true);
|
||||
$config->set('HTML.SafeObject', true);
|
||||
$config->set('HTML.SafeIframe', true);
|
||||
@ -579,7 +579,7 @@ function html_purifier($html)
|
||||
// 검색 구문을 얻는다.
|
||||
function get_sql_search($search_ca_name, $search_field, $search_text, $search_operator='and')
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$str = "";
|
||||
if ($search_ca_name)
|
||||
@ -621,7 +621,7 @@ function get_sql_search($search_ca_name, $search_field, $search_text, $search_op
|
||||
if ($search_str == "") continue;
|
||||
|
||||
// 인기검색어
|
||||
$sql = " insert into {$g4['popular_table']} set pp_word = '$search_str', pp_date = '".G4_TIME_YMD."', pp_ip = '{$_SERVER['REMOTE_ADDR']}' ";
|
||||
$sql = " insert into {$g5['popular_table']} set pp_word = '$search_str', pp_date = '".G5_TIME_YMD."', pp_ip = '{$_SERVER['REMOTE_ADDR']}' ";
|
||||
sql_query($sql, FALSE);
|
||||
|
||||
$str .= $op1;
|
||||
@ -696,18 +696,18 @@ function get_next_num($table)
|
||||
// 그룹 설정 테이블에서 하나의 행을 읽음
|
||||
function get_group($gr_id)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
return sql_fetch(" select * from {$g4['group_table']} where gr_id = '$gr_id' ");
|
||||
return sql_fetch(" select * from {$g5['group_table']} where gr_id = '$gr_id' ");
|
||||
}
|
||||
|
||||
|
||||
// 회원 정보를 얻는다.
|
||||
function get_member($mb_id, $fields='*')
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
return sql_fetch(" select $fields from {$g4['member_table']} where mb_id = TRIM('$mb_id') ");
|
||||
return sql_fetch(" select $fields from {$g5['member_table']} where mb_id = TRIM('$mb_id') ");
|
||||
}
|
||||
|
||||
|
||||
@ -759,21 +759,21 @@ function subject_sort_link($col, $query_string='', $flag='asc')
|
||||
function get_admin($admin='super', $fields='*')
|
||||
{
|
||||
global $config, $group, $board;
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$is = false;
|
||||
if ($admin == 'board') {
|
||||
$mb = sql_fetch("select {$fields} from {$g4['member_table']} where mb_id in ('{$board['bo_admin']}') limit 1 ");
|
||||
$mb = sql_fetch("select {$fields} from {$g5['member_table']} where mb_id in ('{$board['bo_admin']}') limit 1 ");
|
||||
$is = true;
|
||||
}
|
||||
|
||||
if (($is && !$mb['mb_id']) || $admin == 'group') {
|
||||
$mb = sql_fetch("select {$fields} from {$g4['member_table']} where mb_id in ('{$group['gr_admin']}') limit 1 ");
|
||||
$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') {
|
||||
$mb = sql_fetch("select {$fields} from {$g4['member_table']} where mb_id in ('{$config['cf_admin']}') limit 1 ");
|
||||
$mb = sql_fetch("select {$fields} from {$g5['member_table']} where mb_id in ('{$config['cf_admin']}') limit 1 ");
|
||||
}
|
||||
|
||||
return $mb;
|
||||
@ -798,7 +798,7 @@ function is_admin($mb_id)
|
||||
// 4.00 에서는 카테고리 테이블을 없애고 보드테이블에 있는 내용으로 대체
|
||||
function get_category_option($bo_table='', $ca_name='')
|
||||
{
|
||||
global $g4, $board, $is_admin;
|
||||
global $g5, $board, $is_admin;
|
||||
|
||||
$categories = explode("|", $board['bo_category_list'].($is_admin?"|공지":"")); // 구분자가 , 로 되어 있음
|
||||
$str = "";
|
||||
@ -820,11 +820,11 @@ function get_category_option($bo_table='', $ca_name='')
|
||||
// 게시판 그룹을 SELECT 형식으로 얻음
|
||||
function get_group_select($name, $selected='', $event='')
|
||||
{
|
||||
global $g4, $is_admin, $member;
|
||||
global $g5, $is_admin, $member;
|
||||
|
||||
$sql = " select gr_id, gr_subject from {$g4['group_table']} a ";
|
||||
$sql = " select gr_id, gr_subject from {$g5['group_table']} a ";
|
||||
if ($is_admin == "group") {
|
||||
$sql .= " left join {$g4['member_table']} b on (b.mb_id = a.gr_admin)
|
||||
$sql .= " left join {$g5['member_table']} b on (b.mb_id = a.gr_admin)
|
||||
where b.mb_id = '{$member['mb_id']}' ";
|
||||
}
|
||||
$sql .= " order by a.gr_id ";
|
||||
@ -870,7 +870,7 @@ function get_yn_select($name, $selected='1', $event='')
|
||||
function insert_point($mb_id, $point, $content='', $rel_table='', $rel_id='', $rel_action='', $expire=0)
|
||||
{
|
||||
global $config;
|
||||
global $g4;
|
||||
global $g5;
|
||||
global $is_admin;
|
||||
|
||||
// 포인트 사용을 하지 않는다면 return
|
||||
@ -881,7 +881,7 @@ function insert_point($mb_id, $point, $content='', $rel_table='', $rel_id='', $r
|
||||
|
||||
// 회원아이디가 없다면 업데이트 할 필요 없음
|
||||
if ($mb_id == '') { return 0; }
|
||||
$mb = sql_fetch(" select mb_id from {$g4['member_table']} where mb_id = '$mb_id' ");
|
||||
$mb = sql_fetch(" select mb_id from {$g5['member_table']} where mb_id = '$mb_id' ");
|
||||
if (!$mb['mb_id']) { return 0; }
|
||||
|
||||
// 회원포인트
|
||||
@ -890,7 +890,7 @@ function insert_point($mb_id, $point, $content='', $rel_table='', $rel_id='', $r
|
||||
// 이미 등록된 내역이라면 건너뜀
|
||||
if ($rel_table || $rel_id || $rel_action)
|
||||
{
|
||||
$sql = " select count(*) as cnt from {$g4['point_table']}
|
||||
$sql = " select count(*) as cnt from {$g5['point_table']}
|
||||
where mb_id = '$mb_id'
|
||||
and po_rel_table = '$rel_table'
|
||||
and po_rel_id = '$rel_id'
|
||||
@ -904,21 +904,21 @@ function insert_point($mb_id, $point, $content='', $rel_table='', $rel_id='', $r
|
||||
$po_expire_date = '9999-12-31';
|
||||
if($config['cf_point_term'] > 0) {
|
||||
if($expire > 0)
|
||||
$po_expire_date = date('Y-m-d', strtotime('+'.($expire - 1).' days', G4_SERVER_TIME));
|
||||
$po_expire_date = date('Y-m-d', strtotime('+'.($expire - 1).' days', G5_SERVER_TIME));
|
||||
else
|
||||
$po_expire_date = date('Y-m-d', strtotime('+'.($config['cf_point_term'] - 1).' days', G4_SERVER_TIME));
|
||||
$po_expire_date = date('Y-m-d', strtotime('+'.($config['cf_point_term'] - 1).' days', G5_SERVER_TIME));
|
||||
}
|
||||
|
||||
$po_expired = 0;
|
||||
if($point < 0) {
|
||||
$po_expired = 1;
|
||||
$po_expire_date = G4_TIME_YMD;
|
||||
$po_expire_date = G5_TIME_YMD;
|
||||
}
|
||||
$po_mb_point = $mb_point + $point;
|
||||
|
||||
$sql = " insert into {$g4['point_table']}
|
||||
$sql = " insert into {$g5['point_table']}
|
||||
set mb_id = '$mb_id',
|
||||
po_datetime = '".G4_TIME_YMDHIS."',
|
||||
po_datetime = '".G5_TIME_YMDHIS."',
|
||||
po_content = '".addslashes($content)."',
|
||||
po_point = '$point',
|
||||
po_use_point = '0',
|
||||
@ -936,7 +936,7 @@ function insert_point($mb_id, $point, $content='', $rel_table='', $rel_id='', $r
|
||||
}
|
||||
|
||||
// 포인트 UPDATE
|
||||
$sql = " update {$g4['member_table']} set mb_point = '$po_mb_point' where mb_id = '$mb_id' ";
|
||||
$sql = " update {$g5['member_table']} set mb_point = '$po_mb_point' where mb_id = '$mb_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
return 1;
|
||||
@ -945,7 +945,7 @@ function insert_point($mb_id, $point, $content='', $rel_table='', $rel_id='', $r
|
||||
// 사용포인트 입력
|
||||
function insert_use_point($mb_id, $point, $po_id='')
|
||||
{
|
||||
global $g4, $config;
|
||||
global $g5, $config;
|
||||
|
||||
if($config['cf_point_term'])
|
||||
$sql_order = " order by po_expire_date asc, po_id asc ";
|
||||
@ -954,7 +954,7 @@ function insert_use_point($mb_id, $point, $po_id='')
|
||||
|
||||
$point1 = abs($point);
|
||||
$sql = " select po_id, po_point, po_use_point
|
||||
from {$g4['point_table']}
|
||||
from {$g5['point_table']}
|
||||
where mb_id = '$mb_id'
|
||||
and po_id <> '$po_id'
|
||||
and po_expired = '0'
|
||||
@ -966,14 +966,14 @@ function insert_use_point($mb_id, $point, $po_id='')
|
||||
$point3 = $row['po_use_point'];
|
||||
|
||||
if(($point2 - $point3) > $point1) {
|
||||
$sql = " update {$g4['point_table']}
|
||||
$sql = " update {$g5['point_table']}
|
||||
set po_use_point = po_use_point + '$point1'
|
||||
where po_id = '{$row['po_id']}' ";
|
||||
sql_query($sql);
|
||||
break;
|
||||
} else {
|
||||
$point4 = $point2 - $point3;
|
||||
$sql = " update {$g4['point_table']}
|
||||
$sql = " update {$g5['point_table']}
|
||||
set po_use_point = po_use_point + '$point4',
|
||||
po_expired = '100'
|
||||
where po_id = '{$row['po_id']}' ";
|
||||
@ -986,7 +986,7 @@ function insert_use_point($mb_id, $point, $po_id='')
|
||||
// 사용포인트 삭제
|
||||
function delete_use_point($mb_id, $point)
|
||||
{
|
||||
global $g4, $config;
|
||||
global $g5, $config;
|
||||
|
||||
if($config['cf_point_term'])
|
||||
$sql_order = " order by po_expire_date desc, po_id desc ";
|
||||
@ -995,7 +995,7 @@ function delete_use_point($mb_id, $point)
|
||||
|
||||
$point1 = abs($point);
|
||||
$sql = " select po_id, po_use_point, po_expired, po_expire_date
|
||||
from {$g4['point_table']}
|
||||
from {$g5['point_table']}
|
||||
where mb_id = '$mb_id'
|
||||
and po_expired <> '1'
|
||||
and po_use_point > 0
|
||||
@ -1005,18 +1005,18 @@ function delete_use_point($mb_id, $point)
|
||||
$point2 = $row['po_use_point'];
|
||||
|
||||
$po_expired = $row['po_expired'];
|
||||
if($row['po_expired'] == 100 && ($row['po_expire_date'] == '9999-12-31' || $row['po_expire_date'] >= G4_TIME_YMD))
|
||||
if($row['po_expired'] == 100 && ($row['po_expire_date'] == '9999-12-31' || $row['po_expire_date'] >= G5_TIME_YMD))
|
||||
$po_expired = 0;
|
||||
|
||||
if($point2 > $point1) {
|
||||
$sql = " update {$g4['point_table']}
|
||||
$sql = " update {$g5['point_table']}
|
||||
set po_use_point = po_use_point - '$point1',
|
||||
po_expired = '$po_expired'
|
||||
where po_id = '{$row['po_id']}' ";
|
||||
sql_query($sql);
|
||||
break;
|
||||
} else {
|
||||
$sql = " update {$g4['point_table']}
|
||||
$sql = " update {$g5['point_table']}
|
||||
set po_use_point = '0',
|
||||
po_expired = '$po_expired'
|
||||
where po_id = '{$row['po_id']}' ";
|
||||
@ -1030,11 +1030,11 @@ function delete_use_point($mb_id, $point)
|
||||
// 소멸포인트 삭제
|
||||
function delete_expire_point($mb_id, $point)
|
||||
{
|
||||
global $g4, $config;
|
||||
global $g5, $config;
|
||||
|
||||
$point1 = abs($point);
|
||||
$sql = " select po_id, po_use_point, po_expired, po_expire_date
|
||||
from {$g4['point_table']}
|
||||
from {$g5['point_table']}
|
||||
where mb_id = '$mb_id'
|
||||
and po_expired = '1'
|
||||
and po_point >= 0
|
||||
@ -1046,10 +1046,10 @@ function delete_expire_point($mb_id, $point)
|
||||
$po_expired = '0';
|
||||
$po_expire_date = '9999-12-31';
|
||||
if($config['cf_point_term'] > 0)
|
||||
$po_expire_date = date('Y-m-d', strtotime('+'.($config['cf_point_term'] - 1).' days', G4_SERVER_TIME));
|
||||
$po_expire_date = date('Y-m-d', strtotime('+'.($config['cf_point_term'] - 1).' days', G5_SERVER_TIME));
|
||||
|
||||
if($point2 > $point1) {
|
||||
$sql = " update {$g4['point_table']}
|
||||
$sql = " update {$g5['point_table']}
|
||||
set po_use_point = po_use_point - '$point1',
|
||||
po_expired = '$po_expired',
|
||||
po_expire_date = '$po_expire_date'
|
||||
@ -1057,7 +1057,7 @@ function delete_expire_point($mb_id, $point)
|
||||
sql_query($sql);
|
||||
break;
|
||||
} else {
|
||||
$sql = " update {$g4['point_table']}
|
||||
$sql = " update {$g5['point_table']}
|
||||
set po_use_point = '0',
|
||||
po_expired = '$po_expired',
|
||||
po_expire_date = '$po_expire_date'
|
||||
@ -1072,7 +1072,7 @@ function delete_expire_point($mb_id, $point)
|
||||
// 포인트 내역 합계
|
||||
function get_point_sum($mb_id)
|
||||
{
|
||||
global $g4, $config;
|
||||
global $g5, $config;
|
||||
|
||||
if($config['cf_point_term'] > 0) {
|
||||
// 소멸포인트가 있으면 내역 추가
|
||||
@ -1085,12 +1085,12 @@ function get_point_sum($mb_id)
|
||||
$rel_action = 'expire'.'-'.uniqid('');
|
||||
$point = $expire_point * (-1);
|
||||
$po_mb_point = $mb['mb_point'] + $point;
|
||||
$po_expire_date = G4_TIME_YMD;
|
||||
$po_expire_date = G5_TIME_YMD;
|
||||
$po_expired = 1;
|
||||
|
||||
$sql = " insert into {$g4['point_table']}
|
||||
$sql = " insert into {$g5['point_table']}
|
||||
set mb_id = '$mb_id',
|
||||
po_datetime = '".G4_TIME_YMDHIS."',
|
||||
po_datetime = '".G5_TIME_YMDHIS."',
|
||||
po_content = '".addslashes($content)."',
|
||||
po_point = '$point',
|
||||
po_use_point = '0',
|
||||
@ -1109,18 +1109,18 @@ function get_point_sum($mb_id)
|
||||
}
|
||||
|
||||
// 유효기간이 있을 때 기간이 지난 포인트 expired 체크
|
||||
$sql = " update {$g4['point_table']}
|
||||
$sql = " update {$g5['point_table']}
|
||||
set po_expired = '1'
|
||||
where mb_id = '$mb_id'
|
||||
and po_expired <> '1'
|
||||
and po_expire_date <> '9999-12-31'
|
||||
and po_expire_date < '".G4_TIME_YMD."' ";
|
||||
and po_expire_date < '".G5_TIME_YMD."' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
// 포인트합
|
||||
$sql = " select sum(po_point) as sum_po_point
|
||||
from {$g4['point_table']}
|
||||
from {$g5['point_table']}
|
||||
where mb_id = '$mb_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
@ -1130,17 +1130,17 @@ function get_point_sum($mb_id)
|
||||
// 소멸 포인트
|
||||
function get_expire_point($mb_id)
|
||||
{
|
||||
global $g4, $config;
|
||||
global $g5, $config;
|
||||
|
||||
if($config['cf_point_term'] == 0)
|
||||
return 0;
|
||||
|
||||
$sql = " select sum(po_point - po_use_point) as sum_point
|
||||
from {$g4['point_table']}
|
||||
from {$g5['point_table']}
|
||||
where mb_id = '$mb_id'
|
||||
and po_expired = '0'
|
||||
and po_expire_date <> '9999-12-31'
|
||||
and po_expire_date < '".G4_TIME_YMD."' ";
|
||||
and po_expire_date < '".G5_TIME_YMD."' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
return $row['sum_point'];
|
||||
@ -1149,13 +1149,13 @@ function get_expire_point($mb_id)
|
||||
// 포인트 삭제
|
||||
function delete_point($mb_id, $rel_table, $rel_id, $rel_action)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$result = false;
|
||||
if ($rel_table || $rel_id || $rel_action)
|
||||
{
|
||||
// 포인트 내역정보
|
||||
$sql = " select * from {$g4['point_table']}
|
||||
$sql = " select * from {$g5['point_table']}
|
||||
where mb_id = '$mb_id'
|
||||
and po_rel_table = '$rel_table'
|
||||
and po_rel_id = '$rel_id'
|
||||
@ -1173,14 +1173,14 @@ function delete_point($mb_id, $rel_table, $rel_id, $rel_action)
|
||||
}
|
||||
}
|
||||
|
||||
$result = sql_query(" delete from {$g4['point_table']}
|
||||
$result = sql_query(" delete from {$g5['point_table']}
|
||||
where mb_id = '$mb_id'
|
||||
and po_rel_table = '$rel_table'
|
||||
and po_rel_id = '$rel_id'
|
||||
and po_rel_action = '$rel_action' ", false);
|
||||
|
||||
// po_mb_point에 반영
|
||||
$sql = " update {$g4['point_table']}
|
||||
$sql = " update {$g5['point_table']}
|
||||
set po_mb_point = po_mb_point - '{$row['po_point']}'
|
||||
where mb_id = '$mb_id'
|
||||
and po_id > '{$row['po_id']}' ";
|
||||
@ -1190,7 +1190,7 @@ function delete_point($mb_id, $rel_table, $rel_id, $rel_action)
|
||||
$sum_point = get_point_sum($mb_id);
|
||||
|
||||
// 포인트 UPDATE
|
||||
$sql = " update {$g4['member_table']} set mb_point = '$sum_point' where mb_id = '$mb_id' ";
|
||||
$sql = " update {$g5['member_table']} set mb_point = '$sum_point' where mb_id = '$mb_id' ";
|
||||
$result = sql_query($sql);
|
||||
}
|
||||
|
||||
@ -1201,7 +1201,7 @@ function delete_point($mb_id, $rel_table, $rel_id, $rel_action)
|
||||
function get_sideview($mb_id, $name='', $email='', $homepage='')
|
||||
{
|
||||
global $config;
|
||||
global $g4;
|
||||
global $g5;
|
||||
global $bo_table, $sca, $is_admin;
|
||||
|
||||
$email = base64_encode($email);
|
||||
@ -1214,17 +1214,17 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
|
||||
|
||||
$tmp_name = "";
|
||||
if ($mb_id) {
|
||||
//$tmp_name = "<a href=\"".G4_BBS_URL."/profile.php?mb_id=".$mb_id."\" class=\"sv_member\" title=\"$name 자기소개\" target=\"_blank\" onclick=\"return false;\">$name</a>";
|
||||
$tmp_name = '<a href="'.G4_BBS_URL.'/profile.php?mb_id='.$mb_id.'" class="sv_member" title="'.$name.' 자기소개" target="_blank" onclick="return false;">';
|
||||
//$tmp_name = "<a href=\"".G5_BBS_URL."/profile.php?mb_id=".$mb_id."\" class=\"sv_member\" title=\"$name 자기소개\" target=\"_blank\" onclick=\"return false;\">$name</a>";
|
||||
$tmp_name = '<a href="'.G5_BBS_URL.'/profile.php?mb_id='.$mb_id.'" class="sv_member" title="'.$name.' 자기소개" target="_blank" onclick="return false;">';
|
||||
|
||||
if ($config['cf_use_member_icon']) {
|
||||
$mb_dir = substr($mb_id,0,2);
|
||||
$icon_file = G4_DATA_PATH.'/member/'.$mb_dir.'/'.$mb_id.'.gif';
|
||||
$icon_file = G5_DATA_PATH.'/member/'.$mb_dir.'/'.$mb_id.'.gif';
|
||||
|
||||
if (file_exists($icon_file)) {
|
||||
$width = $config['cf_member_icon_width'];
|
||||
$height = $config['cf_member_icon_height'];
|
||||
$icon_file_url = G4_DATA_URL.'/member/'.$mb_dir.'/'.$mb_id.'.gif';
|
||||
$icon_file_url = G5_DATA_URL.'/member/'.$mb_dir.'/'.$mb_id.'.gif';
|
||||
$tmp_name .= '<img src="'.$icon_file_url.'" width="'.$width.'" height="'.$height.'" alt="">';
|
||||
|
||||
if ($config['cf_use_member_icon'] == 2) // 회원아이콘+이름
|
||||
@ -1242,7 +1242,7 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
|
||||
if(!$bo_table)
|
||||
return $name;
|
||||
|
||||
$tmp_name = '<a href="'.G4_BBS_URL.'/board.php?bo_table='.$bo_table.'&sca='.$sca.'&sfl=wr_name,1&stx='.$name.'" title="'.$name.' 이름으로 검색" class="sv_guest" onclick="return false;">'.$name.'</a>';
|
||||
$tmp_name = '<a href="'.G5_BBS_URL.'/board.php?bo_table='.$bo_table.'&sca='.$sca.'&sfl=wr_name,1&stx='.$name.'" title="'.$name.' 이름으로 검색" class="sv_guest" onclick="return false;">'.$name.'</a>';
|
||||
$title_mb_id = '[비회원]';
|
||||
}
|
||||
|
||||
@ -1253,27 +1253,27 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
|
||||
$str = "<span class=\"sv_wrap\">\n";
|
||||
$str .= $tmp_name."\n";
|
||||
|
||||
if(!G4_IS_MOBILE) {
|
||||
if(!G5_IS_MOBILE) {
|
||||
$str2 = "<span class=\"sv\">\n";
|
||||
if($mb_id)
|
||||
$str2 .= "<a href=\"".G4_BBS_URL."/memo_form.php?me_recv_mb_id=".$mb_id."\" onclick=\"win_memo(this.href); return false;\">쪽지보내기</a>\n";
|
||||
$str2 .= "<a href=\"".G5_BBS_URL."/memo_form.php?me_recv_mb_id=".$mb_id."\" onclick=\"win_memo(this.href); return false;\">쪽지보내기</a>\n";
|
||||
if($email)
|
||||
$str2 .= "<a href=\"".G4_BBS_URL."/formmail.php?mb_id=".$mb_id."&name=".urlencode($name)."&email=".$email."\" onclick=\"win_email(this.href); return false;\">메일보내기</a>\n";
|
||||
$str2 .= "<a href=\"".G5_BBS_URL."/formmail.php?mb_id=".$mb_id."&name=".urlencode($name)."&email=".$email."\" onclick=\"win_email(this.href); return false;\">메일보내기</a>\n";
|
||||
if($homepage)
|
||||
$str2 .= "<a href=\"".$homepage."\" target=\"_blank\">홈페이지</a>\n";
|
||||
if($mb_id)
|
||||
$str2 .= "<a href=\"".G4_BBS_URL."/profile.php?mb_id=".$mb_id."\" onclick=\"win_profile(this.href); return false;\">자기소개</a>\n";
|
||||
$str2 .= "<a href=\"".G5_BBS_URL."/profile.php?mb_id=".$mb_id."\" onclick=\"win_profile(this.href); return false;\">자기소개</a>\n";
|
||||
if($bo_table) {
|
||||
if($mb_id)
|
||||
$str2 .= "<a href=\"".G4_BBS_URL."/board.php?bo_table=".$bo_table."&sca=".$sca."&sfl=mb_id,1&stx=".$mb_id."\">아이디로 검색</a>\n";
|
||||
$str2 .= "<a href=\"".G5_BBS_URL."/board.php?bo_table=".$bo_table."&sca=".$sca."&sfl=mb_id,1&stx=".$mb_id."\">아이디로 검색</a>\n";
|
||||
else
|
||||
$str2 .= "<a href=\"".G4_BBS_URL."/board.php?bo_table=".$bo_table."&sca=".$sca."&sfl=wr_name,1&stx=".$name."\">이름으로 검색</a>\n";
|
||||
$str2 .= "<a href=\"".G5_BBS_URL."/board.php?bo_table=".$bo_table."&sca=".$sca."&sfl=wr_name,1&stx=".$name."\">이름으로 검색</a>\n";
|
||||
}
|
||||
if($mb_id)
|
||||
$str2 .= "<a href=\"".G4_BBS_URL."/new.php?mb_id=".$mb_id."\">전체게시물</a>\n";
|
||||
$str2 .= "<a href=\"".G5_BBS_URL."/new.php?mb_id=".$mb_id."\">전체게시물</a>\n";
|
||||
if($is_admin == "super" && $mb_id) {
|
||||
$str2 .= "<a href=\"".G4_ADMIN_URL."/member_form.php?w=u&mb_id=".$mb_id."\" target=\"_blank\">회원정보변경</a>\n";
|
||||
$str2 .= "<a href=\"".G4_ADMIN_URL."/point_list.php?sfl=mb_id&stx=".$mb_id."\" target=\"_blank\">포인트내역</a>\n";
|
||||
$str2 .= "<a href=\"".G5_ADMIN_URL."/member_form.php?w=u&mb_id=".$mb_id."\" target=\"_blank\">회원정보변경</a>\n";
|
||||
$str2 .= "<a href=\"".G5_ADMIN_URL."/point_list.php?sfl=mb_id&stx=".$mb_id."\" target=\"_blank\">포인트내역</a>\n";
|
||||
}
|
||||
$str2 .= "</span>\n";
|
||||
$str .= $str2;
|
||||
@ -1290,7 +1290,7 @@ function get_sideview($mb_id, $name='', $email='', $homepage='')
|
||||
function view_file_link($file, $width, $height, $content='')
|
||||
{
|
||||
global $config, $board;
|
||||
global $g4;
|
||||
global $g5;
|
||||
static $ids;
|
||||
|
||||
if (!$file) return;
|
||||
@ -1312,8 +1312,8 @@ function view_file_link($file, $width, $height, $content='')
|
||||
$attr = '';
|
||||
|
||||
if (preg_match("/\.({$config['cf_image_extension']})$/i", $file)) {
|
||||
$img = '<a href="'.G4_BBS_URL.'/view_image.php?bo_table='.$board['bo_table'].'&fn='.urlencode($file).'" target="_blank" class="view_image">';
|
||||
$img .= '<img src="'.G4_DATA_URL.'/file/'.$board['bo_table'].'/'.urlencode($file).'" alt="'.$content.'">';
|
||||
$img = '<a href="'.G5_BBS_URL.'/view_image.php?bo_table='.$board['bo_table'].'&fn='.urlencode($file).'" target="_blank" class="view_image">';
|
||||
$img .= '<img src="'.G5_DATA_URL.'/file/'.$board['bo_table'].'/'.urlencode($file).'" alt="'.$content.'">';
|
||||
$img .= '</a>';
|
||||
|
||||
return $img;
|
||||
@ -1428,7 +1428,7 @@ function html_symbol($str)
|
||||
// DB 연결
|
||||
function sql_connect($host, $user, $pass)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
return @mysql_connect($host, $user, $pass);
|
||||
}
|
||||
@ -1437,7 +1437,7 @@ function sql_connect($host, $user, $pass)
|
||||
// DB 선택
|
||||
function sql_select_db($db, $connect)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
return @mysql_select_db($db, $connect);
|
||||
}
|
||||
@ -1493,7 +1493,7 @@ function sql_password($value)
|
||||
// PHPMyAdmin 참고
|
||||
function get_table_define($table, $crlf="\n")
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
// For MySQL < 3.23.20
|
||||
$schema_create .= 'CREATE TABLE ' . $table . ' (' . $crlf;
|
||||
@ -1571,10 +1571,10 @@ function referer_check($url='')
|
||||
{
|
||||
/*
|
||||
// 제대로 체크를 하지 못하여 주석 처리함
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
if (!$url)
|
||||
$url = G4_URL;
|
||||
$url = G5_URL;
|
||||
|
||||
if (!preg_match("/^http['s']?:\/\/".$_SERVER['HTTP_HOST']."/", $_SERVER['HTTP_REFERER']))
|
||||
alert("제대로 된 접근이 아닌것 같습니다.", $url);
|
||||
@ -1599,11 +1599,11 @@ function get_yoil($date, $full=0)
|
||||
// 날짜를 select 박스 형식으로 얻는다
|
||||
function date_select($date, $name='')
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$s = '';
|
||||
if (substr($date, 0, 4) == "0000") {
|
||||
$date = G4_TIME_YMDHIS;
|
||||
$date = G5_TIME_YMDHIS;
|
||||
}
|
||||
preg_match("/([0-9]{4})-([0-9]{2})-([0-9]{2})/", $date, $m);
|
||||
|
||||
@ -1691,8 +1691,8 @@ function time_select($time, $name="")
|
||||
// DEMO 라는 파일이 있으면 데모 화면으로 인식함
|
||||
function check_demo()
|
||||
{
|
||||
global $g4;
|
||||
if (file_exists($g4['path'].'/DEMO'))
|
||||
global $g5;
|
||||
if (file_exists($g5['path'].'/DEMO'))
|
||||
alert('데모 화면에서는 하실(보실) 수 없는 작업입니다.');
|
||||
}
|
||||
|
||||
@ -1700,7 +1700,7 @@ function check_demo()
|
||||
// 문자열이 한글, 영문, 숫자, 특수문자로 구성되어 있는지 검사
|
||||
function check_string($str, $options)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$s = '';
|
||||
for($i=0;$i<strlen($str);$i++) {
|
||||
@ -1709,37 +1709,37 @@ function check_string($str, $options)
|
||||
|
||||
// 한글
|
||||
if ($oc >= 0xA0 && $oc <= 0xFF) {
|
||||
if ($options & G4_HANGUL) {
|
||||
if ($options & G5_HANGUL) {
|
||||
$s .= $c . $str[$i+1] . $str[$i+2];
|
||||
}
|
||||
$i+=2;
|
||||
}
|
||||
// 숫자
|
||||
else if ($oc >= 0x30 && $oc <= 0x39) {
|
||||
if ($options & G4_NUMERIC) {
|
||||
if ($options & G5_NUMERIC) {
|
||||
$s .= $c;
|
||||
}
|
||||
}
|
||||
// 영대문자
|
||||
else if ($oc >= 0x41 && $oc <= 0x5A) {
|
||||
if (($options & G4_ALPHABETIC) || ($options & G4_ALPHAUPPER)) {
|
||||
if (($options & G5_ALPHABETIC) || ($options & G5_ALPHAUPPER)) {
|
||||
$s .= $c;
|
||||
}
|
||||
}
|
||||
// 영소문자
|
||||
else if ($oc >= 0x61 && $oc <= 0x7A) {
|
||||
if (($options & G4_ALPHABETIC) || ($options & G4_ALPHALOWER)) {
|
||||
if (($options & G5_ALPHABETIC) || ($options & G5_ALPHALOWER)) {
|
||||
$s .= $c;
|
||||
}
|
||||
}
|
||||
// 공백
|
||||
else if ($oc == 0x20) {
|
||||
if ($options & G4_SPACE) {
|
||||
if ($options & G5_SPACE) {
|
||||
$s .= $c;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($options & G4_SPECIAL) {
|
||||
if ($options & G5_SPECIAL) {
|
||||
$s .= $c;
|
||||
}
|
||||
}
|
||||
@ -1754,7 +1754,7 @@ function check_string($str, $options)
|
||||
// 출력시 깨지는 현상이 발생하므로 마지막 완전하지 않은 글자(1byte)를 하나 없앰
|
||||
function cut_hangul_last($hangul)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
// 한글이 반쪽나면 ?로 표시되는 현상을 막음
|
||||
$cnt = 0;
|
||||
@ -1921,7 +1921,7 @@ function get_selected($field, $value)
|
||||
|
||||
function is_mobile()
|
||||
{
|
||||
return preg_match('/'.G4_MOBILE_AGENT.'/i', $_SERVER['HTTP_USER_AGENT']);
|
||||
return preg_match('/'.G5_MOBILE_AGENT.'/i', $_SERVER['HTTP_USER_AGENT']);
|
||||
}
|
||||
|
||||
|
||||
@ -1943,14 +1943,14 @@ function is_mobile()
|
||||
// 기존의 get_unique_id() 함수를 사용하지 않고 get_uniqid() 를 사용한다.
|
||||
function get_uniqid()
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
sql_query(" LOCK TABLE {$g4['uniqid_table']} WRITE ");
|
||||
sql_query(" LOCK TABLE {$g5['uniqid_table']} WRITE ");
|
||||
while (1) {
|
||||
// 년월일시분초에 100분의 1초 두자리를 추가함 (1/100 초 앞에 자리가 모자르면 0으로 채움)
|
||||
$key = date('YmdHis', time()) . str_pad((int)(microtime()*100), 2, "0", STR_PAD_LEFT);
|
||||
|
||||
$result = sql_query(" insert into {$g4['uniqid_table']} set uq_id = '$key', uq_ip = '{$_SERVER['REMOTE_ADDR']}' ", false);
|
||||
$result = sql_query(" insert into {$g5['uniqid_table']} set uq_id = '$key', uq_ip = '{$_SERVER['REMOTE_ADDR']}' ", false);
|
||||
if ($result) break; // 쿼리가 정상이면 빠진다.
|
||||
|
||||
// insert 하지 못했으면 일정시간 쉰다음 다시 유일키를 만든다.
|
||||
@ -1983,10 +1983,10 @@ function check_device($device)
|
||||
|
||||
if ($is_admin) return;
|
||||
|
||||
if ($device=='pc' && G4_IS_MOBILE) {
|
||||
alert('PC 전용 게시판입니다.', G4_URL);
|
||||
} else if ($device=='mobile' && !G4_IS_MOBILE) {
|
||||
alert('모바일 전용 게시판입니다.', G4_URL);
|
||||
if ($device=='pc' && G5_IS_MOBILE) {
|
||||
alert('PC 전용 게시판입니다.', G5_URL);
|
||||
} else if ($device=='mobile' && !G5_IS_MOBILE) {
|
||||
alert('모바일 전용 게시판입니다.', G5_URL);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1994,7 +1994,7 @@ function check_device($device)
|
||||
// 게시판 최신글 캐시 파일 삭제
|
||||
function delete_cache_latest($bo_table)
|
||||
{
|
||||
$files = glob(G4_DATA_PATH.'/cache/latest-'.$bo_table.'-*');
|
||||
$files = glob(G5_DATA_PATH.'/cache/latest-'.$bo_table.'-*');
|
||||
if (is_array($files)) {
|
||||
foreach ($files as $filename)
|
||||
unlink($filename);
|
||||
@ -2008,7 +2008,7 @@ function delete_board_thumbnail($bo_table, $file)
|
||||
return;
|
||||
|
||||
$fn = preg_replace("/\.[^\.]+$/i", "", basename($file));
|
||||
$files = glob(G4_DATA_PATH.'/file/'.$bo_table.'/thumb-'.$fn.'*');
|
||||
$files = glob(G5_DATA_PATH.'/file/'.$bo_table.'/thumb-'.$fn.'*');
|
||||
if (is_array($files)) {
|
||||
foreach ($files as $filename)
|
||||
unlink($filename);
|
||||
@ -2067,7 +2067,7 @@ function get_skin_stylesheet($skin_path, $dir='')
|
||||
if($dir)
|
||||
$skin_path .= '/'.$dir;
|
||||
|
||||
$skin_url = G4_URL.str_replace("\\", "/", str_replace(G4_PATH, "", $skin_path));
|
||||
$skin_url = G5_URL.str_replace("\\", "/", str_replace(G5_PATH, "", $skin_path));
|
||||
|
||||
if(is_dir($skin_path)) {
|
||||
if($dh = opendir($skin_path)) {
|
||||
@ -2101,7 +2101,7 @@ function get_skin_stylesheet($skin_path, $dir='')
|
||||
$skin_path .= $dir ? '/'.$dir : '';
|
||||
|
||||
$str = '';
|
||||
$skin_url = G4_URL.str_replace('\\', '/', str_replace(G4_PATH, '', $skin_path));
|
||||
$skin_url = G5_URL.str_replace('\\', '/', str_replace(G5_PATH, '', $skin_path));
|
||||
|
||||
foreach (glob($skin_path.'/*.css') as $filepath) {
|
||||
$file = str_replace($skin_path, '', $filepath);
|
||||
@ -2123,7 +2123,7 @@ function get_skin_javascript($skin_path, $dir='')
|
||||
if($dir)
|
||||
$skin_path .= '/'.$dir;
|
||||
|
||||
$skin_url = G4_URL.str_replace("\\", "/", str_replace(G4_PATH, "", $skin_path));
|
||||
$skin_url = G5_URL.str_replace("\\", "/", str_replace(G5_PATH, "", $skin_path));
|
||||
|
||||
if(is_dir($skin_path)) {
|
||||
if($dh = opendir($skin_path)) {
|
||||
@ -2171,25 +2171,25 @@ if (!function_exists('file_put_contents')) {
|
||||
// HTML 마지막 처리
|
||||
function html_end()
|
||||
{
|
||||
global $config, $g4, $member;
|
||||
global $config, $g5, $member;
|
||||
|
||||
// 현재접속자 처리
|
||||
$tmp_sql = " select count(*) as cnt from {$g4['login_table']} where lo_ip = '{$_SERVER['REMOTE_ADDR']}' ";
|
||||
$tmp_sql = " select count(*) as cnt from {$g5['login_table']} where lo_ip = '{$_SERVER['REMOTE_ADDR']}' ";
|
||||
$tmp_row = sql_fetch($tmp_sql);
|
||||
|
||||
if ($tmp_row['cnt']) {
|
||||
$tmp_sql = " update {$g4['login_table']} set mb_id = '{$member['mb_id']}', lo_datetime = '".G4_TIME_YMDHIS."', lo_location = '{$g4['lo_location']}', lo_url = '{$g4['lo_url']}' where lo_ip = '{$_SERVER['REMOTE_ADDR']}' ";
|
||||
$tmp_sql = " update {$g5['login_table']} set mb_id = '{$member['mb_id']}', lo_datetime = '".G5_TIME_YMDHIS."', lo_location = '{$g5['lo_location']}', lo_url = '{$g5['lo_url']}' where lo_ip = '{$_SERVER['REMOTE_ADDR']}' ";
|
||||
sql_query($tmp_sql, FALSE);
|
||||
} else {
|
||||
$tmp_sql = " insert into {$g4['login_table']} ( lo_ip, mb_id, lo_datetime, lo_location, lo_url ) values ( '{$_SERVER['REMOTE_ADDR']}', '{$member['mb_id']}', '".G4_TIME_YMDHIS."', '{$g4['lo_location']}', '{$g4['lo_url']}' ) ";
|
||||
$tmp_sql = " insert into {$g5['login_table']} ( lo_ip, mb_id, lo_datetime, lo_location, lo_url ) values ( '{$_SERVER['REMOTE_ADDR']}', '{$member['mb_id']}', '".G5_TIME_YMDHIS."', '{$g5['lo_location']}', '{$g5['lo_url']}' ) ";
|
||||
sql_query($tmp_sql, FALSE);
|
||||
|
||||
// 시간이 지난 접속은 삭제한다
|
||||
sql_query(" delete from {$g4['login_table']} where lo_datetime < '".date("Y-m-d H:i:s", G4_SERVER_TIME - (60 * $config['cf_login_minutes']))."' ");
|
||||
sql_query(" delete from {$g5['login_table']} where lo_datetime < '".date("Y-m-d H:i:s", G5_SERVER_TIME - (60 * $config['cf_login_minutes']))."' ");
|
||||
|
||||
// 부담(overhead)이 있다면 테이블 최적화
|
||||
//$row = sql_fetch(" SHOW TABLE STATUS FROM `$mysql_db` LIKE '$g4['login_table']' ");
|
||||
//if ($row['Data_free'] > 0) sql_query(" OPTIMIZE TABLE $g4['login_table'] ");
|
||||
//$row = sql_fetch(" SHOW TABLE STATUS FROM `$mysql_db` LIKE '$g5['login_table']' ");
|
||||
//if ($row['Data_free'] > 0) sql_query(" OPTIMIZE TABLE $g5['login_table'] ");
|
||||
}
|
||||
|
||||
// 버퍼의 내용에서 body 태그 중간의 외부 css 파일을 CAPTURE 하여 head 태그로 이동시켜준다.
|
||||
@ -2224,7 +2224,7 @@ function hyphen_hp_number($hp)
|
||||
// 로그인 후 이동할 URL
|
||||
function login_url($url='')
|
||||
{
|
||||
if (!$url) $url = G4_URL;
|
||||
if (!$url) $url = G5_URL;
|
||||
//$p = parse_url($url);
|
||||
//return $url.urldecode(preg_replace("/^".urlencode($p['path'])."/", "", urlencode($_SERVER['REQUEST_URI'])));
|
||||
return $url;
|
||||
@ -2235,16 +2235,16 @@ function login_url($url='')
|
||||
function https_url($dir, $https=true)
|
||||
{
|
||||
if ($https) {
|
||||
if (G4_HTTPS_DOMAIN) {
|
||||
$url = G4_HTTPS_DOMAIN.'/'.$dir;
|
||||
if (G5_HTTPS_DOMAIN) {
|
||||
$url = G5_HTTPS_DOMAIN.'/'.$dir;
|
||||
} else {
|
||||
$url = G4_URL.'/'.$dir;
|
||||
$url = G5_URL.'/'.$dir;
|
||||
}
|
||||
} else {
|
||||
if (G4_DOMAIN) {
|
||||
$url = G4_DOMAIN.'/'.$dir;
|
||||
if (G5_DOMAIN) {
|
||||
$url = G5_DOMAIN.'/'.$dir;
|
||||
} else {
|
||||
$url = G4_URL.'/'.$dir;
|
||||
$url = G5_URL.'/'.$dir;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2308,10 +2308,10 @@ function googl_short_url($longUrl)
|
||||
// 임시 저장된 글 갯수
|
||||
function autosave_count($mb_id)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
if ($mb_id) {
|
||||
$row = sql_fetch(" select count(*) as cnt from {$g4['autosave_table']} where mb_id = '$mb_id' ");
|
||||
$row = sql_fetch(" select count(*) as cnt from {$g5['autosave_table']} where mb_id = '$mb_id' ");
|
||||
return (int)$row['cnt'];
|
||||
} else {
|
||||
return 0;
|
||||
@ -2321,22 +2321,22 @@ function autosave_count($mb_id)
|
||||
// 본인확인내역 기록
|
||||
function insert_cert_history($mb_id, $company, $method)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$sql = " insert into {$g4['cert_history_table']}
|
||||
$sql = " insert into {$g5['cert_history_table']}
|
||||
set mb_id = '$mb_id',
|
||||
cr_company = '$company',
|
||||
cr_method = '$method',
|
||||
cr_ip = '{$_SERVER['REMOTE_ADDR']}',
|
||||
cr_date = '".G4_TIME_YMD."',
|
||||
cr_time = '".G4_TIME_HIS."' ";
|
||||
cr_date = '".G5_TIME_YMD."',
|
||||
cr_time = '".G5_TIME_HIS."' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
// 인증시도회수 체크
|
||||
function certify_count_check($mb_id, $type)
|
||||
{
|
||||
global $g4, $config;
|
||||
global $g5, $config;
|
||||
|
||||
if($config['cf_cert_use'] != 2)
|
||||
return;
|
||||
@ -2344,7 +2344,7 @@ function certify_count_check($mb_id, $type)
|
||||
if($config['cf_cert_limit'] == 0)
|
||||
return;
|
||||
|
||||
$sql = " select count(*) as cnt from {$g4['cert_history_table']} ";
|
||||
$sql = " select count(*) as cnt from {$g5['cert_history_table']} ";
|
||||
|
||||
if($mb_id) {
|
||||
$sql .= " where mb_id = '$mb_id' ";
|
||||
@ -2352,7 +2352,7 @@ function certify_count_check($mb_id, $type)
|
||||
$sql .= " where cr_ip = '{$_SERVER['REMOTE_ADDR']}' ";
|
||||
}
|
||||
|
||||
$sql .= " and cr_method = '".$type."' and cr_date = '".G4_TIME_YMD."' ";
|
||||
$sql .= " and cr_method = '".$type."' and cr_date = '".G5_TIME_YMD."' ";
|
||||
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
|
||||
@ -4,20 +4,20 @@ if (!defined('_GNUBOARD_')) exit;
|
||||
// 현재 접속자수 출력
|
||||
function connect($skin_dir='')
|
||||
{
|
||||
global $config, $g4;
|
||||
global $config, $g5;
|
||||
|
||||
// 회원, 방문객 카운트
|
||||
$sql = " select sum(IF(mb_id<>'',1,0)) as mb_cnt, count(*) as total_cnt from {$g4['login_table']} where mb_id <> '{$config['cf_admin']}' ";
|
||||
$sql = " select sum(IF(mb_id<>'',1,0)) as mb_cnt, count(*) as total_cnt from {$g5['login_table']} where mb_id <> '{$config['cf_admin']}' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if (!$skin_dir)
|
||||
$skin_dir = $config['cf_connect_skin'];
|
||||
if(G4_IS_MOBILE) {
|
||||
$connect_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/connect/'.$skin_dir;
|
||||
$connect_skin_url = G4_MOBILE_URL.'/'.G4_SKIN_DIR.'/connect/'.$skin_dir;
|
||||
if(G5_IS_MOBILE) {
|
||||
$connect_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/connect/'.$skin_dir;
|
||||
$connect_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/connect/'.$skin_dir;
|
||||
} else {
|
||||
$connect_skin_path = G4_SKIN_PATH.'/connect/'.$skin_dir;
|
||||
$connect_skin_url = G4_SKIN_URL.'/connect/'.$skin_dir;
|
||||
$connect_skin_path = G5_SKIN_PATH.'/connect/'.$skin_dir;
|
||||
$connect_skin_url = G5_SKIN_URL.'/connect/'.$skin_dir;
|
||||
}
|
||||
|
||||
ob_start();
|
||||
|
||||
@ -60,7 +60,7 @@ class SMS {
|
||||
}
|
||||
|
||||
function Add($dest, $callBack, $Caller, $msg, $rsvTime="") {
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
// 내용 검사 1
|
||||
$Error = CheckCommonType($dest, $rsvTime);
|
||||
@ -70,7 +70,7 @@ class SMS {
|
||||
if ( preg_match("/[^0-9]/i",$callBack) ) return "회신 전화번호가 잘못되었습니다";
|
||||
|
||||
// 아이코드에서는 문자에 utf-8 인코딩 형식을 아직 지원하지 않는다.
|
||||
if (strtolower($g4['charset'])=='utf-8') {
|
||||
if (strtolower($g5['charset'])=='utf-8') {
|
||||
if (function_exists("iconv")) {
|
||||
$msg = iconv("utf-8", "euc-kr", $msg);
|
||||
}
|
||||
|
||||
@ -4,27 +4,27 @@ if (!defined('_GNUBOARD_')) exit;
|
||||
// 최신글 추출
|
||||
function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
static $css = array();
|
||||
|
||||
if (!$skin_dir) $skin_dir = 'basic';
|
||||
|
||||
if(G4_IS_MOBILE) {
|
||||
$latest_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/latest/'.$skin_dir;
|
||||
$latest_skin_url = G4_MOBILE_URL.'/'.G4_SKIN_DIR.'/latest/'.$skin_dir;
|
||||
if(G5_IS_MOBILE) {
|
||||
$latest_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;
|
||||
$latest_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;
|
||||
} else {
|
||||
$latest_skin_path = G4_SKIN_PATH.'/latest/'.$skin_dir;
|
||||
$latest_skin_url = G4_SKIN_URL.'/latest/'.$skin_dir;
|
||||
$latest_skin_path = G5_SKIN_PATH.'/latest/'.$skin_dir;
|
||||
$latest_skin_url = G5_SKIN_URL.'/latest/'.$skin_dir;
|
||||
}
|
||||
|
||||
$cache_file = G4_DATA_PATH."/cache/latest-{$bo_table}-{$skin_dir}-{$rows}-{$subject_len}.php";
|
||||
if (!G4_USE_CACHE || !file_exists($cache_file)) {
|
||||
$cache_file = G5_DATA_PATH."/cache/latest-{$bo_table}-{$skin_dir}-{$rows}-{$subject_len}.php";
|
||||
if (!G5_USE_CACHE || !file_exists($cache_file)) {
|
||||
$list = array();
|
||||
|
||||
$sql = " select * from {$g4['board_table']} where bo_table = '{$bo_table}' ";
|
||||
$sql = " select * from {$g5['board_table']} where bo_table = '{$bo_table}' ";
|
||||
$board = sql_fetch($sql);
|
||||
|
||||
$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
|
||||
$tmp_write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
|
||||
$sql = " select * from {$tmp_write_table} where wr_is_comment = 0 order by wr_num limit 0, {$rows} ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row = sql_fetch_array($result); $i++) {
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit;
|
||||
|
||||
include_once(G4_PHPMAILER_PATH.'/class.phpmailer.php');
|
||||
include_once(G5_PHPMAILER_PATH.'/class.phpmailer.php');
|
||||
|
||||
// 메일 보내기 (파일 여러개 첨부 가능)
|
||||
// type : text=0, html=1, text+html=2
|
||||
function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc="", $bcc="")
|
||||
{
|
||||
global $config;
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
// 메일발송 사용을 하지 않는다면
|
||||
if (!$config['cf_email_use']) return;
|
||||
@ -17,9 +17,9 @@ function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc=
|
||||
$content = nl2br($content);
|
||||
|
||||
$mail = new PHPMailer(); // defaults to using php "mail()"
|
||||
if (defined('G4_SMTP')) {
|
||||
if (defined('G5_SMTP')) {
|
||||
$mail->IsSMTP(); // telling the class to use SMTP
|
||||
$mail->Host = G4_SMTP; // SMTP server
|
||||
$mail->Host = G5_SMTP; // SMTP server
|
||||
}
|
||||
$mail->From = $fmail;
|
||||
$mail->FromName = $fname;
|
||||
@ -44,7 +44,7 @@ function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc=
|
||||
function attach_file($filename, $tmp_name)
|
||||
{
|
||||
// 서버에 업로드 되는 파일은 확장자를 주지 않는다. (보안 취약점)
|
||||
$dest_file = G4_DATA_PATH.'/tmp/'.str_replace('/', '_', $tmp_name);
|
||||
$dest_file = G5_DATA_PATH.'/tmp/'.str_replace('/', '_', $tmp_name);
|
||||
move_uploaded_file($tmp_name, $dest_file);
|
||||
/*
|
||||
$fp = fopen($tmp_name, "r");
|
||||
@ -64,7 +64,7 @@ function attach_file($filename, $tmp_name)
|
||||
function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc="", $bcc="")
|
||||
{
|
||||
global $config;
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
// 메일발송 사용을 하지 않는다면
|
||||
if (!$config['cf_email_use']) return;
|
||||
@ -76,7 +76,7 @@ function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc=
|
||||
if ($cc) $header .= "Cc: $cc\n";
|
||||
if ($bcc) $header .= "Bcc: $bcc\n";
|
||||
$header .= "MIME-Version: 1.0\n";
|
||||
$header .= "X-Mailer: SIR Mailer 0.94 : {$_SERVER['SERVER_ADDR']} : {$_SERVER['REMOTE_ADDR']} : ".G4_URL." : {$_SERVER['PHP_SELF']} : {$_SERVER['HTTP_REFERER']} \n";
|
||||
$header .= "X-Mailer: SIR Mailer 0.94 : {$_SERVER['SERVER_ADDR']} : {$_SERVER['REMOTE_ADDR']} : ".G5_URL." : {$_SERVER['PHP_SELF']} : {$_SERVER['HTTP_REFERER']} \n";
|
||||
$header .= "Date: ".date ("D, j M Y H:i:s T",time())."\r\n".
|
||||
"To: $to\r\n".
|
||||
"Subject: =?utf-8?B?".base64_encode($subject)."?=\r\n";
|
||||
@ -127,8 +127,8 @@ function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc=
|
||||
$mails['from'] = $fmail;
|
||||
$mails['text'] = $header.$body;
|
||||
|
||||
if (defined(G4_SMTP)) {
|
||||
ini_set('SMTP', G4_SMTP);
|
||||
if (defined(G5_SMTP)) {
|
||||
ini_set('SMTP', G5_SMTP);
|
||||
@mail($to, $subject, $body, $header, "-f $fmail");
|
||||
} else {
|
||||
new maildaemon($mails);
|
||||
@ -147,7 +147,7 @@ fclose($fp);
|
||||
// hanmail.net , hotmail.com , kebi.com 등이 정상적이지 않음으로 사용 불가
|
||||
function verify_email($address, &$error)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$WAIT_SECOND = 3; // ?초 기다림
|
||||
|
||||
@ -179,7 +179,7 @@ function verify_email($address, &$error)
|
||||
// 220 메세지들은 건너뜀
|
||||
// 3초가 지나도 응답이 없으면 포기
|
||||
socket_set_blocking($fp, false);
|
||||
$stoptime = G4_SERVER_TIME + $WAIT_SECOND;
|
||||
$stoptime = G5_SERVER_TIME + $WAIT_SECOND;
|
||||
$gotresponse = false;
|
||||
|
||||
while (true) {
|
||||
@ -188,11 +188,11 @@ function verify_email($address, &$error)
|
||||
|
||||
if (substr($line, 0, 3) == '220') {
|
||||
// 타이머를 초기화
|
||||
$stoptime = G4_SERVER_TIME + $WAIT_SECOND;
|
||||
$stoptime = G5_SERVER_TIME + $WAIT_SECOND;
|
||||
$gotresponse = true;
|
||||
} else if ($line == '' && $gotresponse)
|
||||
break;
|
||||
else if (G4_SERVER_TIME > $stoptime)
|
||||
else if (G5_SERVER_TIME > $stoptime)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ function mobile_create_thumb($srcImg, $width, $thumb)
|
||||
imagecopy($target, $source, 0, 0, 0, 0, $size[0], $size[1]);
|
||||
|
||||
imagejpeg($target, $thumb, 100);
|
||||
chmod($thumb, G4_FILE_PERMISSION); // 추후 삭제를 위하여 파일모드 변경
|
||||
chmod($thumb, G5_FILE_PERMISSION); // 추후 삭제를 위하여 파일모드 변경
|
||||
|
||||
return $thumb;
|
||||
}
|
||||
@ -42,7 +42,7 @@ function mobile_create_thumb($srcImg, $width, $thumb)
|
||||
function mobile_thumb($matches)
|
||||
{
|
||||
global $is_admin;
|
||||
global $g4, $bo_table, $wr_id;
|
||||
global $g5, $bo_table, $wr_id;
|
||||
|
||||
$width = 300; // (소스이미지 width pixel)
|
||||
|
||||
@ -60,10 +60,10 @@ function mobile_thumb($matches)
|
||||
$src = preg_replace("/^\.\.\//", "http://m.sir.co.kr/", $src);
|
||||
$absolute = preg_replace("/^http\:\/\/(www\.)?sir\.co\.kr\/(.*)$/", "/home/sir/$2", $src);
|
||||
|
||||
$thumb_dir = G4_DATA_PATH.'/thumb/'.$bo_table;
|
||||
$thumb_dir = G5_DATA_PATH.'/thumb/'.$bo_table;
|
||||
if (!is_dir($thumb_dir)) {
|
||||
@mkdir($thumb_dir, G4_DIR_PERMISSION);
|
||||
@chmod($thumb_dir, G4_DIR_PERMISSION);
|
||||
@mkdir($thumb_dir, G5_DIR_PERMISSION);
|
||||
@chmod($thumb_dir, G5_DIR_PERMISSION);
|
||||
}
|
||||
|
||||
$result = true;
|
||||
@ -105,7 +105,7 @@ function mobile_thumb($matches)
|
||||
|
||||
// 유일한 파일명을 만든다.
|
||||
$src_md5 = md5($src.$width);
|
||||
$thumb = G4_DATA_PATH.'/thumb/'.$bo_table.'-'.$wr_id.'-'.$src_md5;
|
||||
$thumb = G5_DATA_PATH.'/thumb/'.$bo_table.'-'.$wr_id.'-'.$src_md5;
|
||||
|
||||
if (!file_exists($thumb)) {
|
||||
$result = mobile_create_thumb($src, $width, $thumb);
|
||||
|
||||
@ -4,7 +4,7 @@ if (!defined('_GNUBOARD_')) exit;
|
||||
// 외부로그인
|
||||
function outlogin($skin_dir='basic')
|
||||
{
|
||||
global $config, $default, $member, $g4, $urlencode, $is_admin, $is_member;
|
||||
global $config, $default, $member, $g5, $urlencode, $is_admin, $is_member;
|
||||
|
||||
if (array_key_exists('mb_nick', $member)) {
|
||||
$nick = cut_str($member['mb_nick'], $config['cf_cut_name']);
|
||||
@ -13,29 +13,29 @@ function outlogin($skin_dir='basic')
|
||||
$point = number_format($member['mb_point']);
|
||||
}
|
||||
|
||||
if (G4_IS_MOBILE) {
|
||||
$outlogin_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/outlogin/'.$skin_dir;
|
||||
$outlogin_skin_url = G4_MOBILE_URL.'/'.G4_SKIN_DIR.'/outlogin/'.$skin_dir;
|
||||
if (G5_IS_MOBILE) {
|
||||
$outlogin_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/outlogin/'.$skin_dir;
|
||||
$outlogin_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/outlogin/'.$skin_dir;
|
||||
} else {
|
||||
$outlogin_skin_path = G4_SKIN_PATH.'/outlogin/'.$skin_dir;
|
||||
$outlogin_skin_url = G4_SKIN_URL.'/outlogin/'.$skin_dir;
|
||||
$outlogin_skin_path = G5_SKIN_PATH.'/outlogin/'.$skin_dir;
|
||||
$outlogin_skin_url = G5_SKIN_URL.'/outlogin/'.$skin_dir;
|
||||
}
|
||||
|
||||
// 읽지 않은 쪽지가 있다면
|
||||
if ($is_member) {
|
||||
$sql = " select count(*) as cnt from {$g4['memo_table']} where me_recv_mb_id = '{$member['mb_id']}' and me_read_datetime = '0000-00-00 00:00:00' ";
|
||||
$sql = " select count(*) as cnt from {$g5['memo_table']} where me_recv_mb_id = '{$member['mb_id']}' and me_read_datetime = '0000-00-00 00:00:00' ";
|
||||
$row = sql_fetch($sql);
|
||||
$memo_not_read = $row['cnt'];
|
||||
|
||||
$is_auth = false;
|
||||
$sql = " select count(*) as cnt from {$g4['auth_table']} where mb_id = '{$member['mb_id']}' ";
|
||||
$sql = " select count(*) as cnt from {$g5['auth_table']} where mb_id = '{$member['mb_id']}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row['cnt'])
|
||||
$is_auth = true;
|
||||
}
|
||||
|
||||
$outlogin_url = login_url($urlencode);
|
||||
$outlogin_action_url = G4_HTTPS_BBS_URL.'/login_check.php';
|
||||
$outlogin_action_url = G5_HTTPS_BBS_URL.'/login_check.php';
|
||||
|
||||
ob_start();
|
||||
if ($is_member)
|
||||
|
||||
@ -4,26 +4,26 @@ if (!defined('_GNUBOARD_')) exit;
|
||||
// 설문조사
|
||||
function poll($skin_dir='basic', $po_id=false)
|
||||
{
|
||||
global $config, $member, $g4, $is_admin;
|
||||
global $config, $member, $g5, $is_admin;
|
||||
|
||||
// 투표번호가 넘어오지 않았다면 가장 큰(최근에 등록한) 투표번호를 얻는다
|
||||
if (!$po_id) {
|
||||
$row = sql_fetch(" select MAX(po_id) as max_po_id from {$g4['poll_table']} ");
|
||||
$row = sql_fetch(" select MAX(po_id) as max_po_id from {$g5['poll_table']} ");
|
||||
$po_id = $row['max_po_id'];
|
||||
}
|
||||
|
||||
if(!$po_id)
|
||||
return;
|
||||
|
||||
$po = sql_fetch(" select * from {$g4['poll_table']} where po_id = '$po_id' ");
|
||||
$po = sql_fetch(" select * from {$g5['poll_table']} where po_id = '$po_id' ");
|
||||
|
||||
ob_start();
|
||||
if (G4_IS_MOBILE) {
|
||||
$poll_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/poll/'.$skin_dir;
|
||||
$poll_skin_url = G4_MOBILE_URL.'/'.G4_SKIN_DIR.'/poll/'.$skin_dir;
|
||||
if (G5_IS_MOBILE) {
|
||||
$poll_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/poll/'.$skin_dir;
|
||||
$poll_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/poll/'.$skin_dir;
|
||||
} else {
|
||||
$poll_skin_path = G4_SKIN_PATH.'/poll/'.$skin_dir;
|
||||
$poll_skin_url = G4_SKIN_URL.'/poll/'.$skin_dir;
|
||||
$poll_skin_path = G5_SKIN_PATH.'/poll/'.$skin_dir;
|
||||
$poll_skin_url = G5_SKIN_URL.'/poll/'.$skin_dir;
|
||||
}
|
||||
include_once ($poll_skin_path.'/poll.skin.php');
|
||||
$content = ob_get_contents();
|
||||
|
||||
@ -7,12 +7,12 @@ if (!defined('_GNUBOARD_')) exit;
|
||||
// $date_cnt : 몇일 동안
|
||||
function popular($skin_dir='basic', $pop_cnt=7, $date_cnt=3)
|
||||
{
|
||||
global $config, $g4;
|
||||
global $config, $g5;
|
||||
|
||||
if (!$skin_dir) $skin_dir = 'basic';
|
||||
|
||||
$date_gap = date("Y-m-d", G4_SERVER_TIME - ($date_cnt * 86400));
|
||||
$sql = " select pp_word, count(*) as cnt from {$g4['popular_table']} where pp_date between '$date_gap' and '".G4_TIME_YMD."' group by pp_word order by cnt desc, pp_word limit 0, $pop_cnt ";
|
||||
$date_gap = date("Y-m-d", G5_SERVER_TIME - ($date_cnt * 86400));
|
||||
$sql = " select pp_word, count(*) as cnt from {$g5['popular_table']} where pp_date between '$date_gap' and '".G5_TIME_YMD."' group by pp_word order by cnt desc, pp_word limit 0, $pop_cnt ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
$list[$i] = $row;
|
||||
@ -21,12 +21,12 @@ function popular($skin_dir='basic', $pop_cnt=7, $date_cnt=3)
|
||||
}
|
||||
|
||||
ob_start();
|
||||
if(G4_IS_MOBILE) {
|
||||
$popular_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/popular/'.$skin_dir;
|
||||
$popular_skin_url = G4_MOBILE_URL.'/'.G4_SKIN_DIR.'/popular/'.$skin_dir;
|
||||
if(G5_IS_MOBILE) {
|
||||
$popular_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/popular/'.$skin_dir;
|
||||
$popular_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/popular/'.$skin_dir;
|
||||
} else {
|
||||
$popular_skin_path = G4_SKIN_PATH.'/popular/'.$skin_dir;
|
||||
$popular_skin_url = G4_SKIN_URL.'/popular/'.$skin_dir;
|
||||
$popular_skin_path = G5_SKIN_PATH.'/popular/'.$skin_dir;
|
||||
$popular_skin_url = G5_SKIN_URL.'/popular/'.$skin_dir;
|
||||
}
|
||||
include_once ($popular_skin_path.'/popular.skin.php');
|
||||
$content = ob_get_contents();
|
||||
|
||||
@ -27,12 +27,12 @@ function count_mb_id($reg_mb_id)
|
||||
|
||||
function exist_mb_id($reg_mb_id)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$reg_mb_id = trim($reg_mb_id);
|
||||
if ($reg_mb_id == "") return "";
|
||||
|
||||
$sql = " select count(*) as cnt from `{$g4['member_table']}` where mb_id = '$reg_mb_id' ";
|
||||
$sql = " select count(*) as cnt from `{$g5['member_table']}` where mb_id = '$reg_mb_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row['cnt'])
|
||||
return "이미 사용중인 회원아이디 입니다.";
|
||||
@ -59,7 +59,7 @@ function empty_mb_nick($reg_mb_nick)
|
||||
|
||||
function valid_mb_nick($reg_mb_nick)
|
||||
{
|
||||
if (!check_string($reg_mb_nick, G4_HANGUL + G4_ALPHABETIC + G4_NUMERIC))
|
||||
if (!check_string($reg_mb_nick, G5_HANGUL + G5_ALPHABETIC + G5_NUMERIC))
|
||||
return "별명은 공백없이 한글, 영문, 숫자만 입력 가능합니다.";
|
||||
else
|
||||
return "";
|
||||
@ -75,8 +75,8 @@ function count_mb_nick($reg_mb_nick)
|
||||
|
||||
function exist_mb_nick($reg_mb_nick, $reg_mb_id)
|
||||
{
|
||||
global $g4;
|
||||
$row = sql_fetch(" select count(*) as cnt from {$g4['member_table']} where mb_nick = '$reg_mb_nick' and mb_id <> '$reg_mb_id' ");
|
||||
global $g5;
|
||||
$row = sql_fetch(" select count(*) as cnt from {$g5['member_table']} where mb_nick = '$reg_mb_nick' and mb_id <> '$reg_mb_id' ");
|
||||
if ($row['cnt'])
|
||||
return "이미 존재하는 별명입니다.";
|
||||
else
|
||||
@ -123,8 +123,8 @@ function prohibit_mb_email($reg_mb_email)
|
||||
|
||||
function exist_mb_email($reg_mb_email, $reg_mb_id)
|
||||
{
|
||||
global $g4;
|
||||
$row = sql_fetch(" select count(*) as cnt from `{$g4['member_table']}` where mb_email = '$reg_mb_email' and mb_id <> '$reg_mb_id' ");
|
||||
global $g5;
|
||||
$row = sql_fetch(" select count(*) as cnt from `{$g5['member_table']}` where mb_email = '$reg_mb_email' and mb_id <> '$reg_mb_id' ");
|
||||
if ($row['cnt'])
|
||||
return "이미 사용중인 E-mail 주소입니다.";
|
||||
else
|
||||
@ -141,7 +141,7 @@ function empty_mb_name($reg_mb_name)
|
||||
|
||||
function valid_mb_name($mb_name)
|
||||
{
|
||||
if (!check_string($mb_name, G4_HANGUL))
|
||||
if (!check_string($mb_name, G5_HANGUL))
|
||||
return "이름은 공백없이 한글만 입력 가능합니다.";
|
||||
else
|
||||
return "";
|
||||
@ -162,13 +162,13 @@ function valid_mb_hp($reg_mb_hp)
|
||||
|
||||
function exist_mb_hp($reg_mb_hp, $reg_mb_id)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
if (!trim($reg_mb_hp)) return "";
|
||||
|
||||
$reg_mb_hp = hyphen_hp_number($reg_mb_hp);
|
||||
|
||||
$sql = "select count(*) as cnt from {$g4['member_table']} where mb_hp = '$reg_mb_hp' and mb_id <> '$reg_mb_id' ";
|
||||
$sql = "select count(*) as cnt from {$g5['member_table']} where mb_hp = '$reg_mb_hp' and mb_id <> '$reg_mb_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if($row['cnt'])
|
||||
|
||||
194
lib/shop.lib.php
194
lib/shop.lib.php
@ -111,7 +111,7 @@ class item_list
|
||||
$this->list_row = $list_row;
|
||||
$this->img_width = $img_width;
|
||||
$this->img_height = $img_height;
|
||||
$this->set_href(G4_SHOP_URL.'/item.php?it_id=');
|
||||
$this->set_href(G5_SHOP_URL.'/item.php?it_id=');
|
||||
$this->count++;
|
||||
}
|
||||
|
||||
@ -251,7 +251,7 @@ class item_list
|
||||
// class 에 설정된 값으로 최종 실행합니다.
|
||||
function run() {
|
||||
|
||||
global $g4, $config, $member, $default;
|
||||
global $g5, $config, $member, $default;
|
||||
|
||||
if ($this->query) {
|
||||
|
||||
@ -290,11 +290,11 @@ class item_list
|
||||
|
||||
if ($this->event) {
|
||||
$sql_select = " select {$this->fields} ";
|
||||
$sql_common = " from `{$g4['shop_event_item_table']}` a left join `{$g4['shop_item_table']}` b on (a.it_id = b.it_id) ";
|
||||
$sql_common = " from `{$g5['shop_event_item_table']}` a left join `{$g5['shop_item_table']}` b on (a.it_id = b.it_id) ";
|
||||
$where[] = " a.ev_id = '{$this->event}' ";
|
||||
} else {
|
||||
$sql_select = " select {$this->fields} ";
|
||||
$sql_common = " from `{$g4['shop_item_table']}` ";
|
||||
$sql_common = " from `{$g5['shop_item_table']}` ";
|
||||
}
|
||||
$sql_where = " where " . implode(" and ", $where);
|
||||
$sql_limit = " limit " . $this->from_record . " , " . ($this->list_mod * $this->list_row);
|
||||
@ -310,13 +310,13 @@ class item_list
|
||||
|
||||
}
|
||||
|
||||
$sns_url = G4_SHOP_URL.'/item.php?it_id='.$row['it_id'];
|
||||
$sns_url = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];
|
||||
$sns_title = get_text($row['it_name']).' | '.get_text($config['cf_title']);
|
||||
|
||||
if ($this->is_mobile) {
|
||||
$file = G4_MSHOP_SKIN_PATH."/{$this->list_skin}";
|
||||
$file = G5_MSHOP_SKIN_PATH."/{$this->list_skin}";
|
||||
} else {
|
||||
$file = G4_SHOP_SKIN_PATH."/{$this->list_skin}";
|
||||
$file = G5_SHOP_SKIN_PATH."/{$this->list_skin}";
|
||||
}
|
||||
|
||||
if ($this->list_skin == "") {
|
||||
@ -338,11 +338,11 @@ class item_list
|
||||
// 장바구니 건수 검사
|
||||
function get_cart_count($cart_id)
|
||||
{
|
||||
global $g4, $default;
|
||||
global $g5, $default;
|
||||
|
||||
$sql = " select count(ct_id) as cnt from {$g4['shop_cart_table']} where od_id = '$cart_id' ";
|
||||
$sql = " select count(ct_id) as cnt from {$g5['shop_cart_table']} where od_id = '$cart_id' ";
|
||||
if($default['de_cart_keep_term']) {
|
||||
$ctime = date('Y-m-d H:i:s', G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400));
|
||||
$ctime = date('Y-m-d H:i:s', G5_SERVER_TIME - ($default['de_cart_keep_term'] * 86400));
|
||||
$sql .= " and ct_time > '$ctime' ";
|
||||
}
|
||||
$row = sql_fetch($sql);
|
||||
@ -354,9 +354,9 @@ function get_cart_count($cart_id)
|
||||
// 이미지를 얻는다
|
||||
function get_image($img, $width=0, $height=0, $img_id='')
|
||||
{
|
||||
global $g4, $default;
|
||||
global $g5, $default;
|
||||
|
||||
$full_img = G4_DATA_PATH.'/item/'.$img;
|
||||
$full_img = G5_DATA_PATH.'/item/'.$img;
|
||||
|
||||
if (file_exists($full_img) && $img)
|
||||
{
|
||||
@ -366,7 +366,7 @@ function get_image($img, $width=0, $height=0, $img_id='')
|
||||
$width = $size[0];
|
||||
$height = $size[1];
|
||||
}
|
||||
$str = '<img src="'.G4_DATA_URL.'/item/'.$img.'" alt="" width="'.$width.'" height="'.$height.'"';
|
||||
$str = '<img src="'.G5_DATA_URL.'/item/'.$img.'" alt="" width="'.$width.'" height="'.$height.'"';
|
||||
|
||||
if($img_id)
|
||||
$str .= ' id="'.$img_id.'"';
|
||||
@ -375,7 +375,7 @@ function get_image($img, $width=0, $height=0, $img_id='')
|
||||
}
|
||||
else
|
||||
{
|
||||
$str = '<img src="'.G4_SHOP_URL.'/img/no_image.gif" alt="" ';
|
||||
$str = '<img src="'.G5_SHOP_URL.'/img/no_image.gif" alt="" ';
|
||||
if ($width)
|
||||
$str .= 'width="'.$width.'" height="'.$height.'"';
|
||||
else
|
||||
@ -392,19 +392,19 @@ function get_image($img, $width=0, $height=0, $img_id='')
|
||||
// 상품 이미지를 얻는다
|
||||
function get_it_image($it_id, $width, $height=0, $anchor=false, $img_id='')
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
if(!$it_id || !$width)
|
||||
return '';
|
||||
|
||||
$sql = " select it_id, it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10 from {$g4['shop_item_table']} where it_id = '$it_id' ";
|
||||
$sql = " select it_id, it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10 from {$g5['shop_item_table']} where it_id = '$it_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if(!$row['it_id'])
|
||||
return '';
|
||||
|
||||
for($i=1;$i<=10; $i++) {
|
||||
$file = G4_DATA_PATH.'/item/'.$row['it_img'.$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)
|
||||
@ -429,10 +429,10 @@ function get_it_image($it_id, $width, $height=0, $anchor=false, $img_id='')
|
||||
}
|
||||
|
||||
if($thumb) {
|
||||
$file_url = str_replace(G4_PATH, G4_URL, $filepath.'/'.$thumb);
|
||||
$file_url = str_replace(G5_PATH, G5_URL, $filepath.'/'.$thumb);
|
||||
$img = '<img src="'.$file_url.'" width="'.$width.'" height="'.$height.'" alt=""';
|
||||
} else {
|
||||
$img = '<img src="'.G4_SHOP_URL.'/img/no_image.gif" width="'.$width.'"';
|
||||
$img = '<img src="'.G5_SHOP_URL.'/img/no_image.gif" width="'.$width.'"';
|
||||
if($height)
|
||||
$img .= ' height="'.$height.'"';
|
||||
$img .= ' alt=""';
|
||||
@ -443,7 +443,7 @@ function get_it_image($it_id, $width, $height=0, $anchor=false, $img_id='')
|
||||
$img .= '>';
|
||||
|
||||
if($anchor)
|
||||
$img = '<a href="'.G4_SHOP_URL.'/item.php?it_id='.$it_id.'">'.$img.'</a>';
|
||||
$img = '<a href="'.G5_SHOP_URL.'/item.php?it_id='.$it_id.'">'.$img.'</a>';
|
||||
|
||||
return $img;
|
||||
}
|
||||
@ -452,7 +452,7 @@ function get_it_thumbnail($img, $width, $height=0, $id='')
|
||||
{
|
||||
$str = '';
|
||||
|
||||
$file = G4_DATA_PATH.'/item/'.$img;
|
||||
$file = G5_DATA_PATH.'/item/'.$img;
|
||||
if(is_file($file))
|
||||
$size = @getimagesize($file);
|
||||
|
||||
@ -471,7 +471,7 @@ function get_it_thumbnail($img, $width, $height=0, $id='')
|
||||
$thumb = thumbnail($filename, $filepath, $filepath, $width, $height, false, false, 'center', true, $um_value='80/0.5/3');
|
||||
|
||||
if($thumb) {
|
||||
$file_url = str_replace(G4_PATH, G4_URL, $filepath.'/'.$thumb);
|
||||
$file_url = str_replace(G5_PATH, G5_URL, $filepath.'/'.$thumb);
|
||||
$str = '<img src="'.$file_url.'" width="'.$width.'" height="'.$height.'"';
|
||||
if($id)
|
||||
$str .= ' id="'.$id.'"';
|
||||
@ -484,17 +484,17 @@ function get_it_thumbnail($img, $width, $height=0, $id='')
|
||||
//
|
||||
function get_it_imageurl($it_id)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$sql = " select it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10
|
||||
from {$g4['shop_item_table']}
|
||||
from {$g5['shop_item_table']}
|
||||
where it_id = '$it_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
$filepath = '';
|
||||
|
||||
for($i=1; $i<=10; $i++) {
|
||||
$img = $row['it_img'.$i];
|
||||
$file = G4_DATA_PATH.'/item/'.$img;
|
||||
$file = G5_DATA_PATH.'/item/'.$img;
|
||||
if(!is_file($file))
|
||||
continue;
|
||||
|
||||
@ -506,9 +506,9 @@ function get_it_imageurl($it_id)
|
||||
}
|
||||
|
||||
if($filepath)
|
||||
$str = str_replace(G4_PATH, G4_URL, $filepath);
|
||||
$str = str_replace(G5_PATH, G5_URL, $filepath);
|
||||
else
|
||||
$str = G4_SHOP_URL.'/img/no_image.gif';
|
||||
$str = G5_SHOP_URL.'/img/no_image.gif';
|
||||
|
||||
return $str;
|
||||
}
|
||||
@ -516,15 +516,15 @@ function get_it_imageurl($it_id)
|
||||
// 상품의 재고 (창고재고수량 - 주문대기수량)
|
||||
function get_it_stock_qty($it_id)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$sql = " select it_stock_qty from {$g4['shop_item_table']} where it_id = '$it_id' ";
|
||||
$sql = " select it_stock_qty from {$g5['shop_item_table']} where it_id = '$it_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
$jaego = (int)$row['it_stock_qty'];
|
||||
|
||||
// 재고에서 빼지 않았고 주문인것만
|
||||
$sql = " select SUM(ct_qty) as sum_qty
|
||||
from {$g4['shop_cart_table']}
|
||||
from {$g5['shop_cart_table']}
|
||||
where it_id = '$it_id'
|
||||
and io_id = ''
|
||||
and ct_stock_use = 0
|
||||
@ -538,17 +538,17 @@ function get_it_stock_qty($it_id)
|
||||
// 옵션의 재고 (창고재고수량 - 주문대기수량)
|
||||
function get_option_stock_qty($it_id, $io_id, $type)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$sql = " select io_stock_qty
|
||||
from {$g4['shop_item_option_table']}
|
||||
from {$g5['shop_item_option_table']}
|
||||
where it_id = '$it_id' and io_id = '$io_id' and io_type = '$type' and io_use = '1' ";
|
||||
$row = sql_fetch($sql);
|
||||
$jaego = (int)$row['io_stock_qty'];
|
||||
|
||||
// 재고에서 빼지 않았고 주문인것만
|
||||
$sql = " select SUM(ct_qty) as sum_qty
|
||||
from {$g4['shop_cart_table']}
|
||||
from {$g5['shop_cart_table']}
|
||||
where it_id = '$it_id'
|
||||
and io_id = '$io_id'
|
||||
and io_type = '$type'
|
||||
@ -563,14 +563,14 @@ function get_option_stock_qty($it_id, $io_id, $type)
|
||||
// 큰 이미지
|
||||
function get_large_image($img, $it_id, $btn_image=true)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
if (file_exists(G4_DATA_PATH.'/item/'.$img) && $img != '')
|
||||
if (file_exists(G5_DATA_PATH.'/item/'.$img) && $img != '')
|
||||
{
|
||||
$size = getimagesize(G4_DATA_PATH.'/item/'.$img);
|
||||
$size = getimagesize(G5_DATA_PATH.'/item/'.$img);
|
||||
$width = $size[0];
|
||||
$height = $size[1];
|
||||
$str = '<a href="javascript:popup_large_image(\''.$it_id.'\', \''.$img.'\', '.$width.', '.$height.', \''.G4_SHOP_URL.'\')">';
|
||||
$str = '<a href="javascript:popup_large_image(\''.$it_id.'\', \''.$img.'\', '.$width.', '.$height.', \''.G5_SHOP_URL.'\')">';
|
||||
if ($btn_image)
|
||||
$str .= '큰이미지</a>';
|
||||
}
|
||||
@ -635,8 +635,8 @@ function it_img_upload($srcfile, $filename, $dir)
|
||||
return '';
|
||||
|
||||
if(!is_dir($dir)) {
|
||||
@mkdir($dir, G4_DIR_PERMISSION);
|
||||
@chmod($dir, G4_DIR_PERMISSION);
|
||||
@mkdir($dir, G5_DIR_PERMISSION);
|
||||
@chmod($dir, G5_DIR_PERMISSION);
|
||||
}
|
||||
|
||||
$filename = preg_replace("/\s+/", "", $filename);
|
||||
@ -649,7 +649,7 @@ function it_img_upload($srcfile, $filename, $dir)
|
||||
|
||||
upload_file($srcfile, $filename, $dir);
|
||||
|
||||
$file = str_replace(G4_DATA_PATH.'/item/', '', $dir.'/'.$filename);
|
||||
$file = str_replace(G5_DATA_PATH.'/item/', '', $dir.'/'.$filename);
|
||||
|
||||
return $file;
|
||||
}
|
||||
@ -660,7 +660,7 @@ function upload_file($srcfile, $destfile, $dir)
|
||||
if ($destfile == "") return false;
|
||||
// 업로드 한후 , 퍼미션을 변경함
|
||||
@move_uploaded_file($srcfile, $dir.'/'.$destfile);
|
||||
@chmod($dir.'/'.$destfile, G4_FILE_PERMISSION);
|
||||
@chmod($dir.'/'.$destfile, G5_FILE_PERMISSION);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -706,7 +706,7 @@ function is_null_time($datetime)
|
||||
//function display_type($type, $skin_file, $list_mod, $list_row, $img_width, $img_height, $ca_id="")
|
||||
function display_type($type, $list_skin='', $list_mod='', $list_row='', $img_width='', $img_height='', $ca_id='')
|
||||
{
|
||||
global $member, $g4, $config, $default;
|
||||
global $member, $g5, $config, $default;
|
||||
|
||||
if (!$default["de_type{$type}_list_use"]) return "";
|
||||
|
||||
@ -721,7 +721,7 @@ function display_type($type, $list_skin='', $list_mod='', $list_row='', $img_wid
|
||||
|
||||
// 1.02.00
|
||||
// it_order 추가
|
||||
$sql = " select * from {$g4['shop_item_table']} where it_use = '1' and it_type{$type} = '1' ";
|
||||
$sql = " select * from {$g5['shop_item_table']} where it_use = '1' and it_type{$type} = '1' ";
|
||||
if ($ca_id) $sql .= " and ca_id like '$ca_id%' ";
|
||||
$sql .= " order by it_order, it_id desc limit $items ";
|
||||
$result = sql_query($sql);
|
||||
@ -731,10 +731,10 @@ function display_type($type, $list_skin='', $list_mod='', $list_row='', $img_wid
|
||||
}
|
||||
*/
|
||||
|
||||
//$file = G4_SHOP_PATH.'/'.$skin_file;
|
||||
$file = G4_SHOP_SKIN_PATH.'/'.$list_skin;
|
||||
//$file = G5_SHOP_PATH.'/'.$skin_file;
|
||||
$file = G5_SHOP_SKIN_PATH.'/'.$list_skin;
|
||||
if (!file_exists($file)) {
|
||||
return G4_SHOP_SKIN_URL.'/'.$list_skin.' 파일을 찾을 수 없습니다.';
|
||||
return G5_SHOP_SKIN_URL.'/'.$list_skin.' 파일을 찾을 수 없습니다.';
|
||||
} else {
|
||||
$td_width = (int)(100 / $list_mod);
|
||||
ob_start();
|
||||
@ -748,14 +748,14 @@ function display_type($type, $list_skin='', $list_mod='', $list_row='', $img_wid
|
||||
// 모바일 유형별 상품 출력
|
||||
function mobile_display_type($type, $skin_file, $list_row, $img_width, $img_height, $ca_id="")
|
||||
{
|
||||
global $member, $g4, $config;
|
||||
global $member, $g5, $config;
|
||||
|
||||
// 상품의 갯수
|
||||
$items = $list_row;
|
||||
|
||||
// 1.02.00
|
||||
// it_order 추가
|
||||
$sql = " select * from {$g4['shop_item_table']} where it_use = '1' and it_type{$type} = '1' ";
|
||||
$sql = " select * from {$g5['shop_item_table']} where it_use = '1' and it_type{$type} = '1' ";
|
||||
if ($ca_id) $sql .= " and ca_id like '$ca_id%' ";
|
||||
$sql .= " order by it_order, it_id desc limit $items ";
|
||||
$result = sql_query($sql);
|
||||
@ -765,7 +765,7 @@ function mobile_display_type($type, $skin_file, $list_row, $img_width, $img_heig
|
||||
}
|
||||
*/
|
||||
|
||||
$file = G4_MSHOP_PATH.'/'.$skin_file;
|
||||
$file = G5_MSHOP_PATH.'/'.$skin_file;
|
||||
if (!file_exists($file)) {
|
||||
echo $file.' 파일을 찾을 수 없습니다.';
|
||||
} else {
|
||||
@ -778,12 +778,12 @@ function mobile_display_type($type, $skin_file, $list_row, $img_width, $img_heig
|
||||
// 스킨파일번호, 1라인이미지수, 총라인수, 이미지폭, 이미지높이 , 분류번호
|
||||
function display_category($no, $list_mod, $list_row, $img_width, $img_height, $ca_id="")
|
||||
{
|
||||
global $member, $g4;
|
||||
global $member, $g5;
|
||||
|
||||
// 상품의 갯수
|
||||
$items = $list_mod * $list_row;
|
||||
|
||||
$sql = " select * from {$g4['shop_item_table']} where it_use = '1'";
|
||||
$sql = " select * from {$g5['shop_item_table']} where it_use = '1'";
|
||||
if ($ca_id)
|
||||
$sql .= " and ca_id LIKE '{$ca_id}%' ";
|
||||
$sql .= " order by it_order, it_id desc limit $items ";
|
||||
@ -792,7 +792,7 @@ function display_category($no, $list_mod, $list_row, $img_width, $img_height, $c
|
||||
return false;
|
||||
}
|
||||
|
||||
$file = G4_SHOP_PATH.'/maintype'.$no.'.inc.php';
|
||||
$file = G5_SHOP_PATH.'/maintype'.$no.'.inc.php';
|
||||
if (!file_exists($file)) {
|
||||
echo $file.' 파일을 찾을 수 없습니다.';
|
||||
} else {
|
||||
@ -817,9 +817,9 @@ function get_star($score)
|
||||
// 별 이미지
|
||||
function get_star_image($it_id)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$sql = "select (SUM(is_score) / COUNT(*)) as score from {$g4['shop_item_use_table']} where it_id = '$it_id' ";
|
||||
$sql = "select (SUM(is_score) / COUNT(*)) as score from {$g5['shop_item_use_table']} where it_id = '$it_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
return (int)get_star($row['score']);
|
||||
@ -828,10 +828,10 @@ function get_star_image($it_id)
|
||||
// 메일 보내는 내용을 HTML 형식으로 만든다.
|
||||
function email_content($str)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$s = "";
|
||||
$s .= "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset={$g4['charset']}\"><title>메일</title>\n";
|
||||
$s .= "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset={$g5['charset']}\"><title>메일</title>\n";
|
||||
$s .= "<body>\n";
|
||||
$s .= $str;
|
||||
$s .= "</body>\n";
|
||||
@ -897,21 +897,21 @@ function title_sort($col, $type=0)
|
||||
// 세션값을 체크하여 이쪽에서 온것이 아니면 메인으로
|
||||
function session_check()
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
if (!trim(get_session('ss_uniqid')))
|
||||
gotourl(G4_SHOP_URL);
|
||||
gotourl(G5_SHOP_URL);
|
||||
}
|
||||
|
||||
// 상품 선택옵션
|
||||
function get_item_options($it_id, $subject)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
if(!$it_id || !$subject)
|
||||
return '';
|
||||
|
||||
$sql = " select * from {$g4['shop_item_option_table']} where io_type = '0' and it_id = '$it_id' and io_use = '1' order by io_no asc ";
|
||||
$sql = " select * from {$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(!mysql_num_rows($result))
|
||||
return '';
|
||||
@ -993,12 +993,12 @@ function get_item_options($it_id, $subject)
|
||||
// 상품 추가옵션
|
||||
function get_item_supply($it_id, $subject)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
if(!$it_id || !$subject)
|
||||
return '';
|
||||
|
||||
$sql = " select * from {$g4['shop_item_option_table']} where io_type = '1' and it_id = '$it_id' and io_use = '1' order by io_no asc ";
|
||||
$sql = " select * from {$g5['shop_item_option_table']} where io_type = '1' and it_id = '$it_id' and io_use = '1' order by io_no asc ";
|
||||
$result = sql_query($sql);
|
||||
if(!mysql_num_rows($result))
|
||||
return '';
|
||||
@ -1061,9 +1061,9 @@ function get_item_supply($it_id, $subject)
|
||||
|
||||
function print_item_options($it_id, $cart_id)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$sql = " select ct_option, ct_qty from {$g4['shop_cart_table']} where it_id = '$it_id' and od_id = '$cart_id' order by io_type asc, ct_id asc ";
|
||||
$sql = " select ct_option, ct_qty from {$g5['shop_cart_table']} where it_id = '$it_id' and od_id = '$cart_id' order by io_type asc, ct_id asc ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$str = '';
|
||||
@ -1094,11 +1094,11 @@ function date_conv($date, $case=1)
|
||||
// 배너출력
|
||||
function display_banner($position, $num="")
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
if (!$position) $position = '왼쪽';
|
||||
|
||||
include G4_SHOP_PATH.'/boxbanner'.$num.'.inc.php';
|
||||
include G5_SHOP_PATH.'/boxbanner'.$num.'.inc.php';
|
||||
}
|
||||
|
||||
// 1.00.02
|
||||
@ -1106,14 +1106,14 @@ function display_banner($position, $num="")
|
||||
// 1.02.01 $ca_id 추가
|
||||
function display_event($no, $event, $list_mod, $list_row, $img_width, $img_height, $ca_id="")
|
||||
{
|
||||
global $member, $g4;
|
||||
global $member, $g5;
|
||||
|
||||
// 상품의 갯수
|
||||
$items = $list_mod * $list_row;
|
||||
|
||||
// 1.02.00
|
||||
// b.it_order 추가
|
||||
$sql = " select b.* from {$g4['shop_event_item_table']} a, {$g4['shop_item_table']} b where a.it_id = b.it_id and b.it_use = '1' and a.ev_id = '$event' ";
|
||||
$sql = " select b.* from {$g5['shop_event_item_table']} a, {$g5['shop_item_table']} b where a.it_id = b.it_id and b.it_use = '1' and a.ev_id = '$event' ";
|
||||
if ($ca_id) $sql .= " and ca_id = '$ca_id' ";
|
||||
$sql .= " order by b.it_order, a.it_id desc limit $items ";
|
||||
$result = sql_query($sql);
|
||||
@ -1121,7 +1121,7 @@ function display_event($no, $event, $list_mod, $list_row, $img_width, $img_heigh
|
||||
return false;
|
||||
}
|
||||
|
||||
$file = G4_SHOP_PATH.'/maintype'.$no.'.inc.php';
|
||||
$file = G5_SHOP_PATH.'/maintype'.$no.'.inc.php';
|
||||
if (!file_exists($file)) {
|
||||
echo $file.' 파일을 찾을 수 없습니다.';
|
||||
} else {
|
||||
@ -1142,10 +1142,10 @@ function get_yn($val, $case='')
|
||||
// 상품명과 건수를 반환
|
||||
function get_goods($cart_id)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
// 상품명만들기
|
||||
$row = sql_fetch(" select a.it_id, b.it_name from {$g4['shop_cart_table']} a, {$g4['shop_item_table']} b where a.it_id = b.it_id and a.od_id = '$cart_id' order by ct_id limit 1 ");
|
||||
$row = sql_fetch(" select a.it_id, b.it_name from {$g5['shop_cart_table']} a, {$g5['shop_item_table']} b where a.it_id = b.it_id and a.od_id = '$cart_id' order by ct_id limit 1 ");
|
||||
// 상품명에 "(쌍따옴표)가 들어가면 오류 발생함
|
||||
$goods['it_id'] = $row['it_id'];
|
||||
$goods['full_name']= $goods['name'] = addslashes($row['it_name']);
|
||||
@ -1153,7 +1153,7 @@ function get_goods($cart_id)
|
||||
$goods['full_name'] = preg_replace ("/[ #\&\+\-%@=\/\\\:;,\.'\"\^`~\_|\!\?\*$#<>()\[\]\{\}]/i", "", $goods['full_name']);
|
||||
|
||||
// 상품건수
|
||||
$row = sql_fetch(" select count(*) as cnt from {$g4['shop_cart_table']} where od_id = '$cart_id' ");
|
||||
$row = sql_fetch(" select count(*) as cnt from {$g5['shop_cart_table']} where od_id = '$cart_id' ");
|
||||
$cnt = $row['cnt'] - 1;
|
||||
if ($cnt)
|
||||
$goods['full_name'] .= ' 외 '.$cnt.'건';
|
||||
@ -1216,7 +1216,7 @@ function check_datetime($datetime)
|
||||
// 경고메세지를 경고창으로
|
||||
function alert_opener($msg='', $url='')
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
if (!$msg) $msg = '올바른 방법으로 이용해 주십시오.';
|
||||
|
||||
@ -1243,13 +1243,13 @@ function conv_selected_option($options, $value)
|
||||
// 주문서 번호를 얻는다.
|
||||
function get_new_od_id()
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
// 주문서 테이블 Lock 걸고
|
||||
sql_query(" LOCK TABLES {$g4['shop_order_table']} READ, {$g4['shop_order_table']} WRITE ", FALSE);
|
||||
sql_query(" LOCK TABLES {$g5['shop_order_table']} READ, {$g5['shop_order_table']} WRITE ", FALSE);
|
||||
// 주문서 번호를 만든다.
|
||||
$date = date("ymd", time()); // 2002년 3월 7일 일경우 020307
|
||||
$sql = " select max(od_id) as max_od_id from {$g4['shop_order_table']} where SUBSTRING(od_id, 1, 6) = '$date' ";
|
||||
$sql = " select max(od_id) as max_od_id from {$g5['shop_order_table']} where SUBSTRING(od_id, 1, 6) = '$date' ";
|
||||
$row = sql_fetch($sql);
|
||||
$od_id = $row['max_od_id'];
|
||||
if ($od_id == 0)
|
||||
@ -1269,7 +1269,7 @@ function get_new_od_id()
|
||||
// cart id 설정
|
||||
function set_cart_id($direct)
|
||||
{
|
||||
global $g4, $default, $member;
|
||||
global $g5, $default, $member;
|
||||
|
||||
if ($direct) {
|
||||
$tmp_cart_id = get_session('ss_cart_direct');
|
||||
@ -1299,13 +1299,13 @@ function set_cart_id($direct)
|
||||
|
||||
// 보관된 회원장바구니 자료 cart id 변경
|
||||
if($member['mb_id'] && $tmp_cart_id) {
|
||||
$sql = " update {$g4['shop_cart_table']}
|
||||
$sql = " update {$g5['shop_cart_table']}
|
||||
set od_id = '$tmp_cart_id'
|
||||
where mb_id = '{$member['mb_id']}'
|
||||
and ct_direct = '0'
|
||||
and ct_status = '쇼핑' ";
|
||||
if($default['de_cart_keep_term']) {
|
||||
$ctime = date('Y-m-d H:i:s', G4_SERVER_TIME - ($default['de_cart_keep_term'] * 86400));
|
||||
$ctime = date('Y-m-d H:i:s', G5_SERVER_TIME - ($default['de_cart_keep_term'] * 86400));
|
||||
$sql .= " and ct_time > '$ctime' ";
|
||||
}
|
||||
|
||||
@ -1317,14 +1317,14 @@ function set_cart_id($direct)
|
||||
// 상품 목록 : 관련 상품 출력
|
||||
function relation_item($it_id, $width, $height, $rows=3)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$str = '';
|
||||
|
||||
if(!$it_id)
|
||||
return $str;
|
||||
|
||||
$sql = " select b.it_id, b.it_name, b.it_price, b.it_tel_inq from {$g4['shop_item_relation_table']} a left join {$g4['shop_item_table']} b on ( a.it_id2 = b.it_id ) where a.it_id = '$it_id' order by ir_no asc limit 0, $rows ";
|
||||
$sql = " select b.it_id, b.it_name, b.it_price, b.it_tel_inq from {$g5['shop_item_relation_table']} a left join {$g5['shop_item_table']} b on ( a.it_id2 = b.it_id ) where a.it_id = '$it_id' order by ir_no asc limit 0, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
@ -1340,7 +1340,7 @@ function relation_item($it_id, $width, $height, $rows=3)
|
||||
|
||||
$img = get_it_image($row['it_id'], $width, $height);
|
||||
|
||||
$str .= '<li class="sct_rel_li"><a href="'.G4_SHOP_URL.'/item.php?it_id='.$row['it_id'].'" class="sct_rel_a">'.$img.'</a></li>';
|
||||
$str .= '<li class="sct_rel_li"><a href="'.G5_SHOP_URL.'/item.php?it_id='.$row['it_id'].'" class="sct_rel_a">'.$img.'</a></li>';
|
||||
}
|
||||
|
||||
if($i > 0)
|
||||
@ -1356,22 +1356,22 @@ function item_icon($it)
|
||||
// 품절
|
||||
$stock = get_it_stock_qty($it['it_id']);
|
||||
if ($stock <= 0)
|
||||
$icon .= '<img src="'.G4_SHOP_URL.'/img/icon_soldout.gif" alt="품절"> ';
|
||||
$icon .= '<img src="'.G5_SHOP_URL.'/img/icon_soldout.gif" alt="품절"> ';
|
||||
|
||||
if ($it['it_type1'])
|
||||
$icon .= '<img src="'.G4_SHOP_URL.'/img/icon_hit.gif" alt="최신상품">';
|
||||
$icon .= '<img src="'.G5_SHOP_URL.'/img/icon_hit.gif" alt="최신상품">';
|
||||
|
||||
if ($it['it_type2'])
|
||||
$icon .= '<img src="'.G4_SHOP_URL.'/img/icon_rec.gif" alt="히트상품">';
|
||||
$icon .= '<img src="'.G5_SHOP_URL.'/img/icon_rec.gif" alt="히트상품">';
|
||||
|
||||
if ($it['it_type3'])
|
||||
$icon .= '<img src="'.G4_SHOP_URL.'/img/icon_new.gif" alt="추천상품">';
|
||||
$icon .= '<img src="'.G5_SHOP_URL.'/img/icon_new.gif" alt="추천상품">';
|
||||
|
||||
if ($it['it_type4'])
|
||||
$icon .= '<img src="'.G4_SHOP_URL.'/img/icon_best.gif" alt="인기상품">';
|
||||
$icon .= '<img src="'.G5_SHOP_URL.'/img/icon_best.gif" alt="인기상품">';
|
||||
|
||||
if ($it['it_type5'])
|
||||
$icon .= '<img src="'.G4_SHOP_URL.'/img/icon_discount.gif" alt="할인상품">';
|
||||
$icon .= '<img src="'.G5_SHOP_URL.'/img/icon_discount.gif" alt="할인상품">';
|
||||
|
||||
$icon .= '</span>';
|
||||
|
||||
@ -1478,7 +1478,7 @@ function get_item_point($it)
|
||||
// 배송비 구함
|
||||
function get_sendcost($price, $cart_id, $selected=1)
|
||||
{
|
||||
global $default, $g4;
|
||||
global $default, $g5;
|
||||
|
||||
if ($default['de_send_cost_case'] == '없음') {
|
||||
$send_cost = 0;
|
||||
@ -1497,7 +1497,7 @@ function get_sendcost($price, $cart_id, $selected=1)
|
||||
} else { // 개별배송비
|
||||
$send_cost = 0;
|
||||
$sql = " select distinct it_id
|
||||
from {$g4['shop_cart_table']}
|
||||
from {$g5['shop_cart_table']}
|
||||
where od_id = '$cart_id'
|
||||
and ct_send_cost = '0'
|
||||
and ct_status IN ( '쇼핑', '주문', '준비', '배송', '완료' )
|
||||
@ -1508,7 +1508,7 @@ function get_sendcost($price, $cart_id, $selected=1)
|
||||
// 합계
|
||||
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
|
||||
SUM(ct_qty) as qty
|
||||
from {$g4['shop_cart_table']}
|
||||
from {$g5['shop_cart_table']}
|
||||
where it_id = '{$sc['it_id']}'
|
||||
and od_id = '$cart_id' ";
|
||||
$sum = sql_fetch($sql);
|
||||
@ -1523,13 +1523,13 @@ function get_sendcost($price, $cart_id, $selected=1)
|
||||
// 상품별 배송비
|
||||
function get_item_sendcost($it_id, $price, $qty)
|
||||
{
|
||||
global $g4, $default;
|
||||
global $g5, $default;
|
||||
|
||||
if($default['de_send_cost_case'] != '개별')
|
||||
return 0;
|
||||
|
||||
$sql = " select it_id, it_sc_type, it_sc_method, it_sc_price, it_sc_minimum, it_sc_qty
|
||||
from {$g4['shop_item_table']}
|
||||
from {$g5['shop_item_table']}
|
||||
where it_id = '$it_id' ";
|
||||
$it = sql_fetch($sql);
|
||||
if(!$it['it_id'])
|
||||
@ -1563,11 +1563,11 @@ function get_order_misu($od_id)
|
||||
if(!$od_id)
|
||||
return 0;
|
||||
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$sql = " select od_id,
|
||||
( od_cart_price + od_send_cost + od_send_cost2 - od_cart_coupon - od_coupon - od_send_coupon - od_receipt_price - od_receipt_point ) as misu
|
||||
from {$g4['shop_order_table']}
|
||||
from {$g5['shop_order_table']}
|
||||
where od_id = '$od_id' ";
|
||||
$od = sql_fetch($sql);
|
||||
|
||||
@ -1580,11 +1580,11 @@ function get_order_misu($od_id)
|
||||
// 쿠폰 사용체크
|
||||
function is_used_coupon($mb_id, $cp_id)
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
$used = false;
|
||||
|
||||
$sql = " select count(*) as cnt from {$g4['shop_coupon_log_table']} where mb_id = '$mb_id' and cp_id = '$cp_id' ";
|
||||
$sql = " select count(*) as cnt from {$g5['shop_coupon_log_table']} where mb_id = '$mb_id' and cp_id = '$cp_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if($row['cnt'])
|
||||
|
||||
@ -17,7 +17,7 @@ class g4_thumb {
|
||||
var $green = 0xff;
|
||||
var $blue = 0xff;
|
||||
var $quality = 100;
|
||||
var $permission = G4_FILE_PERMISSION;
|
||||
var $permission = G5_FILE_PERMISSION;
|
||||
|
||||
function g4_thumb($path, $width) {
|
||||
$this->set_path($path);
|
||||
@ -27,8 +27,8 @@ class g4_thumb {
|
||||
// 경로
|
||||
function set_path($path) {
|
||||
$this->path = $path;
|
||||
@mkdir($path, G4_DIR_PERMISSION);
|
||||
@chmod($path, G4_DIR_PERMISSION);
|
||||
@mkdir($path, G5_DIR_PERMISSION);
|
||||
@chmod($path, G5_DIR_PERMISSION);
|
||||
}
|
||||
|
||||
function set_width($width) {
|
||||
|
||||
@ -6,20 +6,20 @@ if (!defined('_GNUBOARD_')) exit;
|
||||
// 게시글리스트 썸네일 생성
|
||||
function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create=false, $is_crop=true, $crop_mode='center', $is_sharpen=true, $um_value='80/0.5/3')
|
||||
{
|
||||
global $g4, $config;
|
||||
global $g5, $config;
|
||||
$filename = $alt = "";
|
||||
$edt = false;
|
||||
|
||||
$sql = " select bf_file, bf_content from {$g4['board_file_table']}
|
||||
$sql = " select bf_file, bf_content from {$g5['board_file_table']}
|
||||
where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_type between '1' and '3' order by bf_no limit 0, 1 ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if($row['bf_file']) {
|
||||
$filename = $row['bf_file'];
|
||||
$filepath = G4_DATA_PATH.'/file/'.$bo_table;
|
||||
$filepath = G5_DATA_PATH.'/file/'.$bo_table;
|
||||
$alt = get_text($row['bf_content']);
|
||||
} else {
|
||||
$write_table = $g4['write_prefix'].$bo_table;
|
||||
$write_table = $g5['write_prefix'].$bo_table;
|
||||
$sql = " select wr_content from $write_table where wr_id = '$wr_id' ";
|
||||
$write = sql_fetch($sql);
|
||||
$matchs = get_editor_image($write['wr_content']);
|
||||
@ -34,10 +34,10 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
|
||||
else
|
||||
$data_path = $p['path'];
|
||||
|
||||
if(!preg_match('/^\/'.G4_DATA_DIR.'/', $data_path))
|
||||
if(!preg_match('/^\/'.G5_DATA_DIR.'/', $data_path))
|
||||
continue;
|
||||
|
||||
$srcfile = G4_PATH.$data_path;
|
||||
$srcfile = G5_PATH.$data_path;
|
||||
|
||||
if(preg_match("/\.({$config['cf_image_extension']})$/i", $srcfile) && is_file($srcfile)) {
|
||||
$size = @getimagesize($srcfile);
|
||||
@ -62,9 +62,9 @@ function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_
|
||||
|
||||
if($tname) {
|
||||
if($edt) {
|
||||
$src = G4_URL.str_replace($filename, $tname, $data_path);
|
||||
$src = G5_URL.str_replace($filename, $tname, $data_path);
|
||||
} else {
|
||||
$src = G4_DATA_URL.'/file/'.$bo_table.'/'.$tname;
|
||||
$src = G5_DATA_URL.'/file/'.$bo_table.'/'.$tname;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
@ -82,7 +82,7 @@ function get_view_thumbnail($contents, $thumb_width=0)
|
||||
|
||||
if (!$thumb_width) {
|
||||
$dvc_width = intval($_COOKIE['device_width']);
|
||||
if(G4_IS_MOBILE && $dvc_width) {
|
||||
if(G5_IS_MOBILE && $dvc_width) {
|
||||
// 썸네일 width 설정
|
||||
$thumb_width = 320;
|
||||
|
||||
@ -112,10 +112,10 @@ function get_view_thumbnail($contents, $thumb_width=0)
|
||||
else
|
||||
$data_path = $p['path'];
|
||||
|
||||
if(!preg_match('/^\/'.G4_DATA_DIR.'/', $data_path))
|
||||
if(!preg_match('/^\/'.G5_DATA_DIR.'/', $data_path))
|
||||
continue;
|
||||
|
||||
$srcfile = G4_PATH.$data_path;
|
||||
$srcfile = G5_PATH.$data_path;
|
||||
|
||||
if(is_file($srcfile)) {
|
||||
// 썸네일 높이
|
||||
@ -146,12 +146,12 @@ function get_view_thumbnail($contents, $thumb_width=0)
|
||||
$img_tag = $matchs[0][$i];
|
||||
preg_match("/alt=[\"\']?([^\"\']*)[\"\']?/", $img_tag, $malt);
|
||||
$alt = get_text($malt[1]);
|
||||
$thumb_tag = '<img src="'.G4_URL.str_replace($filename, $thumb_file, $data_path).'" alt="'.$alt.'"/>';
|
||||
$thumb_tag = '<img src="'.G5_URL.str_replace($filename, $thumb_file, $data_path).'" alt="'.$alt.'"/>';
|
||||
|
||||
// $img_tag에 editor 경로가 있으면 원본보기 링크 추가
|
||||
if(strpos($matchs[1][$i], 'data/editor') && preg_match("/\.({$config['cf_image_extension']})$/i", $filename)) {
|
||||
$imgurl = str_replace(G4_URL, "", $matchs[1][$i]);
|
||||
$thumb_tag = '<a href="'.G4_BBS_URL.'/view_image.php?fn='.urlencode($imgurl).'" target="_blank" class="view_image">'.$thumb_tag.'</a>';
|
||||
$imgurl = str_replace(G5_URL, "", $matchs[1][$i]);
|
||||
$thumb_tag = '<a href="'.G5_BBS_URL.'/view_image.php?fn='.urlencode($imgurl).'" target="_blank" class="view_image">'.$thumb_tag.'</a>';
|
||||
}
|
||||
|
||||
$contents = str_replace($img_tag, $thumb_tag, $contents);
|
||||
@ -163,7 +163,7 @@ function get_view_thumbnail($contents, $thumb_width=0)
|
||||
|
||||
function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_height, $is_create, $is_crop=false, $crop_mode='center', $is_sharpen=true, $um_value='80/0.5/3')
|
||||
{
|
||||
global $g4;
|
||||
global $g5;
|
||||
|
||||
if(!$thumb_width && !$thumb_height)
|
||||
return;
|
||||
@ -180,8 +180,8 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
return;
|
||||
|
||||
if (!is_dir($target_path)) {
|
||||
@mkdir($target_path, G4_DIR_PERMISSION);
|
||||
@chmod($target_path, G4_DIR_PERMISSION);
|
||||
@mkdir($target_path, G5_DIR_PERMISSION);
|
||||
@chmod($target_path, G5_DIR_PERMISSION);
|
||||
}
|
||||
|
||||
// Animated GIF는 썸네일 생성하지 않음
|
||||
@ -299,7 +299,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
}
|
||||
|
||||
imagejpeg($dst, $thumb_file, 90);
|
||||
@chmod($thumb_file, G4_FILE_PERMISSION); // 추후 삭제를 위하여 파일모드 변경
|
||||
@chmod($thumb_file, G5_FILE_PERMISSION); // 추후 삭제를 위하여 파일모드 변경
|
||||
|
||||
imagedestroy($src);
|
||||
imagedestroy($dst);
|
||||
|
||||
@ -4,7 +4,7 @@ if (!defined('_GNUBOARD_')) exit;
|
||||
// 방문자수 출력
|
||||
function visit($skin_dir='basic')
|
||||
{
|
||||
global $config, $g4, $is_admin;
|
||||
global $config, $g5, $is_admin;
|
||||
|
||||
// visit 배열변수에
|
||||
// $visit[1] = 오늘
|
||||
@ -19,12 +19,12 @@ function visit($skin_dir='basic')
|
||||
settype($visit[3], "integer");
|
||||
|
||||
ob_start();
|
||||
if(G4_IS_MOBILE) {
|
||||
$visit_skin_path = G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/visit/'.$skin_dir;
|
||||
$visit_skin_url = G4_MOBILE_URL.'/'.G4_SKIN_DIR.'/visit/'.$skin_dir;
|
||||
if(G5_IS_MOBILE) {
|
||||
$visit_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/visit/'.$skin_dir;
|
||||
$visit_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/visit/'.$skin_dir;
|
||||
} else {
|
||||
$visit_skin_path = G4_SKIN_PATH.'/visit/'.$skin_dir;
|
||||
$visit_skin_url = G4_SKIN_URL.'/visit/'.$skin_dir;
|
||||
$visit_skin_path = G5_SKIN_PATH.'/visit/'.$skin_dir;
|
||||
$visit_skin_url = G5_SKIN_URL.'/visit/'.$skin_dir;
|
||||
}
|
||||
include_once ($visit_skin_path.'/visit.skin.php');
|
||||
$content = ob_get_contents();
|
||||
|
||||
Reference in New Issue
Block a user