Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e891791f86 | ||
|
|
59468d1312 | ||
|
|
43fae4ed50 |
+6
-6
@@ -9,7 +9,7 @@ $token = get_token();
|
||||
if ($w == '')
|
||||
{
|
||||
$required_mb_id = 'required';
|
||||
$required_mb_id_class = 'required minlength=3 alnum_';
|
||||
$required_mb_id_class = 'required alnum_';
|
||||
$required_mb_password = 'required';
|
||||
$sound_only = '<strong class="sound_only">필수</strong>';
|
||||
|
||||
@@ -153,7 +153,7 @@ include_once('./admin.head.php');
|
||||
<tr>
|
||||
<th scope="row"><label for="mb_id">아이디<?php echo $sound_only ?></label></th>
|
||||
<td>
|
||||
<input type="text" name="mb_id" value="<?php echo $mb['mb_id'] ?>" id="mb_id" <?php echo $required_mb_id ?> class="frm_input <?php echo $required_mb_id_class ?>" size="15" maxlength="20" >
|
||||
<input type="text" name="mb_id" value="<?php echo $mb['mb_id'] ?>" id="mb_id" <?php echo $required_mb_id ?> class="frm_input <?php echo $required_mb_id_class ?>" size="15" minlength="3" maxlength="20">
|
||||
<?php if ($w=='u'){ ?><a href="./boardgroupmember_form.php?mb_id=<?php echo $mb['mb_id'] ?>">접근가능그룹보기</a><?php } ?>
|
||||
</td>
|
||||
<th scope="row"><label for="mb_password">비밀번호<?php echo $sound_only ?></label></th>
|
||||
@@ -161,9 +161,9 @@ include_once('./admin.head.php');
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="mb_name">이름(실명)<strong class="sound_only">필수</strong></label></th>
|
||||
<td><input type="text" name="mb_name" value="<?php echo $mb['mb_name'] ?>" id="mb_name" required class="required frm_input minlength=2" size="15" maxlength="20"></td>
|
||||
<td><input type="text" name="mb_name" value="<?php echo $mb['mb_name'] ?>" id="mb_name" required class="required frm_input" size="15" minlength="2" maxlength="20"></td>
|
||||
<th scope="row"><label for="mb_nick">닉네임<strong class="sound_only">필수</strong></label></th>
|
||||
<td><input type="text" name="mb_nick" value="<?php echo $mb['mb_nick'] ?>" id="mb_nick" required class="required frm_input minlength=2" size="15" maxlength="20"></td>
|
||||
<td><input type="text" name="mb_nick" value="<?php echo $mb['mb_nick'] ?>" id="mb_nick" required class="required frm_input" size="15" minlength="2" maxlength="20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="mb_level">회원 권한</label></th>
|
||||
@@ -219,11 +219,11 @@ include_once('./admin.head.php');
|
||||
<input type="text" name="mb_addr1" value="<?php echo $mb['mb_addr1'] ?>" id="mb_addr1" class="frm_input readonly" size="60">
|
||||
<label for="mb_addr1">기본주소</label><br>
|
||||
<input type="text" name="mb_addr2" value="<?php echo $mb['mb_addr2'] ?>" id="mb_addr2" class="frm_input" size="60">
|
||||
<label for="mb_addr2">상세주소</label><br>
|
||||
<label for="mb_addr2">상세주소</label>
|
||||
<br>
|
||||
<input type="text" name="mb_addr3" value="<?php echo $mb['mb_addr3'] ?>" id="mb_addr3" class="frm_input" size="60">
|
||||
<label for="mb_addr3">참고항목</label>
|
||||
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $mb['mb_addr_jibeon']; ?>"><br>
|
||||
<span id="mb_addr_jibeon">지번주소 : <?php echo $mb['mb_addr_jibeon']; ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
+1
-1
@@ -186,7 +186,7 @@ $colspan = 16;
|
||||
if ($intercept_title == '')
|
||||
$intercept_title = '차단하기';
|
||||
|
||||
$address = $row['mb_zip1'] ? print_address($row['mb_addr1'], $row['mb_addr2'], $row['mb_addr3']) : '';
|
||||
$address = $row['mb_zip1'] ? print_address($row['mb_addr1'], $row['mb_addr2'], $row['mb_addr3'], $row['mb_addr_jibeon']) : '';
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
|
||||
|
||||
@@ -28,16 +28,19 @@ if (!$mb['mb_id'])
|
||||
else if (is_admin($mb['mb_id']))
|
||||
alert('관리자 아이디는 접근 불가합니다.');
|
||||
|
||||
// 난수 발생
|
||||
srand(time());
|
||||
// 임시비밀번호 발급
|
||||
$change_password = rand(100000, 999999);
|
||||
$mb_lost_certify = sql_password($change_password);
|
||||
$mb_datetime = sql_password($mb['mb_datetime']);
|
||||
|
||||
$sql = " update {$g5['member_table']} set mb_lost_certify = '$mb_lost_certify' where mb_id = '{$mb['mb_id']}' ";
|
||||
// 어떠한 회원정보도 포함되지 않은 일회용 난수를 생성하여 인증에 사용
|
||||
$mb_nonce = bin2hex(pack('V*', rand(), rand(), rand(), rand()));
|
||||
|
||||
// 임시비밀번호와 난수를 mb_lost_certify 필드에 저장
|
||||
$sql = " update {$g5['member_table']} set mb_lost_certify = '$mb_nonce $mb_lost_certify' where mb_id = '{$mb['mb_id']}' ";
|
||||
sql_query($sql);
|
||||
|
||||
$href = G5_BBS_URL.'/password_lost_certify.php?mb_no='.$mb['mb_no'].'&mb_datetime='.$mb_datetime.'&mb_lost_certify='.$mb_lost_certify;
|
||||
// 인증 링크 생성
|
||||
$href = G5_BBS_URL.'/password_lost_certify.php?mb_no='.$mb['mb_no'].'&mb_nonce='.$mb_nonce;
|
||||
|
||||
$subject = "[".$config['cf_title']."] 요청하신 회원정보 찾기 안내 메일입니다.";
|
||||
|
||||
@@ -69,4 +72,4 @@ $content .= '</div>';
|
||||
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $mb['mb_email'], $subject, $content, 1);
|
||||
|
||||
alert_close($email.' 메일로 회원아이디와 비밀번호를 인증할 수 있는 메일이 발송 되었습니다.\\n\\n메일을 확인하여 주십시오.');
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -4,24 +4,24 @@ include_once('./_common.php');
|
||||
// 오류시 공히 Error 라고 처리하는 것은 회원정보가 있는지? 비밀번호가 틀린지? 를 알아보려는 해킹에 대비한것
|
||||
|
||||
$mb_no = trim($_GET['mb_no']);
|
||||
$mb_datetime = trim($_GET['mb_datetime']);
|
||||
$mb_lost_certify = trim($_GET['mb_lost_certify']);
|
||||
$mb_nonce = trim($_GET['mb_nonce']);
|
||||
|
||||
// 회원아이디가 아닌 회원고유번호로 회원정보를 구한다.
|
||||
$sql = " select mb_id, mb_datetime, mb_lost_certify from {$g5['member_table']} where mb_no = '$mb_no' ";
|
||||
$sql = " select mb_id, mb_lost_certify from {$g5['member_table']} where mb_no = '$mb_no' ";
|
||||
$mb = sql_fetch($sql);
|
||||
if (!trim($mb['mb_lost_certify']))
|
||||
if (strlen($mb['mb_lost_certify']) < 33)
|
||||
die("Error");
|
||||
|
||||
// 인증 링크는 한번만 처리가 되게 한다.
|
||||
sql_query(" update {$g5['member_table']} set mb_lost_certify = '' where mb_no = '$mb_no' ");
|
||||
|
||||
// 변경될 비밀번호가 넘어와야하고 저장된 변경비밀번호를 md5 로 변환하여 같으면 정상
|
||||
if ($mb_lost_certify && $mb_datetime === sql_password($mb['mb_datetime']) && $mb_lost_certify === $mb['mb_lost_certify']) {
|
||||
sql_query(" update {$g5['member_table']} set mb_password = '{$mb['mb_lost_certify']}' where mb_no = '$mb_no' ");
|
||||
// 인증을 위한 난수가 제대로 넘어온 경우 임시비밀번호를 실제 비밀번호로 바꿔준다.
|
||||
if ($mb_nonce === substr($mb['mb_lost_certify'], 0, 32)) {
|
||||
$new_password_hash = substr($mb['mb_lost_certify'], 33);
|
||||
sql_query(" update {$g5['member_table']} set mb_password = '$new_password_hash' where mb_no = '$mb_no' ");
|
||||
alert('비밀번호가 변경됐습니다.\\n\\n회원아이디와 변경된 비밀번호로 로그인 하시기 바랍니다.', G5_BBS_URL.'/login.php');
|
||||
}
|
||||
else {
|
||||
die("Error");
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -110,6 +110,13 @@ if ($w == '' || $w == 'u') {
|
||||
if ($msg = exist_mb_email($mb_email, $mb_id)) alert($msg, "", true, true);
|
||||
}
|
||||
|
||||
$mb_zip1 = preg_replace('/[^0-9]/', '', $mb_zip1);
|
||||
$mb_zip2 = preg_replace('/[^0-9]/', '', $mb_zip2);
|
||||
$mb_addr1 = clean_xss_tags($mb_addr1);
|
||||
$mb_addr2 = clean_xss_tags($mb_addr2);
|
||||
$mb_addr3 = clean_xss_tags($mb_addr3);
|
||||
$mb_addr_jibeon = preg_match("/^(N|R)$/", $mb_addr_jibeon) ? $mb_addr_jibeon : '';
|
||||
|
||||
// 사용자 코드 실행
|
||||
@include_once($member_skin_path.'/register_form_update.head.skin.php');
|
||||
|
||||
|
||||
+6
-63
@@ -1,72 +1,15 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
// 메모리를 많이 잡아먹어서 아래의 코드로 대체
|
||||
//ini_set('memory_limit', '20M');
|
||||
//$zipfile = file("./zip.db");
|
||||
|
||||
/*
|
||||
$zipfile = array();
|
||||
$fp = fopen('./zip.db', 'r');
|
||||
while(!feof($fp)) {
|
||||
$zipfile[] = fgets($fp, 4096);
|
||||
}
|
||||
fclose($fp);
|
||||
|
||||
$search_count = 0;
|
||||
|
||||
if ($addr1)
|
||||
{
|
||||
while ($zipcode = each($zipfile))
|
||||
{
|
||||
if(strstr(substr($zipcode[1],9,512), $addr1))
|
||||
{
|
||||
$list[$search_count][zip1] = substr($zipcode[1],0,3);
|
||||
$list[$search_count][zip2] = substr($zipcode[1],4,3);
|
||||
$addr = explode(" ", substr($zipcode[1],8));
|
||||
|
||||
if ($addr[sizeof($addr)-1])
|
||||
{
|
||||
$list[$search_count][addr] = str_replace($addr[sizeof($addr)-1], "", substr($zipcode[1],8));
|
||||
$list[$search_count][bunji] = trim($addr[sizeof($addr)-1]);
|
||||
}
|
||||
else
|
||||
$list[$search_count][addr] = substr($zipcode[1],8);
|
||||
|
||||
$list[$search_count][encode_addr] = urlencode($list[$search_count][addr]);
|
||||
$search_count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$search_count) alert('찾으시는 주소가 없습니다.');
|
||||
}
|
||||
*/
|
||||
|
||||
/* 기존의 DB에서 불러오는 방식
|
||||
if ($addr1)
|
||||
{
|
||||
//$sql = " select * from $g5[zip_table] where zp_dong like '%$addr1%' order by zp_id ";
|
||||
$sql = " select * from $g5[zip_table] where zp_dong like '%$addr1%' order by zp_sido, zp_gugun, zp_dong ";
|
||||
$result = sql_query($sql);
|
||||
$search_count = 0;
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$list[$i][zip1] = substr($row[zp_code], 0, 3);
|
||||
$list[$i][zip2] = substr($row[zp_code], 3, 3);
|
||||
$list[$i][addr] = "$row[zp_sido] $row[zp_gugun] $row[zp_dong]";
|
||||
$list[$i][bunji] = $row[zp_bunji];
|
||||
$list[$i][encode_addr] = urlencode($list[$i][addr]);
|
||||
$search_count++;
|
||||
}
|
||||
|
||||
if (!$search_count)
|
||||
alert("찾으시는 주소가 없습니다.");
|
||||
}
|
||||
*/
|
||||
|
||||
$g5['title'] = '우편번호 검색';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
|
||||
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') { //https 통신
|
||||
echo '<script src="https://spi.maps.daum.net/imap/map_js_init/postcode.js"></script>';
|
||||
} else { //http 통신
|
||||
echo '<script src="http://dmaps.daum.net/map_js_init/postcode.js"></script>';
|
||||
}
|
||||
|
||||
include_once($member_skin_path.'/zip.skin.php');
|
||||
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
|
||||
+14
-9
@@ -364,17 +364,22 @@ if (isset($_REQUEST['gr_id'])) {
|
||||
if ($_SESSION['ss_mb_id']) { // 로그인중이라면
|
||||
$member = get_member($_SESSION['ss_mb_id']);
|
||||
|
||||
// 오늘 처음 로그인 이라면
|
||||
if (substr($member['mb_today_login'], 0, 10) != G5_TIME_YMD) {
|
||||
// 첫 로그인 포인트 지급
|
||||
insert_point($member['mb_id'], $config['cf_login_point'], G5_TIME_YMD.' 첫로그인', '@login', $member['mb_id'], G5_TIME_YMD);
|
||||
// 차단된 회원이면 ss_mb_id 초기화
|
||||
if($member['mb_intercept_date'] && $member['mb_intercept_date'] <= date("Ymd", G5_SERVER_TIME)) {
|
||||
set_session('ss_mb_id', '');
|
||||
$member = array();
|
||||
} else {
|
||||
// 오늘 처음 로그인 이라면
|
||||
if (substr($member['mb_today_login'], 0, 10) != G5_TIME_YMD) {
|
||||
// 첫 로그인 포인트 지급
|
||||
insert_point($member['mb_id'], $config['cf_login_point'], G5_TIME_YMD.' 첫로그인', '@login', $member['mb_id'], G5_TIME_YMD);
|
||||
|
||||
// 오늘의 로그인이 될 수도 있으며 마지막 로그인일 수도 있음
|
||||
// 해당 회원의 접근일시와 IP 를 저장
|
||||
$sql = " update {$g5['member_table']} set mb_today_login = '".G5_TIME_YMDHIS."', mb_login_ip = '{$_SERVER['REMOTE_ADDR']}' where mb_id = '{$member['mb_id']}' ";
|
||||
sql_query($sql);
|
||||
// 오늘의 로그인이 될 수도 있으며 마지막 로그인일 수도 있음
|
||||
// 해당 회원의 접근일시와 IP 를 저장
|
||||
$sql = " update {$g5['member_table']} set mb_today_login = '".G5_TIME_YMDHIS."', mb_login_ip = '{$_SERVER['REMOTE_ADDR']}' where mb_id = '{$member['mb_id']}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// 자동로그인 ---------------------------------------
|
||||
// 회원아이디가 쿠키에 저장되어 있다면 (3.27)
|
||||
|
||||
@@ -175,6 +175,9 @@ define('G5_LINK_COUNT', 2);
|
||||
// 썸네일 jpg Quality 설정
|
||||
define('G5_THUMB_JPG_QUALITY', 90);
|
||||
|
||||
// 썸네일 png Compress 설정
|
||||
define('G5_THUMB_PNG_COMPRESS', 5);
|
||||
|
||||
// ip 숨김방법 설정
|
||||
/* 123.456.789.012 ip의 숨김 방법을 변경하는 방법은
|
||||
\\1 은 123, \\2는 456, \\3은 789, \\4는 012에 각각 대응되므로
|
||||
|
||||
+1
-1
@@ -377,7 +377,7 @@ var win_homepage = function(href) {
|
||||
* 우편번호 창
|
||||
**/
|
||||
var win_zip = function(href) {
|
||||
var new_win = window.open(href, 'win_zip', 'width=616, height=760, scrollbars=1');
|
||||
var new_win = window.open(href, 'win_zip', 'width=483, height=600, scrollbars=1');
|
||||
new_win.focus();
|
||||
}
|
||||
|
||||
|
||||
+9
-8
@@ -204,15 +204,15 @@ function wrestAlNum_(fld)
|
||||
}
|
||||
|
||||
// 최소 길이 검사
|
||||
function wrestMinLength(fld, css)
|
||||
function wrestMinLength(fld)
|
||||
{
|
||||
if (!wrestTrim(fld)) return;
|
||||
|
||||
var str = css.split('='); // minlength=?? <-- str[1]
|
||||
var minlength = fld.getAttribute("minlength");
|
||||
|
||||
if (wrestFld == null) {
|
||||
if (fld.value.length < parseInt(str[1])) {
|
||||
wrestMsg = wrestItemname(fld) + " : 최소 "+str[1]+"글자 이상 입력하세요.\n";
|
||||
if (fld.value.length < parseInt(minlength)) {
|
||||
wrestMsg = wrestItemname(fld) + " : 최소 "+minlength+"글자 이상 입력하세요.\n";
|
||||
wrestFld = fld;
|
||||
}
|
||||
}
|
||||
@@ -282,6 +282,10 @@ function wrestSubmit()
|
||||
wrestRequired(el);
|
||||
}
|
||||
|
||||
if (el.getAttribute("minlength") != null) {
|
||||
wrestMinLength(el);
|
||||
}
|
||||
|
||||
var array_css = el.className.split(" "); // class 를 공백으로 나눔
|
||||
|
||||
el.style.backgroundColor = wrestFldDefaultColor;
|
||||
@@ -305,10 +309,7 @@ function wrestSubmit()
|
||||
case "telnum" : wrestTelNum(el); break; // 김선용 2006.3 - 전화번호 형식 검사
|
||||
case "imgext" : wrestImgExt(el); break;
|
||||
default :
|
||||
// css 가 minlength= 로 시작한다면 = 뒤의 숫자는 최소길이값
|
||||
if (/^minlength\=/.test(css)) {
|
||||
wrestMinLength(el, css); break;
|
||||
} else if (/^extension\=/.test(css)) {
|
||||
if (/^extension\=/.test(css)) {
|
||||
wrestExtension(el, css); break;
|
||||
}
|
||||
} // switch (css)
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
// 시도 정보
|
||||
// sido 의 '서울특별시' 는 sigungu 의 '서울특별시' 와 일치해야 함
|
||||
var sido = new Array(
|
||||
Array('서울특별시' , '서울'),
|
||||
Array('부산광역시' , '부산'),
|
||||
Array('대구광역시' , '대구'),
|
||||
Array('인천광역시' , '인천'),
|
||||
Array('광주광역시' , '광주'),
|
||||
Array('대전광역시' , '대전'),
|
||||
Array('울산광역시' , '울산'),
|
||||
Array('세종특별자치시' , '세종'),
|
||||
Array('경기도' , '경기'),
|
||||
Array('강원도' , '강원'),
|
||||
Array('충청북도' , '충북'),
|
||||
Array('충청남도' , '충남'),
|
||||
Array('전라북도' , '전북'),
|
||||
Array('전라남도' , '전남'),
|
||||
Array('경상북도' , '경북'),
|
||||
Array('경상남도' , '경남'),
|
||||
Array('제주특별자치도' , '제주')
|
||||
);
|
||||
|
||||
// 시군구 정보
|
||||
var sigungu = new Array();
|
||||
|
||||
sigungu['서울특별시'] = '강남구,강동구,강북구,강서구,관악구,광진구,구로구,금천구,노원구,도봉구,동대문구,동작구,마포구,서대문구,서초구,성동구,성북구,송파구,양천구,영등포구,용산구,은평구,종로구,중구,중랑구';
|
||||
sigungu['부산광역시'] = '강서구,금정구,기장군,남구,동구,동래구,부산진구,북구,사상구,사하구,서구,수영구,연제구,영도구,중구,해운대구';
|
||||
sigungu['대구광역시'] = '남구,달서구,달성군,동구,북구,서구,수성구,중구';
|
||||
sigungu['인천광역시'] = '강화군,계양구,남구,남동구,동구,부평구,서구,연수구,옹진군,중구';
|
||||
sigungu['광주광역시'] = '광산구,남구,동구,북구,서구';
|
||||
sigungu['대전광역시'] = '대덕구,동구,서구,유성구,중구';
|
||||
sigungu['울산광역시'] = '남구,동구,북구,울주군,중구';
|
||||
sigungu['세종특별자치시'] = '없음';
|
||||
sigungu['경기도'] = '가평군,고양시 덕양구,고양시 일산동구,고양시 일산서구,과천시,광명시,광주시,구리시,군포시,김포시,남양주시,동두천시,부천시 소사구,부천시 오정구,부천시 원미구,성남시 분당구,성남시 수정구,성남시 중원구,수원시 권선구,수원시 영통구,수원시 장안구,수원시 팔달구,시흥시,안산시 단원구,안산시 상록구,안성시,안양시 동안구,안양시 만안구,양주시,양평군,여주시,연천군,오산시,용인시 기흥구,용인시 수지구,용인시 처인구,의왕시,의정부시,이천시,파주시,평택시,포천시,하남시,화성시';
|
||||
sigungu['강원도'] = '강릉시,고성군,동해시,삼척시,속초시,양구군,양양군,영월군,원주시,인제군,정선군,철원군,춘천시,태백시,평창군,홍천군,화천군,횡성군';
|
||||
sigungu['충청북도'] = '괴산군,단양군,보은군,영동군,옥천군,음성군,제천시,증평군,진천군,청원군,청주시 상당구,청주시 흥덕구,충주시';
|
||||
sigungu['충청남도'] = '계룡시,공주시,금산군,논산시,당진시,보령시,부여군,서산시,서천군,아산시,예산군,천안시 동남구,천안시 서북구,청양군,태안군,홍성군';
|
||||
sigungu['전라북도'] = '전주시 완산구,전주시 덕진구,군산시,익산시,정읍시,남원시,김제시,완주군,진안군,무주군,장수군,임실군,순창군,고창군,부안군';
|
||||
sigungu['전라남도'] = '강진군,고흥군,곡성군,광양시,구례군,나주시,담양군,목포시,무안군,보성군,순천시,신안군,여수시,영광군,영암군,완도군,장성군,장흥군,진도군,함평군,해남군,화순군';
|
||||
sigungu['경상북도'] = '경산시,경주시,고령군,구미시,군위군,김천시,문경시,봉화군,상주시,성주군,안동시,영덕군,영양군,영주시,영천시,예천군,울릉군,울진군,의성군,청도군,청송군,칠곡군,포항시 남구,포항시 북구';
|
||||
sigungu['경상남도'] = '거제시,거창군,고성군,김해시,남해군,밀양시,사천시,산청군,양산시,의령군,진주시,창녕군,창원시 마산합포구,창원시 마산회원구,창원시 성산구,창원시 의창구,창원시 진해구,통영시,하동군,함안군,함양군,합천군';
|
||||
sigungu['제주특별자치도'] = '서귀포시,제주시';
|
||||
|
||||
$(function() {
|
||||
// 시도 선택시 시군구 option 을 만든다.
|
||||
$("#sido").bind("change", function() {
|
||||
var sido = $(this).val();
|
||||
|
||||
gugun_make(sido);
|
||||
});
|
||||
|
||||
// 로딩시 시도 option 을 만든다.
|
||||
for (var i=0; i<sido.length; i++) {
|
||||
$("#sido").append($('<option></option>').val(sido[i][0]).text(sido[i][1]));
|
||||
}
|
||||
});
|
||||
|
||||
function gugun_make(sido)
|
||||
{
|
||||
var gugun = document.getElementById("gugun");
|
||||
|
||||
gugun.options.length = 1;
|
||||
gugun.options[0].value = "";
|
||||
gugun.options[0].text = "- 시군구 선택 -";
|
||||
gugun.options[0].selected = true;
|
||||
if (!sido) {
|
||||
return;
|
||||
}
|
||||
|
||||
sojae = sigungu[sido].split(",");
|
||||
gugun.options.length = sojae.length+1;
|
||||
for (i=0; i<sojae.length; i++) {
|
||||
gugun.options[i+1].value = (sojae[i] == "없음") ? "" : sojae[i];
|
||||
gugun.options[i+1].text = sojae[i];
|
||||
}
|
||||
}
|
||||
|
||||
function search_call(page)
|
||||
{
|
||||
$("#q_info").fadeOut(200);
|
||||
|
||||
var sido = $("#sido").val();
|
||||
var gugun = $("#gugun").val();
|
||||
var q = $.trim($("#q").val());
|
||||
|
||||
if(!page)
|
||||
page = 1;
|
||||
|
||||
$.getJSON("//juso.sir.co.kr/search.php?sido="+sido+"&gugun="+gugun+"&page="+page+"&q="+q+"&callback=?",
|
||||
function(data) {
|
||||
$("#result").empty();
|
||||
|
||||
if(data.error) {
|
||||
alert(data.error);
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#result").html(data.juso);
|
||||
}
|
||||
);
|
||||
}
|
||||
+10
-6
@@ -2579,19 +2579,23 @@ function module_exec_check($exe, $type)
|
||||
return $error;
|
||||
}
|
||||
|
||||
// 도로명주소 출력
|
||||
// 주소출력
|
||||
function print_address($addr1, $addr2, $addr3)
|
||||
function print_address($addr1, $addr2, $addr3, $addr4)
|
||||
{
|
||||
$address = trim($addr1);
|
||||
$addr2 = trim($addr2);
|
||||
$addr3 = trim($addr3);
|
||||
|
||||
if($addr2)
|
||||
$address .= ', '.$addr2;
|
||||
if($addr4 == 'N') {
|
||||
if($addr2)
|
||||
$address .= ' '.$addr2;
|
||||
} else {
|
||||
if($addr2)
|
||||
$address .= ', '.$addr2;
|
||||
|
||||
if($addr3)
|
||||
$address .= ' '.$addr3;
|
||||
if($addr3)
|
||||
$address .= ' '.$addr3;
|
||||
}
|
||||
|
||||
return $address;
|
||||
}
|
||||
|
||||
+39
-11
@@ -4,7 +4,7 @@ if (!defined('_GNUBOARD_')) exit;
|
||||
@ini_set('memory_limit', '512M');
|
||||
|
||||
// 게시글리스트 썸네일 생성
|
||||
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')
|
||||
function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create=false, $is_crop=true, $crop_mode='center', $is_sharpen=false, $um_value='80/0.5/3')
|
||||
{
|
||||
global $g5, $config;
|
||||
$filename = $alt = "";
|
||||
@@ -184,15 +184,13 @@ function get_view_thumbnail($contents, $thumb_width=0)
|
||||
return $contents;
|
||||
}
|
||||
|
||||
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')
|
||||
function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_height, $is_create, $is_crop=false, $crop_mode='center', $is_sharpen=false, $um_value='80/0.5/3')
|
||||
{
|
||||
global $g5;
|
||||
|
||||
if(!$thumb_width && !$thumb_height)
|
||||
return;
|
||||
|
||||
$thumb_filename = preg_replace("/\.[^\.]+$/i", "", $filename); // 확장자제거
|
||||
$thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.jpg";
|
||||
$source_file = "$source_path/$filename";
|
||||
|
||||
if(!is_file($source_file)) // 원본 파일이 없다면
|
||||
@@ -217,6 +215,11 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
return basename($source_file);
|
||||
}
|
||||
|
||||
$ext = array(1 => 'gif', 2 => 'jpg', 3 => 'png');
|
||||
|
||||
$thumb_filename = preg_replace("/\.[^\.]+$/i", "", $filename); // 확장자제거
|
||||
$thumb_file = "$target_path/thumb-{$thumb_filename}_{$thumb_width}x{$thumb_height}.".$ext[$size[2]];
|
||||
|
||||
$thumb_time = @filemtime($thumb_file);
|
||||
$source_time = @filemtime($source_file);
|
||||
|
||||
@@ -266,6 +269,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
}
|
||||
} else if ($size[2] == 3) {
|
||||
$src = imagecreatefrompng($source_file);
|
||||
imagealphablending($src, true);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
@@ -324,6 +328,11 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
}
|
||||
|
||||
$dst = imagecreatetruecolor($dst_w, $dst_h);
|
||||
|
||||
if($size[2] == 3) {
|
||||
imagealphablending($dst, false);
|
||||
imagesavealpha($dst, true);
|
||||
}
|
||||
} else {
|
||||
$dst = imagecreatetruecolor($dst_w, $dst_h);
|
||||
|
||||
@@ -345,8 +354,15 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
}
|
||||
}
|
||||
|
||||
$bgcolor = imagecolorallocate($dst, 255, 255, 255); // 배경색
|
||||
imagefill($dst, 0, 0, $bgcolor);
|
||||
if($size[2] == 3) {
|
||||
$bgcolor = imagecolorallocatealpha($dst, 0, 0, 0, 127);
|
||||
imagefill($dst, 0, 0, $bgcolor);
|
||||
imagealphablending($dst, false);
|
||||
imagesavealpha($dst, true);
|
||||
} else {
|
||||
$bgcolor = imagecolorallocate($dst, 255, 255, 255); // 배경색
|
||||
imagefill($dst, 0, 0, $bgcolor);
|
||||
}
|
||||
}
|
||||
|
||||
imagecopyresampled($dst, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
|
||||
@@ -357,12 +373,24 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h
|
||||
UnsharpMask($dst, $val[0], $val[1], $val[2]);
|
||||
}
|
||||
|
||||
if(!defined('G5_THUMB_JPG_QUALITY'))
|
||||
$jpg_quality = 90;
|
||||
else
|
||||
$jpg_quality = G5_THUMB_JPG_QUALITY;
|
||||
if($size[2] == 1) {
|
||||
imagegif($dst, $thumb_file);
|
||||
} else if($size[2] == 3) {
|
||||
if(!defined('G5_THUMB_PNG_COMPRESS'))
|
||||
$png_compress = 5;
|
||||
else
|
||||
$png_compress = G5_THUMB_PNG_COMPRESS;
|
||||
|
||||
imagepng($dst, $thumb_file, $png_compress);
|
||||
} else {
|
||||
if(!defined('G5_THUMB_JPG_QUALITY'))
|
||||
$jpg_quality = 90;
|
||||
else
|
||||
$jpg_quality = G5_THUMB_JPG_QUALITY;
|
||||
|
||||
imagejpeg($dst, $thumb_file, $jpg_quality);
|
||||
}
|
||||
|
||||
imagejpeg($dst, $thumb_file, $jpg_quality);
|
||||
chmod($thumb_file, G5_FILE_PERMISSION); // 추후 삭제를 위하여 파일모드 변경
|
||||
|
||||
imagedestroy($src);
|
||||
|
||||
@@ -31,17 +31,17 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
<th scope="row"><label for="reg_mb_id">아이디<strong class="sound_only">필수</strong></label></th>
|
||||
<td>
|
||||
<span class="frm_info">영문자, 숫자, _ 만 입력 가능. 최소 3자이상 입력하세요.</span>
|
||||
<input type="text" name="mb_id" value="<?php echo $member['mb_id'] ?>" id="reg_mb_id" class="frm_input minlength=3 <?php echo $required ?> <?php echo $readonly ?>" maxlength="20" <?php echo $required ?> <?php echo $readonly ?>>
|
||||
<input type="text" name="mb_id" value="<?php echo $member['mb_id'] ?>" id="reg_mb_id" class="frm_input <?php echo $required ?> <?php echo $readonly ?>" minlength="3" maxlength="20" <?php echo $required ?> <?php echo $readonly ?>>
|
||||
<span id="msg_mb_id"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="reg_mb_password">비밀번호<strong class="sound_only">필수</strong></label></th>
|
||||
<td><input type="password" name="mb_password" id="reg_mb_password" class="frm_input minlength=3 <?php echo $required ?>" maxlength="20" <?php echo $required ?>></td>
|
||||
<td><input type="password" name="mb_password" id="reg_mb_password" class="frm_input <?php echo $required ?>" minlength="3" maxlength="20" <?php echo $required ?>></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="reg_mb_password_re">비밀번호 확인<strong class="sound_only">필수</strong></label></th>
|
||||
<td><input type="password" name="mb_password_re" id="reg_mb_password_re" class="frm_input minlength=3 <?php echo $required ?>" maxlength="20" <?php echo $required ?>></td>
|
||||
<td><input type="password" name="mb_password_re" id="reg_mb_password_re" class="frm_input <?php echo $required ?>" minlength="3" maxlength="20" <?php echo $required ?>></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@@ -150,11 +150,11 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
<label for="reg_mb_addr1" class="sound_only">주소<?php echo $config['cf_req_addr']?'<strong class="sound_only"> 필수</strong>':''; ?></label>
|
||||
<input type="text" name="mb_addr1" value="<?php echo $member['mb_addr1'] ?>" id="reg_mb_addr1" <?php echo $config['cf_req_addr']?"required":""; ?> class="frm_input frm_address <?php echo $config['cf_req_addr']?"required":""; ?>" size="50"><br>
|
||||
<label for="reg_mb_addr2" class="sound_only">상세주소</label>
|
||||
<input type="text" name="mb_addr2" value="<?php echo $member['mb_addr2'] ?>" id="reg_mb_addr2" class="frm_input frm_address" size="50"><br>
|
||||
<input type="text" name="mb_addr2" value="<?php echo $member['mb_addr2'] ?>" id="reg_mb_addr2" class="frm_input frm_address" size="50">
|
||||
<br>
|
||||
<label for="reg_mb_addr3" class="sound_only">참고항목</label>
|
||||
<input type="text" name="mb_addr3" value="<?php echo $member['mb_addr3'] ?>" id="reg_mb_addr3" readonly="readonly" class="frm_input frm_address" size="50">
|
||||
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $member['mb_addr_jibeon']; ?>"><br>
|
||||
<span id="mb_addr_jibeon"><?php echo ($member['mb_addr_jibeon'] ? '지번주소 : '.$member['mb_addr_jibeon'] : ''); ?></span>
|
||||
<input type="text" name="mb_addr3" value="<?php echo $member['mb_addr3'] ?>" id="reg_mb_addr3" class="frm_input frm_address" size="50" readonly="readonly">
|
||||
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $member['mb_addr_jibeon']; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
@@ -262,7 +262,6 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
<script>
|
||||
$(function() {
|
||||
$("#reg_zip_find").css("display", "inline-block");
|
||||
$("#reg_mb_zip1, #reg_mb_zip2, #reg_mb_addr1").attr("readonly", true);
|
||||
|
||||
<?php if($config['cf_cert_use'] && $config['cf_cert_ipin']) { ?>
|
||||
// 아이핀인증
|
||||
|
||||
@@ -190,22 +190,5 @@
|
||||
#profile .sv_wrap a {margin:0 0 5px;padding:0;font-weight:bold;line-height:10px}
|
||||
|
||||
/* 우편번호 검색 */
|
||||
#post_code #code_sel {margin:0 20px 20px}
|
||||
#post_code #code_sel label {display:inline-block;margin:0 15px 0 0}
|
||||
#post_code p {margin:0 0 10px}
|
||||
#post_code #zip_search_frm {margin:0 20px}
|
||||
#post_code #code_sch #sch_q {position:relative;margin:5px 0 0}
|
||||
#post_code #code_sch .frm_input {height:22px}
|
||||
#post_code #code_sch .btn_submit {padding:0 8px;height:24px}
|
||||
#post_code #result_b4 {display:block;padding:30px 0;border-bottom:1px solid #dde4e9;text-align:center}
|
||||
#post_code #result .result_msg {padding:15px 0}
|
||||
#post_code #result .result_fail {border:1px solid #dde4e9;background:#f0f5fc;color:#ff3061;text-align:center}
|
||||
#post_code #result ul {margin:0;padding:0;border-bottom:1px solid #dde4e9;background:#f0f5fc;list-style:none}
|
||||
#post_code #result li {padding:10px;border:1px solid #dde4e9;border-bottom:0}
|
||||
#post_code #result li div {margin:4px 0 0;color:#738D94}
|
||||
#post_code #result li div {color:#738D94}
|
||||
#post_code #result li div:before {content:"▶ "}
|
||||
#post_code #zip_direct_frm {display:none;margin:0 20px}
|
||||
#post_code #zip_direct_frm .frm_input {margin:0 0 5px}
|
||||
#post_code #zip_direct_frm .frm_addr {width:99%}
|
||||
#post_code #zip_direct_frm #sch_dq {padding:10px 0 20px;text-align:center}
|
||||
#daum_juso_wrap{width:100%;height:100%}
|
||||
html.daum_juso_body ,body.daum_juso_body {height:100%;overflow:hidden}
|
||||
@@ -5,158 +5,47 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);
|
||||
?>
|
||||
|
||||
<!-- 우편번호 찾기 시작 { -->
|
||||
<script src="<?php echo G5_JS_URL; ?>/zip.js"></script>
|
||||
|
||||
<div id="post_code" class="new_win mbskin">
|
||||
<h1 id="win_title"><?php echo $g5['title'] ?></h1>
|
||||
|
||||
<div id="code_sel">
|
||||
<input type="radio" name="sch_sel" id="sch_sel_1" value="search" checked="checked">
|
||||
<label for="sch_sel_1">주소검색</label>
|
||||
<input type="radio" name="sch_sel" id="sch_sel_0" value="direct">
|
||||
<label for="sch_sel_0">직접입력</label>
|
||||
</div>
|
||||
|
||||
<div id="zip_search_frm" class="zip_frm">
|
||||
<p>
|
||||
시도 및 시군구 선택없이 도로명, 읍/면/동, 건물명 등으로 검색하실 수 있습니다.<br>
|
||||
만약 검색결과에 찾으시는 주소가 없을 때는 시도와 시군구를 선택하신 후 다시 검색해 주십시오.<br>
|
||||
(검색결과는 최대 1,000건만 표시됩니다.)
|
||||
</p>
|
||||
|
||||
<form name="fzip" method="get" onsubmit="search_call(); return false;" autocomplete="off">
|
||||
<!-- 검색어 입력 시작 { -->
|
||||
<div id="code_sch">
|
||||
<label for="sido" class="sound_only">시도선택</label>
|
||||
<select name="sido" id="sido">
|
||||
<option value="">- 시도 선택 -</option>
|
||||
</select>
|
||||
<label for="gugun" class="sound_only">시군구</label>
|
||||
<select name="gugun" id="gugun">
|
||||
<option value="">- 시군구 선택 -</option>
|
||||
</select>
|
||||
<div id="sch_q">
|
||||
<label for="q" class="sound_only">검색어</label>
|
||||
<input type="text" name="q" value="" id="q" required class="required frm_input">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</div>
|
||||
</div>
|
||||
<!-- } 검색어 입력 끝 -->
|
||||
</form>
|
||||
|
||||
<div id="result"><span id="result_b4">검색어를 입력해주세요.</span></div>
|
||||
</div>
|
||||
<div id="zip_direct_frm" class="zip_frm">
|
||||
<p>직접 주소를 입력하실 경우 우편번호와 기본주소는 반드시 입력하셔야 합니다.</p>
|
||||
<form name="fzip2">
|
||||
우편번호
|
||||
<label for="frm_zip1" class="sound_only">우편번호앞자리</label>
|
||||
<input type="text" name="frm_zip1" id="frm_zip1" class="required frm_input" size="3" maxlength="3"> -
|
||||
<label for="frm_zip2" class="sound_only">우편번호뒷자리</label>
|
||||
<input type="text" name="frm_zip2" id="frm_zip2" class="required frm_input" size="3" maxlength="3"><br>
|
||||
<label for="frm_addr1" class="sound_only">기본주소</label>
|
||||
<input type="text" name="frm_addr1" placeholder="기본주소" id="frm_addr1" class="required frm_input frm_addr"><br>
|
||||
<label for="frm_addr2" class="sound_only">상세주소</label>
|
||||
<input type="text" name="frm_addr2" placeholder="상세주소" id="frm_addr2" class="frm_input frm_addr"><br>
|
||||
<label for="frm_addr3" class="sound_only">참고항목</label>
|
||||
<input type="text" name="frm_addr3" placeholder="참고항목" id="frm_addr3" class="frm_input frm_addr"><br>
|
||||
<label for="frm_jibeon" class="sound_only">지번주소</label>
|
||||
<input type="text" name="frm_jibeon" placeholder="지번주소" id="frm_jibeon" class="frm_input frm_addr">
|
||||
|
||||
<div id="sch_dq">
|
||||
<button type="button" id="put_addr" class="btn_submit">주소입력</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="win_btn">
|
||||
<button type="button" onclick="window.close();">창닫기</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="daum_juso_wrap" class="daum_juso_wrap"></div>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$("input[name='sch_sel']").click(function() {
|
||||
var val = $(this).val();
|
||||
jQuery(function($){
|
||||
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
|
||||
if(!is_chrome) { //모바일 크롬에서 먹통되는 현상이 있음
|
||||
$("html, body").addClass("daum_juso_body");
|
||||
}
|
||||
|
||||
$(".zip_frm").hide();
|
||||
$("#zip_"+val+"_frm").show();
|
||||
});
|
||||
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
|
||||
{
|
||||
var of = window.opener.document.<?php echo $frm_name; ?>;
|
||||
|
||||
var msg_alert = true;
|
||||
$("input#q").bind("focusin", function() {
|
||||
if(!msg_alert) {
|
||||
return false;
|
||||
} else {
|
||||
alert("정확하고 빠른 검색을 위해 아래의 예시처럼 입력해 주세요.\n\n입력예1) 강남대로37길 24-6\n입력예2) 서초동 1362-19\n입력예3) 서초2동 1362-19");
|
||||
msg_alert = false;
|
||||
of.<?php echo $frm_zip1; ?>.value = zip1;
|
||||
of.<?php echo $frm_zip2; ?>.value = zip2;
|
||||
of.<?php echo $frm_addr1; ?>.value = addr1;
|
||||
of.<?php echo $frm_addr2; ?>.value = addr2;
|
||||
of.<?php echo $frm_addr3; ?>.value = addr3;
|
||||
|
||||
if( jibeon ){
|
||||
if(of.<?php echo $frm_jibeon; ?> !== undefined){
|
||||
of.<?php echo $frm_jibeon; ?>.value = jibeon;
|
||||
}
|
||||
}
|
||||
});
|
||||
of.<?php echo $frm_addr3; ?>.focus(); //안드로이드 4.3 기본브라우져에서 가끔 안나오는 현상이 있어서 일부러 적용
|
||||
of.<?php echo $frm_addr2; ?>.focus();
|
||||
window.close();
|
||||
}
|
||||
|
||||
$("#put_addr").click(function() {
|
||||
var zip1 = $.trim($("#frm_zip1").val());
|
||||
var zip2 = $.trim($("#frm_zip2").val());
|
||||
var addr1 = $.trim($("#frm_addr1").val());
|
||||
var addr2 = $.trim($("#frm_addr2").val());
|
||||
var addr3 = $.trim($("#frm_addr3").val());
|
||||
var jibeon = $.trim($("#frm_jibeon").val());
|
||||
|
||||
if(zip1.length < 1) {
|
||||
alert("우편번호 앞자리를 입력해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(zip2.length < 1) {
|
||||
alert("우편번호 뒷자리를 입력해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(addr1.length < 1) {
|
||||
alert("기본주소를 입력해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
put_data2(zip1, zip2, addr1, addr2, addr3, jibeon);
|
||||
});
|
||||
var el_id = document.getElementById('daum_juso_wrap');
|
||||
new daum.Postcode({
|
||||
oncomplete: function(data) {
|
||||
var address1 = data.address1,
|
||||
address2 = "";
|
||||
if(data.addressType == "R"){ //도로명이면
|
||||
address2 = data.address2;
|
||||
}
|
||||
put_data2(data.postcode1, data.postcode2, address1, '', address2, data.addressType);
|
||||
},
|
||||
width : '100%',
|
||||
height : '100%'
|
||||
}).embed(el_id);
|
||||
});
|
||||
|
||||
function put_data(zip1, zip2, addr1, addr3, jibeon)
|
||||
{
|
||||
var of = window.opener.document.<?php echo $frm_name; ?>;
|
||||
|
||||
of.<?php echo $frm_zip1; ?>.value = zip1;
|
||||
of.<?php echo $frm_zip2; ?>.value = zip2;
|
||||
of.<?php echo $frm_addr1; ?>.value = addr1;
|
||||
of.<?php echo $frm_addr2; ?>.value = "";
|
||||
of.<?php echo $frm_addr3; ?>.value = addr3;
|
||||
|
||||
window.opener.$("#<?php echo $frm_jibeon; ?>").text("지번주소 : "+jibeon);
|
||||
|
||||
if(of.<?php echo $frm_jibeon; ?> !== undefined)
|
||||
of.<?php echo $frm_jibeon; ?>.value = jibeon;
|
||||
|
||||
of.<?php echo $frm_addr2; ?>.focus();
|
||||
|
||||
window.close();
|
||||
}
|
||||
|
||||
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
|
||||
{
|
||||
var of = window.opener.document.<?php echo $frm_name; ?>;
|
||||
|
||||
of.<?php echo $frm_zip1; ?>.value = zip1;
|
||||
of.<?php echo $frm_zip2; ?>.value = zip2;
|
||||
of.<?php echo $frm_addr1; ?>.value = addr1;
|
||||
of.<?php echo $frm_addr2; ?>.value = addr2;
|
||||
of.<?php echo $frm_addr3; ?>.value = addr3;
|
||||
|
||||
window.opener.$("#<?php echo $frm_jibeon; ?>").text("지번주소 : "+jibeon);
|
||||
if(of.<?php echo $frm_jibeon; ?> !== undefined)
|
||||
of.<?php echo $frm_jibeon; ?>.value = jibeon;
|
||||
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
<!-- } 우편번호 찾기 끝 -->
|
||||
</script>
|
||||
@@ -1,105 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License. You may obtain
|
||||
* a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
require '../src/facebook.php';
|
||||
|
||||
// Create our Application instance (replace this with your appId and secret).
|
||||
$facebook = new Facebook(array(
|
||||
'appId' => '119146498278078',
|
||||
'secret' => '6ffd7e325e2b4fbd83a2eebf9c6f33f9',
|
||||
));
|
||||
|
||||
// Get User ID
|
||||
$user = $facebook->getUser();
|
||||
|
||||
// We may or may not have this data based on whether the user is logged in.
|
||||
//
|
||||
// If we have a $user id here, it means we know the user is logged into
|
||||
// Facebook, but we don't know if the access token is valid. An access
|
||||
// token is invalid if the user logged out of Facebook.
|
||||
|
||||
if ($user) {
|
||||
try {
|
||||
// Proceed knowing you have a logged in user who's authenticated.
|
||||
$user_profile = $facebook->api('/me');
|
||||
} catch (FacebookApiException $e) {
|
||||
error_log($e);
|
||||
$user = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Login or logout url will be needed depending on current user state.
|
||||
if ($user) {
|
||||
$logoutUrl = $facebook->getLogoutUrl();
|
||||
} else {
|
||||
$loginUrl = $facebook->getLoginUrl();
|
||||
}
|
||||
|
||||
// This call will always work since we are fetching public data.
|
||||
$naitik = $facebook->api('/naitik');
|
||||
|
||||
?>
|
||||
<!doctype html>
|
||||
<html xmlns:fb="http://www.facebook.com/2008/fbml">
|
||||
<head>
|
||||
<title>php-sdk</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Lucida Grande', Verdana, Arial, sans-serif;
|
||||
}
|
||||
h1 a {
|
||||
text-decoration: none;
|
||||
color: #3b5998;
|
||||
}
|
||||
h1 a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>php-sdk</h1>
|
||||
|
||||
<?php if ($user): ?>
|
||||
<a href="<?php echo $logoutUrl; ?>">Logout</a>
|
||||
<?php else: ?>
|
||||
<div>
|
||||
Login using OAuth 2.0 handled by the PHP SDK:
|
||||
<a href="<?php echo $loginUrl; ?>">Login with Facebook</a>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<h3>PHP Cookie</h3>
|
||||
<pre><?php print_r($_COOKIE); ?></pre>
|
||||
|
||||
<h3>PHP Session</h3>
|
||||
<pre><?php print_r($_SESSION); ?></pre>
|
||||
|
||||
<?php if ($user): ?>
|
||||
<h3>You</h3>
|
||||
<img src="https://graph.facebook.com/<?php echo $user; ?>/picture">
|
||||
|
||||
<h3>Your User Object (/me)</h3>
|
||||
<pre><?php print_r($user_profile); ?></pre>
|
||||
<?php else: ?>
|
||||
<strong><em>You are not Connected.</em></strong>
|
||||
<?php endif ?>
|
||||
|
||||
<h3>Public profile of Naitik</h3>
|
||||
<img src="https://graph.facebook.com/naitik/picture">
|
||||
<?php echo $naitik['name']; ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,62 +0,0 @@
|
||||
<?php
|
||||
|
||||
require '../src/facebook.php';
|
||||
|
||||
$facebook = new Facebook(array(
|
||||
'appId' => '119146498278078',
|
||||
'secret' => '6ffd7e325e2b4fbd83a2eebf9c6f33f9',
|
||||
));
|
||||
|
||||
// See if there is a user from a cookie
|
||||
$user = $facebook->getUser();
|
||||
|
||||
if ($user) {
|
||||
try {
|
||||
// Proceed knowing you have a logged in user who's authenticated.
|
||||
$user_profile = $facebook->api('/me');
|
||||
} catch (FacebookApiException $e) {
|
||||
echo '<pre>'.htmlspecialchars(print_r($e, true)).'</pre>';
|
||||
$user = null;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:fb="http://www.facebook.com/2008/fbml">
|
||||
<body>
|
||||
<h3>PHP Cookie</h3>
|
||||
<pre><?php print_r($_COOKIE); ?></pre>
|
||||
|
||||
<?php if ($user) { ?>
|
||||
Your user profile is
|
||||
<pre>
|
||||
<?php print htmlspecialchars(print_r($user_profile, true)) ?>
|
||||
</pre>
|
||||
<?php } else { ?>
|
||||
<fb:login-button></fb:login-button>
|
||||
<?php } ?>
|
||||
<div id="fb-root"></div>
|
||||
<script>
|
||||
window.fbAsyncInit = function() {
|
||||
FB.init({
|
||||
appId: '<?php echo $facebook->getAppID() ?>',
|
||||
cookie: true,
|
||||
xfbml: true,
|
||||
oauth: true
|
||||
});
|
||||
FB.Event.subscribe('auth.login', function(response) {
|
||||
window.location.reload();
|
||||
});
|
||||
FB.Event.subscribe('auth.logout', function(response) {
|
||||
window.location.reload();
|
||||
});
|
||||
};
|
||||
(function() {
|
||||
var e = document.createElement('script'); e.async = true;
|
||||
e.src = document.location.protocol +
|
||||
'//connect.facebook.net/en_US/all.js';
|
||||
document.getElementById('fb-root').appendChild(e);
|
||||
}());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
// 타임존
|
||||
$GLOBALS['syndi_time_zone'] = '+09:00';
|
||||
|
||||
// 데이타 인코딩
|
||||
$GLOBALS['syndi_from_encoding'] = 'utf-8';
|
||||
|
||||
// 도메인 (http:// 제외, 마지막 / 제외)
|
||||
$GLOBALS['syndi_tag_domain'] = $_SERVER['HTTP_HOST']; // 도메인을 직접 입력하시는게 좋습니다. (예: 'gnuboard.com')
|
||||
|
||||
// 도메인 연결 날짜(년도)
|
||||
$GLOBALS['syndi_tag_year'] = '2010';
|
||||
|
||||
// 홈페이지 제목
|
||||
$GLOBALS['syndi_homepage_title'] = $config['cf_title'];
|
||||
|
||||
// Syndication 출력 url (syndi_echo.php의 웹경로)
|
||||
$GLOBALS['syndi_echo_url'] = G5_SYNDI_URL.'/syndi_echo.php';
|
||||
?>
|
||||
@@ -1,438 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @file plugin/syndi/func/site.func.php
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief syndication client functions for gnuboard5
|
||||
*
|
||||
* Syndi_getSiteInfo : 사이트 정보
|
||||
* Syndi_getChannelList : 사이트의 게시판
|
||||
* Syndi_getArticleList : 게시물
|
||||
* Syndi_getDeletedList : 삭제 게시물
|
||||
* Syndi_getChannelNextPage : Syndi_getChannelList 의 페이징시 다음 페이지
|
||||
* Syndi_getArticleNextPage : Syndi_getArticleList 의 페이징시 다음 페이지
|
||||
* Syndi_getDeletedNextPage : Syndi_getDeletedList 의 페이징시 다음 페이지
|
||||
*/
|
||||
|
||||
|
||||
// include gnuboard config & lib
|
||||
//include G5_PATH.'/config.php';
|
||||
//include G5_LIB_PATH.'/common.lib.php';
|
||||
//include G5_DATA_PATH.'/dbconfig.php';
|
||||
|
||||
$connect_db = sql_connect(G5_MYSQL_HOST, G5_MYSQL_USER, G5_MYSQL_PASSWORD);
|
||||
if(!$connect_db) return;
|
||||
$GLOBALS['connect_db'] = $connect_db;
|
||||
|
||||
sql_select_db(G5_MYSQL_DB, $connect_db);
|
||||
|
||||
|
||||
/**
|
||||
* @brief 사이트 정보
|
||||
**/
|
||||
function Syndi_getSiteInfo($args)
|
||||
{
|
||||
$title = $GLOBALS['syndi_homepage_title'];
|
||||
$tag = SyndicationHandler::getTag('site');
|
||||
|
||||
$oSite = new SyndicationSite;
|
||||
$oSite->setId($tag);
|
||||
$oSite->setTitle($title);
|
||||
$oSite->setUpdated(date('YmdHis'));
|
||||
|
||||
// 홈페이지 주소
|
||||
$link_alternative = sprintf('%s', G5_URL);
|
||||
$oSite->setLinkAlternative($link_alternative);
|
||||
|
||||
$link_self = sprintf('%s?id=%s&type=%s',$GLOBALS['syndi_echo_url'],$tag,$args->type);
|
||||
$oSite->setLinkSelf($link_self);
|
||||
|
||||
return $oSite;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Channel(게시판) 목록
|
||||
**/
|
||||
function Syndi_getChannelList($args)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
$where = '';
|
||||
if($args->target_channel_id) $where .= " and b.bo_table='". mysql_real_escape_string($args->target_channel_id) . "'";
|
||||
|
||||
$sql = "select b.bo_table,b.bo_subject from " . $g5['board_table'] . " b, ". $g5['group_table'] . " g where b.bo_read_level=1 and b.bo_list_level=1 and g.gr_use_access=0 and g.gr_id = b.gr_id ". $where;
|
||||
$sql .= " order by b.gr_id,b.bo_table";
|
||||
|
||||
if($args->type=='channel')
|
||||
{
|
||||
$sql .= sprintf(" limit %s,%s", ($args->page-1)*$args->max_entry, $args->max_entry);
|
||||
}
|
||||
|
||||
$result = sql_query($sql);
|
||||
|
||||
$channel_list = array();
|
||||
while($row = sql_fetch_array($result))
|
||||
{
|
||||
$row['bo_subject'] = $row['bo_subject']?$row['bo_subject']:$row['bo_table'];
|
||||
|
||||
$tag = SyndicationHandler::getTag('channel',$row['bo_table']);
|
||||
$oChannel = new SyndicationChannel;
|
||||
$oChannel->setId($tag);
|
||||
$oChannel->setTitle($row['bo_subject']);
|
||||
$oChannel->setType('web');
|
||||
$oChannel->setUpdated(date('YmdHis'));
|
||||
|
||||
$link_self = sprintf('%s?id=%s&type=%s',$GLOBALS['syndi_echo_url'],$tag,$args->type);
|
||||
$oChannel->setLinkSelf($link_self);
|
||||
|
||||
// 게시판 웹주소
|
||||
$link_alternative = sprintf('%s/bbs/board.php?bo_table=%s', G5_URL, $row['bo_table']);
|
||||
$oChannel->setLinkAlternative($link_alternative);
|
||||
|
||||
$channel_list[] = $oChannel;
|
||||
}
|
||||
|
||||
sql_free_result($result);
|
||||
|
||||
return $channel_list;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 모든 게시판의 게시물을 가져올때, 다음 게시판을 가져옴
|
||||
**/
|
||||
function _Syndi_getNextChannelId($channel_id=null)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
if(!$channel_id)
|
||||
{
|
||||
$sql = "select b.bo_table from " . $g5['board_table'] . " b, ". $g5['group_table'] . " g where b.bo_read_level=1 and b.bo_list_level=1 and g.gr_use_access=0 and g.gr_id = b.gr_id";
|
||||
$sql .= " order by b.bo_table limit 1";
|
||||
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
return $row['bo_table'];
|
||||
}
|
||||
|
||||
$channel_id = mysql_real_escape_string($channel_id);
|
||||
|
||||
$sql = "select b.bo_table from " . $g5['board_table'] . " b, ". $g5['group_table'] . " g where b.bo_table>'$channel_id' and b.bo_read_level=1 and b.bo_list_level=1 and g.gr_use_access=0 and g.gr_id = b.gr_id";
|
||||
$sql .= " order by b.bo_table limit 1";
|
||||
|
||||
$result = sql_query($sql);
|
||||
if(mysql_num_rows($result)==0) return false;
|
||||
|
||||
$row = sql_fetch_array($result);
|
||||
sql_free_result($result);
|
||||
|
||||
return $row['bo_table'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 게시물 목록
|
||||
**/
|
||||
function Syndi_getArticleList($args)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
/*
|
||||
$args->target_content_id //게시물 번호
|
||||
$args->target_channel_id //게시판 번호
|
||||
$args->start_time //기간
|
||||
$args->end_time
|
||||
$args->max_entry //출력 목록당 개수
|
||||
$args->page //페이지 번호
|
||||
$args->channel_id //모든 글 출력시 해당 게시판
|
||||
*/
|
||||
|
||||
// all channel articles mysql 3.X, 4.0.X 에서는 sub query가 되지 않는다.
|
||||
if(!$args->target_channel_id)
|
||||
{
|
||||
// $args->channel_id 가 없을 경우 첫번째 게시판을 가져온다.
|
||||
if(!$args->channel_id) $args->channel_id = _Syndi_getNextChannelId();
|
||||
$args->target_channel_id = $args->channel_id;
|
||||
$article_list = Syndi_getArticleList($args);
|
||||
unset($args->target_channel_id);
|
||||
|
||||
if(count($article_list)>0) return $article_list;
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
return _Syndi_getArticleList($args);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 게시물 목록
|
||||
**/
|
||||
function _Syndi_getArticleList($args)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
/*
|
||||
$args->target_content_id //게시물 번호
|
||||
$args->target_channel_id //게시판 번호
|
||||
$args->start_time //기간
|
||||
$args->end_time
|
||||
$args->max_entry //출력 목록당 개수
|
||||
$args->page //페이지 번호
|
||||
*/
|
||||
|
||||
$sql = "select count(*) as cnt from " . $g5['board_table'] . " b, ". $g5['group_table'] . " g where b.bo_table='" . mysql_real_escape_string($args->target_channel_id). "' and b.bo_read_level=1 and b.bo_list_level=1 and g.gr_use_access=0 and g.gr_id = b.gr_id";
|
||||
$row = sql_fetch_array(sql_query($sql));
|
||||
if($row['cnt']<1) return array();
|
||||
|
||||
$content_table = $t_board.'_'. $args->target_channel_id;
|
||||
$category_table = $t_category.'_'. $args->target_channel_id;
|
||||
|
||||
// get article list
|
||||
$where = " and wr_is_comment=0 ";
|
||||
if($args->target_content_id) $where .= ' and wr_id='. mysql_real_escape_string($args->target_content_id);
|
||||
if($args->start_time) $where .= ' and wr_datetime >= '. _getTime($args->start_time);
|
||||
if($args->end_time) $where .= ' and wr_datetime <= '. _getTime($args->end_time);
|
||||
|
||||
$sql = "select wr_id, ca_name, wr_subject, wr_content, mb_id, wr_name, wr_homepage, wr_email, wr_datetime, wr_last from " . $g5['write_prefix'] . $args->target_channel_id . " where 1=1" . $where;
|
||||
$sql .= " order by wr_id desc ";
|
||||
$sql .= sprintf(" limit %s,%s", ($args->page-1)*$args->max_entry, $args->max_entry);
|
||||
|
||||
$result = sql_query($sql);
|
||||
$article_list = array();
|
||||
while($row = sql_fetch_array($result))
|
||||
{
|
||||
$oArticle = new SyndicationArticle;
|
||||
$tag = SyndicationHandler::getTag('article', $args->target_channel_id, $row['wr_id']);
|
||||
$oArticle->setId($tag);
|
||||
$oArticle->setTitle($row['wr_subject']);
|
||||
$oArticle->setContent($row['wr_content']);
|
||||
$oArticle->setType('web');
|
||||
$oArticle->setCategory($row['ca_name']);
|
||||
$oArticle->setName($row['wr_name']);
|
||||
$oArticle->setEmail($row['wr_email']);
|
||||
$oArticle->setUrl($row['wr_homepage']);
|
||||
$oArticle->setPublished(date('YmdHis',_getTime($row['wr_datetime'])));
|
||||
if($row['wr_last']) $oArticle->setUpdated(date('YmdHis',_getTime($row['wr_last'])));
|
||||
|
||||
// 게시판 웹주소
|
||||
$link_channel_alternative = sprintf('%s/bbs/board.php?bo_table=%s',G5_URL,$args->target_channel_id);
|
||||
|
||||
// 게시물 웹주소
|
||||
$link_alternative = $link_channel_alternative . '&wr_id=' . $row['wr_id'];
|
||||
|
||||
$oArticle->setLinkChannel($tag);
|
||||
$oArticle->setLinkAlternative($link_alternative);
|
||||
$oArticle->setLinkChannelAlternative($link_channel_alternative);
|
||||
|
||||
// add list
|
||||
$article_list[] = $oArticle;
|
||||
}
|
||||
|
||||
sql_free_result($result);
|
||||
|
||||
return $article_list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief 삭제 게시물 목록
|
||||
* 삭제된 게시물에 대해 logging이 필요
|
||||
**/
|
||||
function Syndi_getDeletedList($args)
|
||||
{
|
||||
global $g5;
|
||||
$table = $g5['syndi_log_table'];
|
||||
|
||||
// get delete article list
|
||||
$where = '';
|
||||
if($args->target_content_id) $where .= " and content_id='" . mysql_real_escape_string($args->target_content_id) . "'";
|
||||
if($args->target_channel_id) $where .= " and bbs_id='" . mysql_real_escape_string($args->target_channel_id) . "'";
|
||||
if($args->start_time) $where .= ' and delete_date >= '. $args->start_time;
|
||||
if($args->end_time) $where .= ' and delete_date <= '. $args->end_time;
|
||||
|
||||
$sql = "select content_id, bbs_id, title, link_alternative, delete_date from $table where 1=1" . $where;
|
||||
$sql .= " order by delete_date desc ";
|
||||
$sql .= sprintf(" limit %s,%s", ($args->page-1)*$args->max_entry, $args->max_entry);
|
||||
$result = sql_query($sql);
|
||||
|
||||
$deleted_list = array();
|
||||
while($row = sql_fetch_array($result))
|
||||
{
|
||||
$oDeleted = new SyndicationDeleted;
|
||||
$tag = SyndicationHandler::getTag('article', $row['bbs_id'], $row['content_id']);
|
||||
$oDeleted->setId($tag);
|
||||
$oDeleted->setTitle($row['title']);
|
||||
$oDeleted->setUpdated($row['delete_date']);
|
||||
$oDeleted->setDeleted($row['delete_date']);
|
||||
|
||||
if(substr($row['link_alternative'],0,2)=='./')
|
||||
{
|
||||
$row['link_alternative'] = G5_URL . substr($row['link_alternative'],1);
|
||||
}
|
||||
$oDeleted->setLinkAlternative($row['link_alternative']);
|
||||
|
||||
$deleted_list[] = $oDeleted;
|
||||
}
|
||||
|
||||
sql_free_result($result);
|
||||
|
||||
return $deleted_list;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Channel 목록 출력시 다음 페이지 번호
|
||||
* return array('page'=>다음 페이지);
|
||||
**/
|
||||
function Syndi_getChannelNextPage($args)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
$where = '';
|
||||
if($args->target_channel_id) $where .= " and bo_table='". mysql_real_escape_string($args->target_channel_id) . "'";
|
||||
|
||||
$count_sql = "select count(*) as cnt from " . $g5['board_table'] . " where bo_read_level=1 and bo_list_level=1 " .$where;
|
||||
$result = sql_query($count_sql);
|
||||
$row = sql_fetch_array($result);
|
||||
sql_free_result($result);
|
||||
|
||||
$total_count = $row['cnt'];
|
||||
$total_page = ceil($total_count / $args->max_entry);
|
||||
|
||||
if($args->page >= $total_page)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return array('page'=>$args->page+1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief 게시물 목록 출력시 다음 페이지
|
||||
* return array('page'=>다음 페이지, 'channel_id'=>다음 게시판)
|
||||
**/
|
||||
function Syndi_getArticleNextPage($args)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
// 사이트 모든 글
|
||||
if(!$args->target_channel_id)
|
||||
{
|
||||
// channel_id 라는 변수로 게시판id를 받는다 (mysql 3.x,4.0.x을 위해)
|
||||
if(!$args->channel_id)
|
||||
{
|
||||
$args->channel_id = _Syndi_getNextChannelId();
|
||||
$args->all_channel = true;
|
||||
}
|
||||
|
||||
$args->target_channel_id = $args->channel_id;
|
||||
$obj = _Syndi_getArticleNextPage($args);
|
||||
|
||||
unset($args->target_channel_id, $args->all_channel);
|
||||
|
||||
return $obj;
|
||||
}
|
||||
else
|
||||
{
|
||||
return _Syndi_getArticleNextPage($args);
|
||||
}
|
||||
}
|
||||
|
||||
function _Syndi_getArticleNextPage($args)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
$sql = "select count(*) as cnt from " . $g5['board_table'] . " b, ". $g5['group_table'] . " g where b.bo_table='" . mysql_real_escape_string($args->target_channel_id). "' and b.bo_read_level=1 and b.bo_list_level=1 and g.gr_use_access=0 and g.gr_id = b.gr_id";
|
||||
|
||||
if($row['cnt']==0) return false;
|
||||
|
||||
// get article list
|
||||
$where = " and wr_is_comment=0 ";
|
||||
if($args->target_content_id) $where .= ' and wr_id='. mysql_real_escape_string($args->target_content_id);
|
||||
if($args->start_time) $where .= ' and wr_datetime >= '. _getTime($args->start_time);
|
||||
if($args->end_time) $where .= ' and wr_datetime <= '. _getTime($args->end_time);
|
||||
|
||||
$count_sql = "select count(*) as cnt from " . $g5['write_prefix'] . $args->target_channel_id . " where 1=1 " .$where;
|
||||
$result = sql_query($count_sql);
|
||||
|
||||
$row = sql_fetch_array($result);
|
||||
sql_free_result($result);
|
||||
|
||||
$total_count = $row['cnt'];
|
||||
$total_page = ceil($total_count / $args->max_entry);
|
||||
|
||||
if($args->page >= $total_page)
|
||||
{
|
||||
if($args->all_channel)
|
||||
{
|
||||
$next_channel_id = _Syndi_getNextChannelId($args->target_channel_id);
|
||||
if(!$next_channel_id) return false;
|
||||
return array('page'=>1, 'channel_id'=>$next_channel_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return array('page'=>$args->page+1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 게시물 삭제 목록 출력시 다음 페이지 번호
|
||||
**/
|
||||
function Syndi_getDeletedNextPage($args)
|
||||
{
|
||||
global $g5;
|
||||
$table = $g5['syndi_log_table'];
|
||||
|
||||
// get delete article list
|
||||
$where = '';
|
||||
if($args->target_content_id) $where .= " and no='" . mysql_real_escape_string($args->target_content_id) . "'";
|
||||
if($args->target_channel_id) $where .= " and bbs_id='" . mysql_real_escape_string($args->target_channel_id) . "'";
|
||||
if($args->start_time) $where .= ' and delete_date >= '. $args->start_time;
|
||||
if($args->end_time) $where .= ' and delete_date <= '. $args->end_time;
|
||||
|
||||
$count_sql = "select count(*) as cnt from $table where 1=1" .$where;
|
||||
$result = sql_query($count_sql);
|
||||
$row = sql_fetch_array($result);
|
||||
sql_free_result($result);
|
||||
|
||||
$total_count = $row['cnt'];
|
||||
$total_page = ceil($total_count / $args->max_entry);
|
||||
|
||||
if($args->page >= $total_page)
|
||||
{
|
||||
return array('page'=>0);
|
||||
}
|
||||
else
|
||||
{
|
||||
return array('page'=>$args->page+1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function _getTime($date)
|
||||
{
|
||||
return strtotime($date);
|
||||
}
|
||||
|
||||
$oSyndicationHandler = &SyndicationHandler::getInstance();
|
||||
$oSyndicationHandler->registerFunction('site_info','Syndi_getSiteInfo');
|
||||
$oSyndicationHandler->registerFunction('channel_list','Syndi_getChannelList');
|
||||
$oSyndicationHandler->registerFunction('channel_next_page','Syndi_getChannelNextPage');
|
||||
$oSyndicationHandler->registerFunction('article_list','Syndi_getArticleList');
|
||||
$oSyndicationHandler->registerFunction('article_next_page','Syndi_getArticleNextPage');
|
||||
$oSyndicationHandler->registerFunction('deleted_list','Syndi_getDeletedList');
|
||||
$oSyndicationHandler->registerFunction('deleted_next_page','Syndi_getDeletedNextPage');
|
||||
|
||||
?>
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @file include.adm.board_delete.inc.php
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief 게시판 삭제시 Syndication Ping
|
||||
* gnuboard5/adm/board_delete.inc.php 파일에 추가
|
||||
* include '../syndi/include/include.adm.board_delete.inc.php';
|
||||
*/
|
||||
if(!defined('_GNUBOARD_')) return;
|
||||
|
||||
if(!$tmp_bo_table) return;
|
||||
|
||||
$syndi_dir = realpath(dirname(__FILE__) .'/../');
|
||||
|
||||
// include config & Syndication Ping class
|
||||
include_once $syndi_dir . '/config/site.config.php';
|
||||
include_once $syndi_dir . '/libs/SyndicationHandler.class.php';
|
||||
include_once $syndi_dir . '/libs/SyndicationPing.class.php';
|
||||
|
||||
$oPing = new SyndicationPing;
|
||||
$oPing->setId(SyndicationHandler::getTag('site'));
|
||||
$oPing->setType('channel');
|
||||
|
||||
// delete log
|
||||
$_sql = "delete from {$g5['syndi_log_table']} where bbs_id='%s'";
|
||||
sql_query(sprintf($_sql, $tmp_bo_table));
|
||||
|
||||
$oPing->request();
|
||||
?>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @file include.adm.board_form_update.php
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief 게시판 삭제시 Syndication Ping
|
||||
* gnuboard5/adm/board_form_update.php 파일에 추가
|
||||
* include '../syndi/include/include.adm.board_form_update.php';
|
||||
*/
|
||||
if(!defined('_GNUBOARD_')) return;
|
||||
|
||||
$syndi_dir = realpath(dirname(__FILE__) .'/../');
|
||||
|
||||
// include config & Syndication Ping class
|
||||
include_once $syndi_dir . '/config/site.config.php';
|
||||
include_once $syndi_dir . '/libs/SyndicationHandler.class.php';
|
||||
include_once $syndi_dir . '/libs/SyndicationPing.class.php';
|
||||
|
||||
$oPing = new SyndicationPing;
|
||||
$oPing->setId(SyndicationHandler::getTag('site'));
|
||||
$oPing->setType('channel');
|
||||
|
||||
$oPing->request();
|
||||
?>
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @file include.adm.boardgroup_form_update.php
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief 게시판 삭제시 Syndication Ping
|
||||
* gnuboard5/adm/board_delete.inc.php 파일에 추가
|
||||
* include '../syndi/include/gnuboard5_euckr/include.adm.boardgroup_form_update.php';
|
||||
*/
|
||||
if(!defined('_GNUBOARD_')) return;
|
||||
|
||||
// group 수정이 아니면
|
||||
if(!$_POST[gr_id]) return;
|
||||
if($w!='u') return;
|
||||
|
||||
$syndi_dir = realpath(dirname(__FILE__) .'/../');
|
||||
|
||||
// include config & Syndication Ping class
|
||||
include_once $syndi_dir . '/config/site.config.php';
|
||||
include_once $syndi_dir . '/libs/SyndicationHandler.class.php';
|
||||
include_once $syndi_dir . '/libs/SyndicationPing.class.php';
|
||||
|
||||
$oPing = new SyndicationPing;
|
||||
$oPing->setId(SyndicationHandler::getTag('site'));
|
||||
$oPing->setType('channel');
|
||||
|
||||
$oPing->request();
|
||||
?>
|
||||
@@ -1,37 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @file include.bbs.delete.php
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief 글 삭제시 Syndication Ping
|
||||
* gnuboard5/bbs/bbs.delete.php 파일에 추가
|
||||
* include '../syndi/include/include.bbs.delete.php';
|
||||
*/
|
||||
if(!defined('_GNUBOARD_')) return;
|
||||
|
||||
if(!$write || !$row) return;
|
||||
|
||||
// 비회원 access가 불가능 한 게시판이면 pass
|
||||
$sql = "select count(*) as cnt from " . $g5['board_table'] . " b, ". $g5['group_table'] . " g where b.bo_table='". $bo_table ."' and b.bo_read_level=1 and b.bo_list_level=1 and g.gr_use_access=0 and g.gr_id = b.gr_id";
|
||||
$cnt_row = sql_fetch($sql);
|
||||
if($cnt_row['cnt']<1) return;
|
||||
|
||||
$syndi_dir = realpath(dirname(__FILE__) .'/../');
|
||||
|
||||
// include config & Syndication Ping class
|
||||
include_once $syndi_dir . '/config/site.config.php';
|
||||
include_once $syndi_dir . '/libs/SyndicationHandler.class.php';
|
||||
include_once $syndi_dir . '/libs/SyndicationPing.class.php';
|
||||
|
||||
|
||||
$sql = "select wr_subject from $write_table where wr_id='" .$row['wr_id'] ."'";
|
||||
$subject_row = sql_fetch($sql);
|
||||
|
||||
$_link = './bbs/board.php?bo_table=%s&wr_id=%s';
|
||||
$_sql = "insert into {$g5['syndi_log_table']} (content_id, bbs_id, title, link_alternative, delete_date) values('%s','%s','%s','%s','%s')";
|
||||
sql_query(sprintf($_sql, $row['wr_id'], $bo_table, addslashes($subject_row['wr_subject']), sprintf($_link, $bo_table, $row['wr_id']), date('YmdHis')), false);
|
||||
|
||||
$oPing = new SyndicationPing;
|
||||
$oPing->setId(SyndicationHandler::getTag('channel', $bo_table));
|
||||
$oPing->setType('deleted');
|
||||
$oPing->request();
|
||||
?>
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @file include.bbs.delete_all.php
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief 글 삭제시 Syndication Ping
|
||||
* gnuboard5/bbs/bbs.delete_all.php 파일에 추가
|
||||
* include '../syndi/include/include.bbs.delete_all.php';
|
||||
*/
|
||||
if(!defined('_GNUBOARD_')) return;
|
||||
|
||||
if(!$write || !$row) return;
|
||||
|
||||
// 비회원 access가 불가능 한 게시판이면 pass
|
||||
$sql = 'select count(*) as cnt from ' . $g5['board_table'] . ' b, '. $g5['group_table'] . ' g where b.bo_table=\''. $bo_table .'\' and b.bo_read_level=1 and b.bo_list_level=1 and g.gr_use_access=0 and g.gr_id = b.gr_id';
|
||||
$cnt_row = sql_fetch($sql);
|
||||
if($cnt_row['cnt']<1) return;;
|
||||
|
||||
$syndi_dir = realpath(dirname(__FILE__) .'/../');
|
||||
|
||||
// include config & Syndication Ping class
|
||||
include_once $syndi_dir . '/config/site.config.php';
|
||||
include_once $syndi_dir . '/libs/SyndicationHandler.class.php';
|
||||
include_once $syndi_dir . '/libs/SyndicationPing.class.php';
|
||||
|
||||
$sql = "select wr_subject from $write_table where wr_id='" .$row['wr_id'] ."'";
|
||||
$subject_row = sql_fetch($sql);
|
||||
|
||||
$_link = './bbs/board.php?bo_table=%s&wr_id=%s';
|
||||
$_sql = "insert into {$g5['syndi_log_table']} (content_id, bbs_id, title, link_alternative, delete_date) values('%s','%s','%s','%s','%s')";
|
||||
sql_query(sprintf($_sql, $row['wr_id'], $bo_table, addslashes($subject_row['wr_subject']), sprintf($_link, $bo_table, $row['wr_id']), date('YmdHis')), false);
|
||||
|
||||
$oPing = new SyndicationPing;
|
||||
$oPing->setId(SyndicationHandler::getTag('channel', $bo_table));
|
||||
$oPing->setType('deleted');
|
||||
$oPing->request();
|
||||
?>
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @file include.bbs.move_update.php
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief 글 등록/수정시 Syndication Ping
|
||||
* gnuboard5/bbs/move_update.php 파일에 추가
|
||||
* include '../syndi/include/include.bbs.move_update.php';
|
||||
*/
|
||||
if(!defined('_GNUBOARD_')) return;
|
||||
|
||||
if($sw != 'move' && $sw != 'copy') return;
|
||||
|
||||
$syndi_dir = realpath(dirname(__FILE__) .'/../');
|
||||
|
||||
// include config & Syndication Ping class
|
||||
include_once $syndi_dir . '/config/site.config.php';
|
||||
include_once $syndi_dir . '/libs/SyndicationHandler.class.php';
|
||||
include_once $syndi_dir . '/libs/SyndicationPing.class.php';
|
||||
|
||||
if($sw == "copy")
|
||||
{
|
||||
$oPing = new SyndicationPing;
|
||||
$oPing->setId(SyndicationHandler::getTag('channel', $bo_table));
|
||||
$oPing->setType('article');
|
||||
$oPing->request();
|
||||
|
||||
unset($oPing);
|
||||
}
|
||||
|
||||
for($i=0, $c=count($_POST['chk_bo_table']); $i<$c; $i++)
|
||||
{
|
||||
$oPing = new SyndicationPing;
|
||||
$oPing->setId(SyndicationHandler::getTag('channel', $_POST['chk_bo_table'][$i]));
|
||||
$oPing->setType('article');
|
||||
$oPing->request();
|
||||
|
||||
unset($oPing);
|
||||
}
|
||||
?>
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @file include.bbs.write_update.php
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief 글 등록/수정시 Syndication Ping
|
||||
* gnuboard5/bbs/write_update.php 파일에 추가
|
||||
* include '../syndi/include/include.bbs.write_update.php';
|
||||
*/
|
||||
if(!defined('_GNUBOARD_')) return;
|
||||
|
||||
if(!$board) return;
|
||||
|
||||
// 비밀 게시판이면 pass
|
||||
if($board['bo_use_secret'] && $secret) return;
|
||||
|
||||
// 비회원 사용자가 볼 수 없다면 pass
|
||||
if($board['bo_list_level']>1 || $board['bo_view_level']>1) return;
|
||||
|
||||
if($w == 'u' && $wr && !$wr['wr_id']) return;
|
||||
|
||||
|
||||
// 수정 대상 또는 신규 입력한 id가 있다면 ping을 보냄
|
||||
if($wr['wr_id'] || $wr_id)
|
||||
{
|
||||
$syndi_dir = realpath(dirname(__FILE__) .'/../');
|
||||
|
||||
// include config & Syndication Ping class
|
||||
include $syndi_dir . '/config/site.config.php';
|
||||
include $syndi_dir . '/libs/SyndicationHandler.class.php';
|
||||
include $syndi_dir . '/libs/SyndicationPing.class.php';
|
||||
|
||||
$oPing = new SyndicationPing;
|
||||
$oPing->setId(SyndicationHandler::getTag('channel', $board['bo_table']));
|
||||
$oPing->setType('article');
|
||||
|
||||
// if deleted
|
||||
$_sql = "delete from {$g5['syndi_log_table']} where content_id='%s' and bbs_id='%s'";
|
||||
sql_query(sprintf($_sql, $wr_id ? $wr_id : $wr[wr_id], $board['bo_table']));
|
||||
|
||||
$oPing->request();
|
||||
}
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
if ($is_admin != 'super') {
|
||||
alert('최고관리자만 설치가 가능합니다.');
|
||||
}
|
||||
|
||||
$sql = " CREATE TABLE IF NOT EXISTS `{$g5['syndi_log_table']}` ( `content_id` int(11) NOT NULL, `bbs_id` varchar(50) NOT NULL, `title` text NOT NULL, `link_alternative` varchar(250) NOT NULL, `delete_date` varchar(14) NOT NULL, PRIMARY KEY (`content_id`,`bbs_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ";
|
||||
sql_query($sql, false);
|
||||
|
||||
alert('신디케이션 로그 테이블을 생성했습니다.', G5_URL);
|
||||
?>
|
||||
@@ -1,137 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @class SyndicationArticle
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief Syndication Article 데이타 클래스
|
||||
**/
|
||||
|
||||
class SyndicationArticle extends SyndicationObject
|
||||
{
|
||||
var $node = array('id','author','category','title','content','published','updated','link_alternative','link_channel','link_channel_alternative');
|
||||
|
||||
/**
|
||||
* @brief URI Tag
|
||||
**/
|
||||
function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Author name
|
||||
**/
|
||||
function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Author email
|
||||
**/
|
||||
function setEmail($email)
|
||||
{
|
||||
$this->email = $email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Author homepage or blog
|
||||
**/
|
||||
function setUrl($url)
|
||||
{
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief category or tag of content
|
||||
**/
|
||||
function setCategory($category)
|
||||
{
|
||||
$this->category = $category;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Title of content
|
||||
**/
|
||||
function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief content
|
||||
**/
|
||||
function setContent($content)
|
||||
{
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Syndication Content Type으로 blog 경우'blog', 일반사이트 경우 'web'
|
||||
**/
|
||||
function setType($type='web')
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Syndication Ping Url
|
||||
**/
|
||||
function setLinkSelf($link_self)
|
||||
{
|
||||
$this->link_self = $link_self;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Channel Syndication Ping Url
|
||||
**/
|
||||
function setLinkChannel($link_channel)
|
||||
{
|
||||
$this->link_channel = $link_channel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Article(게시물) 접근 Url
|
||||
**/
|
||||
function setLinkAlternative($link_alternative)
|
||||
{
|
||||
$this->link_alternative = $link_alternative;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Channel(게시판) 접근 Url
|
||||
**/
|
||||
function setLinkChannelAlternative($link_channel_alternative)
|
||||
{
|
||||
$this->link_channel_alternative = $link_channel_alternative;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief published time
|
||||
* 'YYYYMMDDHHIISS' type
|
||||
**/
|
||||
function setPublished($published)
|
||||
{
|
||||
$this->published = $published;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief update time
|
||||
* 'YYYYMMDDHHIISS' type
|
||||
**/
|
||||
function setUpdated($updated)
|
||||
{
|
||||
$this->updated = $updated;
|
||||
}
|
||||
|
||||
function __toString()
|
||||
{
|
||||
$str = '';
|
||||
foreach($this->node as $node){
|
||||
$str .= $this->get($node);
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,98 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @class SyndicationChannel
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief Syndication Channel(게시판) 데이타 클래스
|
||||
**/
|
||||
|
||||
class SyndicationChannel extends SyndicationObject
|
||||
{
|
||||
var $node = array('id','title','type','summary','updated','link_rss','link_alternative','link_self','link_next_in_thread');
|
||||
|
||||
/**
|
||||
* @brief URI Tag
|
||||
**/
|
||||
function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Title of Channel
|
||||
**/
|
||||
function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Type of Channel, web or blog
|
||||
* blog 일경우 setLinkRss()를 등록해야 함
|
||||
**/
|
||||
function setType($type='web')
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Summary of Channel
|
||||
**/
|
||||
function setSummary($summary)
|
||||
{
|
||||
$this->summary = $summary;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Syndication Ping Url
|
||||
**/
|
||||
function setLinkSelf($link_self)
|
||||
{
|
||||
$this->link_self = $link_self;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Channel(게시판) 접근 Url
|
||||
**/
|
||||
function setLinkAlternative($link_alternative)
|
||||
{
|
||||
$this->link_alternative = $link_alternative;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Channel RSS Url (type이 blog면 필수)
|
||||
**/
|
||||
function setLinkRss($link_rss)
|
||||
{
|
||||
$this->link_rss = $link_rss;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 다음 페이지 Url
|
||||
**/
|
||||
function setNextPage($obj)
|
||||
{
|
||||
if(!$obj) return;
|
||||
|
||||
if($obj['page']>0) $this->link_next_in_thread = $this->link_self . '&page='. $obj['page'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief update time
|
||||
* 'YYYYMMDDHHIISS' type
|
||||
**/
|
||||
function setUpdated($updated)
|
||||
{
|
||||
$this->updated = $updated;
|
||||
}
|
||||
|
||||
function __toString()
|
||||
{
|
||||
$str = '';
|
||||
foreach($this->node as $node){
|
||||
$str .= $this->get($node);
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @class SyndicationDeleted
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief Syndication Delete(Article) 데이타 클래스
|
||||
**/
|
||||
|
||||
class SyndicationDeleted extends SyndicationObject
|
||||
{
|
||||
var $node = array('id','title','deleted','updated','link_alternative');
|
||||
|
||||
/**
|
||||
* @brief URI Tag
|
||||
**/
|
||||
function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Title of content
|
||||
**/
|
||||
function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief update time
|
||||
* 'YYYYMMDDHHIISS' type
|
||||
**/
|
||||
function setUpdated($updated)
|
||||
{
|
||||
$this->updated = $updated;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief deleted time
|
||||
* 'YYYYMMDDHHIISS' type
|
||||
**/
|
||||
function setDeleted($deleted)
|
||||
{
|
||||
$this->deleted = $deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Article(게시물) 접근 Url
|
||||
**/
|
||||
function setLinkAlternative($link_alternative)
|
||||
{
|
||||
$this->link_alternative = $link_alternative;
|
||||
}
|
||||
|
||||
function __toString()
|
||||
{
|
||||
$str = '';
|
||||
|
||||
foreach($this->node as $node){
|
||||
$str .= $this->get($node);
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,346 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @class SyndicationHandler
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief Syndication 데이타 출력 핸들러
|
||||
**/
|
||||
|
||||
class SyndicationHandler
|
||||
{
|
||||
var $param; // GET value
|
||||
var $type; // 출력 내용 : article, deleted, channel, site
|
||||
var $target; // 출력 대상 : article, channel, site
|
||||
var $target_channel_id; // 출력 대상 channel(게시판) 번호 또는 유닉한 문자열
|
||||
var $target_content_id; // 출력 대상 article(게시물) 번호 또는 유닉한 문자열
|
||||
var $register_function = array();
|
||||
|
||||
function &getInstance()
|
||||
{
|
||||
if(!$GLOBALS['__SyndicationHandler__'])
|
||||
{
|
||||
$GLOBALS['__SyndicationHandler__'] = new SyndicationHandler();
|
||||
}
|
||||
|
||||
return $GLOBALS['__SyndicationHandler__'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief initialization.
|
||||
**/
|
||||
function SyndicationHandler()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief register function
|
||||
* site_info
|
||||
* article_list
|
||||
* deleted_list
|
||||
* channel_list
|
||||
* article_next_page
|
||||
* deleted_next_page
|
||||
* channel_next_page
|
||||
**/
|
||||
|
||||
function checkRegisteredFunctions()
|
||||
{
|
||||
$ids = array('site_info','article_list','deleted_list','channel_list','article_next_page','deleted_next_page','channel_next_page');
|
||||
|
||||
if(count($this->register_function) != count($ids)) return false;
|
||||
|
||||
foreach($this->register_function as $id => $func)
|
||||
{
|
||||
if(!in_array($id, $ids) || !is_callable($func))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function registerFunction($id, $func)
|
||||
{
|
||||
$this->register_function[$id] = $func;
|
||||
}
|
||||
|
||||
function callFunction($id)
|
||||
{
|
||||
if(!isset($this->register_function[$id]) || !is_callable($this->register_function[$id])) return false;
|
||||
|
||||
return call_user_func($this->register_function[$id], $this->param);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief set GET Value.
|
||||
**/
|
||||
function setArgument($args=null)
|
||||
{
|
||||
if(!$args) $args = $_GET;
|
||||
|
||||
$obj = new stdClass;
|
||||
$obj->id = $args['id'];
|
||||
|
||||
if($args['start-time']) $obj->start_time = SyndicationHandler::getDate($args['start-time']);
|
||||
if($args['end-time']) $obj->end_time = SyndicationHandler::getDate($args['end-time']);
|
||||
|
||||
$obj->max_entry = $args['max_entry'];
|
||||
if(!$obj->max_entry) $obj->max_entry = 100;
|
||||
|
||||
$obj->page = $args['page'];
|
||||
if(!$obj->page) $obj->page = 1;
|
||||
|
||||
$obj->type = $args['type'];
|
||||
|
||||
// for getting all article on mysql 3.X, 4.0.X
|
||||
if($args['channel_id']) $obj->channel_id = $args['channel_id'];
|
||||
|
||||
$this->param = $obj;
|
||||
$this->parseTag();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief parsing id value(Tag URI)
|
||||
**/
|
||||
function parseTag()
|
||||
{
|
||||
// tag:domain,{YYYY}:site:
|
||||
// tag:domain,{YYYY}:channel:{channel_id}
|
||||
// tag:domain,{YYYY}:article:{channel_id}-{$article_id}
|
||||
if(!preg_match('/^tag:([^,]+),([0-9]+):(site|channel|article)(.*)$/i',$this->param->id,$matches)) return;
|
||||
|
||||
$this->target = $matches[3];
|
||||
$id = $matches[4];
|
||||
if($id && $id{0}==':') $id = substr($id, 1);
|
||||
|
||||
switch($this->target)
|
||||
{
|
||||
case 'site':
|
||||
break;
|
||||
case 'channel':
|
||||
if(!$id)
|
||||
{
|
||||
$this->target = $this->target_channel_id = $this->target_content_id = null;
|
||||
return;
|
||||
}
|
||||
|
||||
$this->target_channel_id = $id;
|
||||
break;
|
||||
case 'article':
|
||||
if($id && strpos($id,'-')!==false)
|
||||
{
|
||||
list($this->target_channel_id, $this->target_content_id) = explode('-',$id);
|
||||
if(!$this->target_content_id)
|
||||
{
|
||||
$this->target = $this->target_channel_id = $this->target_content_id = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->target = $this->target_channel_id = $this->target_content_id = null;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if($this->target_channel_id) $this->param->target_channel_id = $this->target_channel_id;
|
||||
if($this->target_content_id) $this->param->target_content_id = $this->target_content_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief xml for Syndication Server
|
||||
**/
|
||||
function getXML()
|
||||
{
|
||||
if(!$this->checkRegisteredFunctions()) return '';
|
||||
|
||||
switch($this->target)
|
||||
{
|
||||
// in site
|
||||
case 'site':
|
||||
// get Site info
|
||||
$oSite = $this->callFunction('site_info');
|
||||
if(!$oSite) return '';
|
||||
|
||||
$list_xml = '';
|
||||
|
||||
if(in_array($this->param->type,array('article','deleted','channel')))
|
||||
{
|
||||
$list = $this->callFunction($this->param->type . '_list');
|
||||
if(!$list) $list = array();
|
||||
|
||||
$obj = $this->callFunction($this->param->type . '_next_page');
|
||||
if($obj) $oSite->setNextPage($obj);
|
||||
|
||||
foreach($list as $oObject)
|
||||
{
|
||||
$list_xml .= $oObject->wrapEntry($oObject->__toString());
|
||||
}
|
||||
|
||||
$xml = $oSite->__toString();
|
||||
$xml = $oSite->wrapFeed($xml . $list_xml);
|
||||
}
|
||||
else
|
||||
{
|
||||
$xml = $oSite->__toString();
|
||||
$xml = $oSite->wrapEntry($xml . $list_xml, true);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// in channel
|
||||
case 'channel':
|
||||
// get Channel info
|
||||
$oChannelList = $this->callFunction('channel_list');
|
||||
if(!is_array($oChannelList) || count($oChannelList)==0) return '';
|
||||
$oChannel = $oChannelList[0];
|
||||
|
||||
$list_xml = '';
|
||||
|
||||
if($this->target_channel_id && in_array($this->param->type,array('article','deleted')))
|
||||
{
|
||||
$list = $this->callFunction($this->param->type . '_list');
|
||||
|
||||
if(is_array($list) && count($list))
|
||||
{
|
||||
$obj = $this->callFunction($this->param->type . '_next_page');
|
||||
if($obj) $oChannel->setNextPage($obj);
|
||||
|
||||
foreach($list as $oObject)
|
||||
{
|
||||
$list_xml .= $oObject->wrapEntry($oObject->__toString());
|
||||
}
|
||||
}
|
||||
|
||||
$xml = $oChannel->__toString();
|
||||
$xml = $oChannel->wrapFeed($xml . $list_xml);
|
||||
}
|
||||
else
|
||||
{
|
||||
$xml = $oChannel->__toString();
|
||||
$xml = $oChannel->wrapEntry($xml . $list_xml, true);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// article info
|
||||
case 'article':
|
||||
|
||||
if(in_array($this->param->type,array('article','deleted')))
|
||||
{
|
||||
$list = $this->callFunction($this->param->type . '_list');
|
||||
}
|
||||
|
||||
if(!is_array($list) || count($list)==0) return '';
|
||||
|
||||
$oObject = $list[0];
|
||||
$xml = $oObject->__toString();
|
||||
|
||||
$xml = $oObject->wrapEntry($xml, true);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(!$GLOBALS['syndi_from_encoding']) $GLOBALS['syndi_from_encoding'] = 'utf-8';
|
||||
if($xml && strtolower($GLOBALS['syndi_from_encoding']) != 'utf-8' && function_exists('iconv'))
|
||||
{
|
||||
$xml = iconv($GLOBALS['syndi_from_encoding'], 'utf-8//IGNORE', $xml);
|
||||
}
|
||||
|
||||
return $xml;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Tag URI
|
||||
**/
|
||||
function getTag($type, $channel_id=null, $article_id=null)
|
||||
{
|
||||
$tag = sprintf('tag:%s,%s:%s'
|
||||
,$GLOBALS['syndi_tag_domain']
|
||||
,$GLOBALS['syndi_tag_year']
|
||||
,$type);
|
||||
|
||||
if($type=='channel' && $channel_id)
|
||||
{
|
||||
$tag .= ':' . $channel_id;
|
||||
}
|
||||
else if($type=='article' && $channel_id && $article_id)
|
||||
{
|
||||
$tag .= ':' .$channel_id .'-' . $article_id;
|
||||
}
|
||||
|
||||
return $tag;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Timestamp 로 YYYYMMDDHHIISS 변환
|
||||
**/
|
||||
function getDate($timestamp)
|
||||
{
|
||||
$time = strtotime($timestamp);
|
||||
if($time == -1) $time = SyndicationHandler::ztime(str_replace(array('-','T',':'),'',$timestamp));
|
||||
|
||||
return date('YmdHis', $time);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief YYYYMMDDHHIISS에서 Timestamp로 변환
|
||||
**/
|
||||
function getTimestamp($date)
|
||||
{
|
||||
$time = mktime(substr($date,8,2),substr($date,10,2),substr($date,12,2),substr($date,4,2),substr($date,6,2),substr($date,0,4));
|
||||
$timestamp = date("Y-m-d\\TH:i:s", $time). $GLOBALS['syndi_time_zone'];
|
||||
return $timestamp;
|
||||
}
|
||||
|
||||
function ztime($str)
|
||||
{
|
||||
if(!$str) return;
|
||||
$hour = (int)substr($str,8,2);
|
||||
$min = (int)substr($str,10,2);
|
||||
$sec = (int)substr($str,12,2);
|
||||
$year = (int)substr($str,0,4);
|
||||
$month = (int)substr($str,4,2);
|
||||
$day = (int)substr($str,6,2);
|
||||
if(strlen($str) <= 8)
|
||||
{
|
||||
$gap = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$gap = SyndicationHandler::zgap();
|
||||
}
|
||||
|
||||
return mktime($hour, $min, $sec, $month?$month:1, $day?$day:1, $year)+$gap;
|
||||
}
|
||||
|
||||
function zgap()
|
||||
{
|
||||
$time_zone = $GLOBALS['syndi_time_zone'];
|
||||
if($time_zone < 0) $to = -1; else $to = 1;
|
||||
$t_hour = substr($time_zone, 1, 2) * $to;
|
||||
$t_min = substr($time_zone, 3, 2) * $to;
|
||||
|
||||
$server_time_zone = date("O");
|
||||
if($server_time_zone < 0) $so = -1; else $so = 1;
|
||||
$c_hour = substr($server_time_zone, 1, 2) * $so;
|
||||
$c_min = substr($server_time_zone, 3, 2) * $so;
|
||||
|
||||
$g_min = $t_min - $c_min;
|
||||
$g_hour = $t_hour - $c_hour;
|
||||
|
||||
$gap = $g_min*60 + $g_hour*60*60;
|
||||
|
||||
return $gap;
|
||||
}
|
||||
|
||||
function error($msg)
|
||||
{
|
||||
echo $msg;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,104 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @class SyndicationObject
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief Syndication 데이타 타입의 상위 클래스
|
||||
**/
|
||||
|
||||
class SyndicationObject
|
||||
{
|
||||
var $id;
|
||||
var $title;
|
||||
var $content;
|
||||
var $summary;
|
||||
var $author;
|
||||
var $name;
|
||||
var $email;
|
||||
var $url;
|
||||
var $published;
|
||||
var $updated;
|
||||
var $deleted;
|
||||
var $type;
|
||||
var $link_self;
|
||||
var $link_alternative;
|
||||
var $link_rss;
|
||||
var $link_channel;
|
||||
var $link_channel_alternative;
|
||||
var $link_next_in_thread;
|
||||
|
||||
function SyndicationXml()
|
||||
{
|
||||
}
|
||||
|
||||
function get($node_name)
|
||||
{
|
||||
$node = array('id','author','name','email','url','title','type','summary','content','published','deleted','updated','link_rss','link_alternative','link_self','link_channel','link_channel_alternative','link_next_in_thread');
|
||||
if(!in_array($node_name, $node)) return '';
|
||||
|
||||
if($node_name == 'author')
|
||||
{
|
||||
$str = "<author>\n";
|
||||
$str .= $this->get('name');
|
||||
$str .= $this->get('email');
|
||||
$str .= $this->get('url');
|
||||
$str .= "</author>\n";
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
$value = $this->{$node_name};
|
||||
if(!$value) return '';
|
||||
|
||||
if(strpos($node_name,'link_')!==false)
|
||||
{
|
||||
$type = str_replace('_','-',substr($node_name, strlen('link_')));
|
||||
return "<link rel=\"".$type."\" href=\"".htmlspecialchars($value)."\" />\n";
|
||||
}
|
||||
|
||||
if(in_array($node_name,array('published','deleted','updated')))
|
||||
{
|
||||
$value = $this->_getTime($value);
|
||||
}
|
||||
|
||||
return sprintf("<%s>%s</%s>\n", $node_name, htmlspecialchars($value) ,$node_name);
|
||||
}
|
||||
|
||||
function _getTime($time)
|
||||
{
|
||||
return SyndicationHandler::getTimestamp($time);
|
||||
}
|
||||
|
||||
function wrapFeed($str)
|
||||
{
|
||||
$return = '<?xml version="1.0" encoding="utf-8"?>';
|
||||
$return .= "\n";
|
||||
$return .= '<feed xmlns="http://www.w3.org/2005/Atom">';
|
||||
$return .= "\n";
|
||||
$return .= $str;
|
||||
$return .= "</feed>";
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
function wrapEntry($str, $xml_info=false)
|
||||
{
|
||||
if($xml_info)
|
||||
{
|
||||
$return = '<?xml version="1.0" encoding="utf-8"?>';
|
||||
$return .= "\n";
|
||||
$return .= '<entry xmlns="http://www.w3.org/2005/Atom">';
|
||||
$return .= "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$return .= "<entry>\n";
|
||||
}
|
||||
|
||||
$return .= $str;
|
||||
$return .= "</entry>\n";
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,105 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @class SyndicationPing
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief Syndication Ping Request 클래스
|
||||
**/
|
||||
|
||||
class SyndicationPing
|
||||
{
|
||||
// Ping Server
|
||||
var $ping_host = 'syndication.openapi.naver.com';
|
||||
var $client;
|
||||
var $type = 'article';
|
||||
var $id;
|
||||
var $start_time;
|
||||
var $end_time;
|
||||
var $max_entry;
|
||||
var $page;
|
||||
|
||||
function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
function setStartTime($start_time)
|
||||
{
|
||||
if($start_time)
|
||||
{
|
||||
$this->start_time = $this->_convertTime($start_time);
|
||||
}
|
||||
}
|
||||
|
||||
function setEndTime($end_time)
|
||||
{
|
||||
if($end_time)
|
||||
{
|
||||
$this->end_time = $this->_convertTime($end_time);
|
||||
}
|
||||
}
|
||||
|
||||
function _convertTime($time)
|
||||
{
|
||||
return str_replace('+','%2b',$time);
|
||||
}
|
||||
|
||||
function setMaxEntry($max_entry)
|
||||
{
|
||||
if($max_entry > 0 && $max_entry <= 10000)
|
||||
{
|
||||
$this->max_entry = $max_entry;
|
||||
}
|
||||
}
|
||||
|
||||
function setPage($page)
|
||||
{
|
||||
if($page > 0 && $page <= 10000)
|
||||
{
|
||||
$this->page = $page;
|
||||
}
|
||||
}
|
||||
|
||||
function getBody()
|
||||
{
|
||||
$str = $GLOBALS['syndi_echo_url'];
|
||||
$str .= '?id=' . $this->id;
|
||||
$str .= '&type=' . $this->type;
|
||||
if($this->start_time && $this->end_time)
|
||||
{
|
||||
$str .= '&start_time=' . $this->start_time;
|
||||
$str .= '&end_time=' . $this->end_time;
|
||||
}
|
||||
if($this->max_entry) $str .= '&max_entry=' . $this->max_entry;
|
||||
if($this->page) $str .= '&page=' . $this->page;
|
||||
|
||||
return 'link='.urlencode($str);
|
||||
}
|
||||
|
||||
function request()
|
||||
{
|
||||
$body = $this->getBody();
|
||||
if(!$body) return false;
|
||||
|
||||
$header = "POST /ping/ HTTP/1.0\r\n".
|
||||
"User-Agent: request\r\n".
|
||||
"Host: " . $this->ping_host . "\r\n".
|
||||
"Content-Type: application/x-www-form-urlencoded\r\n".
|
||||
"Content-Length: ". strlen($body) ."\r\n".
|
||||
"\r\n".
|
||||
$body;
|
||||
|
||||
$fp = @fsockopen($this->ping_host, '80', $errno, $errstr, 5);
|
||||
if(!$fp) return false;
|
||||
|
||||
fputs($fp, $header);
|
||||
fclose($fp);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,74 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @class SyndicationSite
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief Syndication Site 정보 클래스
|
||||
**/
|
||||
|
||||
class SyndicationSite extends SyndicationObject
|
||||
{
|
||||
var $node = array('id','title','link_self','link_alternative','link_next_in_thread','updated');
|
||||
|
||||
/**
|
||||
* @brief URI Tag
|
||||
**/
|
||||
function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Title of Site
|
||||
**/
|
||||
function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Syndication Ping Url
|
||||
**/
|
||||
function setLinkSelf($link_self)
|
||||
{
|
||||
$this->link_self = $link_self;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 접근 Url
|
||||
**/
|
||||
function setLinkAlternative($link_alternative)
|
||||
{
|
||||
$this->link_alternative = $link_alternative;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 다음 페이지 Url
|
||||
**/
|
||||
function setNextPage($obj)
|
||||
{
|
||||
if(!$obj) return;
|
||||
|
||||
if($obj['page']>0) $this->link_next_in_thread = $this->link_self . '&page='. $obj['page'];
|
||||
if($obj['channel_id']) $this->link_next_in_thread .= '&channel_id='. $obj['channel_id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief update time
|
||||
* 'YYYYMMDDHHIISS' type
|
||||
**/
|
||||
function setUpdated($updated)
|
||||
{
|
||||
$this->updated = $updated;
|
||||
}
|
||||
|
||||
function __toString()
|
||||
{
|
||||
$str = '';
|
||||
foreach($this->node as $node){
|
||||
$str .= $this->get($node);
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,77 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @class SyndicationStatus
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief Syndication 상태 정보 클래스
|
||||
**/
|
||||
|
||||
class SyndicationStatus
|
||||
{
|
||||
// Status Server
|
||||
var $status_host = 'syndication.openapi.naver.com';
|
||||
var $site;
|
||||
|
||||
function setSite($site)
|
||||
{
|
||||
$this->site = $site;
|
||||
}
|
||||
|
||||
function request()
|
||||
{
|
||||
if(!$this->site) return false;
|
||||
|
||||
$header = "GET /status/?site=".$this->site." HTTP/1.0\r\n".
|
||||
"Host: " . $this->status_host . "\r\n\r\n";
|
||||
|
||||
$fp = @fsockopen($this->status_host, '80', $errno, $errstr);
|
||||
if(!$fp) return false;
|
||||
|
||||
$output = '';
|
||||
|
||||
fputs($fp, $header);
|
||||
while(!feof($fp)){
|
||||
$output .= fgets($fp, 1024);
|
||||
}
|
||||
fclose($fp);
|
||||
|
||||
$output = substr($output, strpos($output, "\r\n\r\n")+4);
|
||||
return $this->_parse($output);
|
||||
}
|
||||
|
||||
function _parse($data)
|
||||
{
|
||||
preg_match_all('@\<([a-z_0-9=\" ]+)\>([^\<]+)\</@', $data, $matches);
|
||||
if(!$matches[2]) return false;
|
||||
|
||||
$output = array('article'=>array());
|
||||
|
||||
for($i=0,$c=count($matches[0]);$i<$c;$i++){
|
||||
if(strpos($matches[1][$i], 'date="')!==false){
|
||||
$date = substr($matches[1][$i],14,8);
|
||||
$output['article'][$date] = $matches[2][$i];
|
||||
}else{
|
||||
$output[$matches[1][$i]] = $matches[2][$i];
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
$oStatus = new SyndicationStatus;
|
||||
$oStatus->setSite('domain.com');
|
||||
$output = $oStatus->request();
|
||||
|
||||
$output data fields
|
||||
error : 0이 아닌 경우 에러
|
||||
message : 에러 메세지
|
||||
site_url : site url
|
||||
site_name : site name
|
||||
first_update : Syndication 서버에 처음 등록된 시간
|
||||
last_update : Syndication 서버에 최근 갱신 시간
|
||||
status : site 상태
|
||||
visit_ok_count : ping 연속 성공 횟수
|
||||
visit_fail_count : ping 실패 횟수
|
||||
*/
|
||||
?>
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
/**
|
||||
* @file syndi_echo.php
|
||||
* @author sol (ngleader@gmail.com)
|
||||
* @brief Print Syndication Data XML
|
||||
*/
|
||||
|
||||
header('Content-Type: text/html; charset=UTF-8');
|
||||
header('Pragma: no-cache');
|
||||
|
||||
if(version_compare(PHP_VERSION, '5.3.0') >= 0)
|
||||
{
|
||||
date_default_timezone_set(@date_default_timezone_get());
|
||||
}
|
||||
|
||||
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
|
||||
|
||||
|
||||
$syndi_path = dirname(__FILE__);
|
||||
|
||||
// include class
|
||||
include $syndi_path . '/libs/SyndicationHandler.class.php';
|
||||
include $syndi_path . '/libs/SyndicationObject.class.php';
|
||||
include $syndi_path . '/libs/SyndicationSite.class.php';
|
||||
include $syndi_path . '/libs/SyndicationChannel.class.php';
|
||||
include $syndi_path . '/libs/SyndicationArticle.class.php';
|
||||
include $syndi_path . '/libs/SyndicationDeleted.class.php';
|
||||
|
||||
// config & custom func for site
|
||||
include $syndi_path . '/config/site.config.php';
|
||||
include $syndi_path . '/func/site.func.php';
|
||||
|
||||
$oSyndicationHandler = &SyndicationHandler::getInstance();
|
||||
$oSyndicationHandler->setArgument();
|
||||
|
||||
echo $oSyndicationHandler->getXML();
|
||||
?>
|
||||
@@ -34,17 +34,17 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
<th scope="row"><label for="reg_mb_id">아이디<strong class="sound_only">필수</strong></label></th>
|
||||
<td>
|
||||
<span class="frm_info">영문자, 숫자, _ 만 입력 가능. 최소 3자이상 입력하세요.</span>
|
||||
<input type="text" name="mb_id" value="<?php echo $member['mb_id'] ?>" id="reg_mb_id" <?php echo $required ?> <?php echo $readonly ?> class="frm_input minlength=3 <?php echo $required ?> <?php echo $readonly ?>" maxlength="20">
|
||||
<input type="text" name="mb_id" value="<?php echo $member['mb_id'] ?>" id="reg_mb_id" <?php echo $required ?> <?php echo $readonly ?> class="frm_input <?php echo $required ?> <?php echo $readonly ?>" minlength="3" maxlength="20">
|
||||
<span id="msg_mb_id"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="reg_mb_password">비밀번호<strong class="sound_only">필수</strong></label></th>
|
||||
<td><input type="password" name="mb_password" id="reg_mb_password" <?php echo $required ?> class="frm_input minlength=3 <?php echo $required ?>" maxlength="20"></td>
|
||||
<td><input type="password" name="mb_password" id="reg_mb_password" <?php echo $required ?> class="frm_input <?php echo $required ?>" minlength="3" maxlength="20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="reg_mb_password_re">비밀번호 확인<strong class="sound_only">필수</strong></label></th>
|
||||
<td><input type="password" name="mb_password_re" id="reg_mb_password_re" <?php echo $required ?> class="frm_input minlength=3 <?php echo $required ?>" maxlength="20"></td>
|
||||
<td><input type="password" name="mb_password_re" id="reg_mb_password_re" <?php echo $required ?> class="frm_input <?php echo $required ?>" minlength="3" maxlength="20"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -155,11 +155,11 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
<input type="text" name="mb_addr1" value="<?php echo $member['mb_addr1'] ?>" id="reg_mb_addr1" <?php echo $config['cf_req_addr']?"required":""; ?> class="frm_input frm_address <?php echo $config['cf_req_addr']?"required":""; ?>" size="50">
|
||||
<label for="reg_mb_addr1">기본주소<?php echo $config['cf_req_addr']?'<strong class="sound_only"> 필수</strong>':''; ?></label><br>
|
||||
<input type="text" name="mb_addr2" value="<?php echo $member['mb_addr2'] ?>" id="reg_mb_addr2" class="frm_input frm_address" size="50">
|
||||
<label for="reg_mb_addr2">상세주소</label><br>
|
||||
<input type="text" name="mb_addr3" value="<?php echo $member['mb_addr3'] ?>" id="reg_mb_addr3" readonly="readonly" class="frm_input frm_address" size="50">
|
||||
<label for="reg_mb_addr3">참고항목</label><br>
|
||||
<label for="reg_mb_addr2">상세주소</label>
|
||||
<br>
|
||||
<input type="text" name="mb_addr3" value="<?php echo $member['mb_addr3'] ?>" id="reg_mb_addr3" class="frm_input frm_address" size="50" readonly="readonly">
|
||||
<label for="reg_mb_addr3">참고항목</label>
|
||||
<input type="hidden" name="mb_addr_jibeon" value="<?php echo $member['mb_addr_jibeon']; ?>">
|
||||
<span id="mb_addr_jibeon"><?php echo ($member['mb_addr_jibeon'] ? '지번주소 : '.$member['mb_addr_jibeon'] : ''); ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
@@ -270,7 +270,6 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
|
||||
<script>
|
||||
$(function() {
|
||||
$("#reg_zip_find").css("display", "inline-block");
|
||||
$("#reg_mb_zip1, #reg_mb_zip2, #reg_mb_addr1").attr("readonly", true);
|
||||
|
||||
<?php if($config['cf_cert_use'] && $config['cf_cert_ipin']) { ?>
|
||||
// 아이핀인증
|
||||
|
||||
@@ -173,20 +173,5 @@
|
||||
#profile h2 {margin:0}
|
||||
|
||||
/* 우편번호 검색 */
|
||||
#post_code #code_sel {margin:0 20px 20px}
|
||||
#post_code #code_sel label {display:inline-block;margin:0 15px 0 0}
|
||||
#post_code p {margin:0 0 10px}
|
||||
#post_code .btn_submit {padding:0 8px;height:24px}
|
||||
#post_code #zip_search_frm {margin:0 20px}
|
||||
#post_code #code_sch #sch_q {position:relative;margin:5px 0 0}
|
||||
#post_code #code_sch #q_info {display:none;z-index:2;position:absolute;top:33px;left:0;padding:5px;background:#e4eaec}
|
||||
#post_code #code_sch #q_info span {position:absolute;top:-6px;left:5px;width:11px;height:6px;background:url('img/zip_ico_up.gif')}
|
||||
#post_code #result_b4 {display:block;padding:30px 0;border-bottom:1px solid #dde4e9;text-align:center}
|
||||
#post_code #result .result_msg {padding:15px 0}
|
||||
#post_code #result .result_fail {border:1px solid #dde4e9;background:#f0f5fc;color:#ff3061;text-align:center}
|
||||
#post_code #result ul {margin:0;padding:0;border-bottom:1px solid #dde4e9;background:#f0f5fc;list-style:none}
|
||||
#post_code #result li {padding:10px;border:1px solid #dde4e9;border-bottom:0}
|
||||
#post_code #result li div {margin:4px 0 0;color:#738D94}
|
||||
#post_code #result li div:before {content:"▶ "}
|
||||
#post_code #zip_direct_frm {display:none;margin:0 20px}
|
||||
#post_code #zip_direct_frm .frm_input, #post_code #zip_direct_frm .btn_submit {margin:0 0 5px}
|
||||
#daum_juso_wrap{position:absolute;left:0;top:0;width:100%;height:100%}
|
||||
html.daum_juso_body ,body.daum_juso_body {height:100%;overflow:hidden}
|
||||
+32
-144
@@ -5,155 +5,43 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);
|
||||
?>
|
||||
|
||||
<!-- 우편번호 찾기 시작 { -->
|
||||
<script src="<?php echo G5_JS_URL; ?>/zip.js"></script>
|
||||
|
||||
<div id="post_code" class="new_win mbskin">
|
||||
<h1 id="win_title"><?php echo $g5['title'] ?></h1>
|
||||
|
||||
<div id="code_sel">
|
||||
<input type="radio" name="sch_sel" id="sch_sel_1" value="search" checked="checked">
|
||||
<label for="sch_sel_1">주소검색</label>
|
||||
<input type="radio" name="sch_sel" id="sch_sel_0" value="direct">
|
||||
<label for="sch_sel_0">직접입력</label>
|
||||
</div>
|
||||
|
||||
<div id="zip_search_frm" class="zip_frm">
|
||||
<p>
|
||||
시도 및 시군구 선택없이 도로명, 읍/면/동, 건물명 등으로 검색하실 수 있습니다.<br>
|
||||
만약 검색결과에 찾으시는 주소가 없을 때는 시도와 시군구를 선택하신 후 다시 검색해 주십시오.<br>
|
||||
(검색결과는 최대 1,000건만 표시됩니다.)
|
||||
</p>
|
||||
|
||||
<form name="fzip" method="get" onsubmit="search_call(); return false;" autocomplete="off">
|
||||
<!-- 검색어 입력 시작 { -->
|
||||
<div id="code_sch">
|
||||
<label for="sido" class="sound_only">시도선택</label>
|
||||
<select name="sido" id="sido">
|
||||
<option value="">- 시도 선택 -</option>
|
||||
</select>
|
||||
<label for="gugun" class="sound_only">시군구</label>
|
||||
<select name="gugun" id="gugun">
|
||||
<option value="">- 시군구 선택 -</option>
|
||||
</select>
|
||||
<div id="sch_q">
|
||||
<div id="q_info"><span></span>정확하고 빠른 검색을 위해 아래의 예시처럼 입력해 주세요.<br><br>입력예1) 강남대로37길 24-6<br>입력예2) 서초동 1362-19<br>입력예3) 서초2동 1362-19</div>
|
||||
<label for="q" class="sound_only">검색어</label>
|
||||
<input type="text" name="q" value="" id="q" required class="required frm_input">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</div>
|
||||
</div>
|
||||
<!-- } 검색어 입력 끝 -->
|
||||
</form>
|
||||
|
||||
<div id="result"><span id="result_b4">검색어를 입력해주세요.</span></div>
|
||||
</div>
|
||||
|
||||
<div id="zip_direct_frm" class="zip_frm">
|
||||
<p>직접 주소를 입력하실 경우 우편번호와 기본주소는 반드시 입력하셔야 합니다.</p>
|
||||
<form name="fzip2">
|
||||
우편번호
|
||||
<label for="frm_zip1" class="sound_only">우편번호앞자리</label>
|
||||
<input type="text" name="frm_zip1" id="frm_zip1" class="required frm_input" size="3" maxlength="3"> -
|
||||
<label for="frm_zip2" class="sound_only">우편번호뒷자리</label>
|
||||
<input type="text" name="frm_zip2" id="frm_zip2" class="required frm_input" size="3" maxlength="3"><br>
|
||||
<label for="frm_addr1">기본주소</label>
|
||||
<input type="text" name="frm_addr1" id="frm_addr1" class="required frm_input" size="70"><br>
|
||||
<label for="frm_addr2">상세주소</label>
|
||||
<input type="text" name="frm_addr2" id="frm_addr2" class="frm_input" size="70"><br>
|
||||
<label for="frm_addr3">참고항목</label>
|
||||
<input type="text" name="frm_addr3" id="frm_addr3" class="frm_input" size="70"><br>
|
||||
<label for="frm_jibeon">지번주소</label>
|
||||
<input type="text" name="frm_jibeon" id="frm_jibeon" class="frm_input" size="70">
|
||||
<button type="button" id="put_addr" class="btn_submit">주소입력</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="win_btn">
|
||||
<button type="button" onclick="window.close();">창닫기</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="daum_juso_wrap" class="daum_juso_wrap"></div>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$("input[name='sch_sel']").click(function() {
|
||||
var val = $(this).val();
|
||||
jQuery(function($){
|
||||
$("html, body").addClass("daum_juso_body");
|
||||
|
||||
$(".zip_frm").hide();
|
||||
$("#zip_"+val+"_frm").show();
|
||||
});
|
||||
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
|
||||
{
|
||||
var of = window.opener.document.<?php echo $frm_name; ?>;
|
||||
|
||||
$("input#q").bind("focusin", function() {
|
||||
$("#q_info").fadeIn(200);
|
||||
});
|
||||
of.<?php echo $frm_zip1; ?>.value = zip1;
|
||||
of.<?php echo $frm_zip2; ?>.value = zip2;
|
||||
of.<?php echo $frm_addr1; ?>.value = addr1;
|
||||
of.<?php echo $frm_addr2; ?>.value = addr2;
|
||||
of.<?php echo $frm_addr3; ?>.value = addr3;
|
||||
|
||||
$("input#q").bind("focusout", function() {
|
||||
$("#q_info").fadeOut(200);
|
||||
});
|
||||
|
||||
$("#put_addr").click(function() {
|
||||
var zip1 = $.trim($("#frm_zip1").val());
|
||||
var zip2 = $.trim($("#frm_zip2").val());
|
||||
var addr1 = $.trim($("#frm_addr1").val());
|
||||
var addr2 = $.trim($("#frm_addr2").val());
|
||||
var addr3 = $.trim($("#frm_addr3").val());
|
||||
var jibeon = $.trim($("#frm_jibeon").val());
|
||||
|
||||
if(zip1.length < 1) {
|
||||
alert("우편번호 앞자리를 입력해 주십시오.");
|
||||
return false;
|
||||
if( jibeon ){
|
||||
if(of.<?php echo $frm_jibeon; ?> !== undefined){
|
||||
of.<?php echo $frm_jibeon; ?>.value = jibeon;
|
||||
}
|
||||
}
|
||||
of.<?php echo $frm_addr2; ?>.focus();
|
||||
window.close();
|
||||
}
|
||||
|
||||
if(zip2.length < 1) {
|
||||
alert("우편번호 뒷자리를 입력해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(addr1.length < 1) {
|
||||
alert("기본주소를 입력해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
put_data2(zip1, zip2, addr1, addr2, addr3, jibeon);
|
||||
});
|
||||
var el_id = document.getElementById('daum_juso_wrap');
|
||||
new daum.Postcode({
|
||||
oncomplete: function(data) {
|
||||
var address1 = data.address1,
|
||||
address2 = "";
|
||||
if(data.addressType == "R"){ //도로명이면
|
||||
address2 = data.address2;
|
||||
}
|
||||
put_data2(data.postcode1, data.postcode2, address1, '', address2, data.addressType);
|
||||
},
|
||||
width : '100%',
|
||||
height : '100%'
|
||||
}).embed(el_id);
|
||||
});
|
||||
|
||||
function put_data(zip1, zip2, addr1, addr3, jibeon)
|
||||
{
|
||||
var of = window.opener.document.<?php echo $frm_name; ?>;
|
||||
|
||||
of.<?php echo $frm_zip1; ?>.value = zip1;
|
||||
of.<?php echo $frm_zip2; ?>.value = zip2;
|
||||
of.<?php echo $frm_addr1; ?>.value = addr1;
|
||||
of.<?php echo $frm_addr2; ?>.value = "";
|
||||
of.<?php echo $frm_addr3; ?>.value = addr3;
|
||||
|
||||
window.opener.$("#<?php echo $frm_jibeon; ?>").text("지번주소 : "+jibeon);
|
||||
|
||||
if(of.<?php echo $frm_jibeon; ?> !== undefined)
|
||||
of.<?php echo $frm_jibeon; ?>.value = jibeon;
|
||||
|
||||
of.<?php echo $frm_addr2; ?>.focus();
|
||||
|
||||
window.close();
|
||||
}
|
||||
|
||||
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
|
||||
{
|
||||
var of = window.opener.document.<?php echo $frm_name; ?>;
|
||||
|
||||
of.<?php echo $frm_zip1; ?>.value = zip1;
|
||||
of.<?php echo $frm_zip2; ?>.value = zip2;
|
||||
of.<?php echo $frm_addr1; ?>.value = addr1;
|
||||
of.<?php echo $frm_addr2; ?>.value = addr2;
|
||||
of.<?php echo $frm_addr3; ?>.value = addr3;
|
||||
|
||||
window.opener.$("#<?php echo $frm_jibeon; ?>").text("지번주소 : "+jibeon);
|
||||
if(of.<?php echo $frm_jibeon; ?> !== undefined)
|
||||
of.<?php echo $frm_jibeon; ?>.value = jibeon;
|
||||
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
<!-- } 우편번호 찾기 끝 -->
|
||||
</script>
|
||||
Reference in New Issue
Block a user