From fe087865a75cd72e77669515bf205d40413af5f6 Mon Sep 17 00:00:00 2001 From: whitedot Date: Wed, 29 May 2013 19:11:03 +0900 Subject: [PATCH] =?UTF-8?q?SNS=20=EC=88=98=EC=A0=95=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/register_form_update.php | 6 ++ bbs/write.php | 2 +- bbs/write_comment_update.php | 6 +- bbs/write_comment_update.sns.php | 9 ++- plugin/kcpcert/kcpcert_result.php | 8 ++- plugin/sns/facebook/callback.php | 7 ++- plugin/sns/me2day/callback.php | 9 ++- plugin/sns/twitter/callback.php | 14 +++-- skin/board/basic/view_comment.skin.php | 10 ++-- skin/board/basic/view_comment.sns.skin.php | 65 ++++++++++++++------ skin/member/basic/register_form.skin.php | 70 +++++++++++----------- 11 files changed, 126 insertions(+), 80 deletions(-) diff --git a/bbs/register_form_update.php b/bbs/register_form_update.php index 3b4bda071..4684ddeff 100644 --- a/bbs/register_form_update.php +++ b/bbs/register_form_update.php @@ -156,16 +156,22 @@ if ($config['cf_kcpcert_use'] && $md5_cert_no) { $sql_hp_certify .= " , mb_hp = '{$mb_hp}' "; $sql_hp_certify .= " , mb_hp_certify = '{$_SESSION['ss_kcpcert_hp_certify']}' "; $sql_hp_certify .= " , mb_adult = '{$_SESSION['ss_kcpcert_adult']}' "; + $sql_hp_certify .= " , mb_birth = '{$_SESSION['ss_kcpcert_birth']}' "; + $sql_hp_certify .= " , mb_sex = '{$_SESSION['ss_kcpcert_sex']}' "; } else { $sql_hp_certify .= " , mb_hp = '' "; $sql_hp_certify .= " , mb_hp_certify = 0 "; $sql_hp_certify .= " , mb_adult = 0 "; + $sql_hp_certify .= " , mb_birth = '' "; + $sql_hp_certify .= " , mb_sex = '' "; } } else { if (get_session("ss_reg_mb_name") != $mb_name || get_session("ss_reg_mb_hp") != $mb_hp) { $sql_hp_certify .= " , mb_hp = '{$mb_hp}' "; $sql_hp_certify .= " , mb_hp_certify = 0 "; $sql_hp_certify .= " , mb_adult = 0 "; + $sql_hp_certify .= " , mb_birth = '' "; + $sql_hp_certify .= " , mb_sex = '' "; } } //=============================================================== diff --git a/bbs/write.php b/bbs/write.php index 7a9e329b7..c5b782425 100644 --- a/bbs/write.php +++ b/bbs/write.php @@ -188,7 +188,7 @@ if ($config['cf_kcpcert_use'] != '' && !$is_admin) { } if ($board['bo_use_cert'] == 'adult' && !$member['mb_adult']) { - alert('이 게시판은 휴대폰 본인확인으로 성인인증 된 회원님만 글쓰기가 가능합니다.\\n\\n성인인데 글읽기가 안된다면 회원정보 수정에서 휴대폰 본인확인을\\n다시 해주시기 바랍니다.', G4_URL); + alert('이 게시판은 휴대폰 본인확인으로 성인인증 된 회원님만 글쓰기가 가능합니다.\\n\\n성인인데 글읽기가 안된다면 회원정보 수정에서 휴대폰 본인확인을 다시 해주시기 바랍니다.', G4_URL); } } diff --git a/bbs/write_comment_update.php b/bbs/write_comment_update.php index c79306afb..3309ad7ed 100644 --- a/bbs/write_comment_update.php +++ b/bbs/write_comment_update.php @@ -135,9 +135,7 @@ if ($w == 'c') // 댓글 입력 } // SNS 등록 - $wr_sns = array(); include_once("./write_comment_update.sns.php"); - $wr_sns = implode(",", $wr_sns); $sql = " insert into $write_table set ca_name = '{$wr['ca_name']}', @@ -158,7 +156,9 @@ if ($w == 'c') // 댓글 입력 wr_datetime = '".G4_TIME_YMDHIS."', wr_last = '', wr_ip = '{$_SERVER['REMOTE_ADDR']}', - wr_sns = '$wr_sns', + wr_facebook_user = '$wr_facebook_user', + wr_twitter_user = '$wr_twitter_user', + wr_me2day_user = '$wr_me2day_user', wr_1 = '$wr_1', wr_2 = '$wr_2', wr_3 = '$wr_3', diff --git a/bbs/write_comment_update.sns.php b/bbs/write_comment_update.sns.php index ca527ec62..567667078 100644 --- a/bbs/write_comment_update.sns.php +++ b/bbs/write_comment_update.sns.php @@ -10,6 +10,7 @@ set_cookie('ck_me2day_checked' , false, 86400*31); //============================================================================ // 페이스북 //---------------------------------------------------------------------------- +$wr_facebook_user = ""; if ($_POST['facebook_checked']) { include_once(G4_SNS_PATH."/facebook/src/facebook.php"); @@ -39,7 +40,7 @@ if ($_POST['facebook_checked']) { } } - $wr_sns[] = "fb"; + $wr_facebook_user = get_session("ss_facebook_user"); } //============================================================================ @@ -47,6 +48,7 @@ if ($_POST['facebook_checked']) { //============================================================================ // 트위터 //---------------------------------------------------------------------------- +$wr_twitter_user = ""; if ($_POST['twitter_checked']) { include_once(G4_SNS_PATH."/twitter/twitteroauth/twitteroauth.php"); include_once(G4_SNS_PATH."/twitter/twitterconfig.php"); @@ -63,7 +65,7 @@ if ($_POST['twitter_checked']) { set_cookie('ck_twitter_checked', true, 86400*31); } - $wr_sns[] = "tw"; + $wr_twitter_user = get_session("ss_twitter_user"); } //============================================================================ @@ -71,6 +73,7 @@ if ($_POST['twitter_checked']) { //============================================================================ // 미투데이 //---------------------------------------------------------------------------- +$wr_me2day_user = ""; if ($_POST['me2day_checked']) { if (!empty($_SESSION['me2day']['user_id']) && !empty($_SESSION['me2day']['user_key'])) { $user_id = $_SESSION['me2day']['user_id']; @@ -81,7 +84,7 @@ if ($_POST['me2day_checked']) { set_cookie('ck_me2day_checked', true, 86400*31); } - $wr_sns[] = "me"; + $wr_me2day_user = get_session("ss_me2day_user"); } //============================================================================ ?> \ No newline at end of file diff --git a/plugin/kcpcert/kcpcert_result.php b/plugin/kcpcert/kcpcert_result.php index 569b60bef..e25848901 100644 --- a/plugin/kcpcert/kcpcert_result.php +++ b/plugin/kcpcert/kcpcert_result.php @@ -131,10 +131,10 @@ if( $cert_enc_use == "Y" ) $phone_no = hyphen_hp_number($phone_no); - $sql = " select count(*) as cnt from {$g4['member_table']} where mb_id <> '{$member['mb_id']}' and mb_hp = '{$phone_no}' "; + $sql = " select mb_id from {$g4['member_table']} where mb_id <> '{$member['mb_id']}' and mb_hp = '{$phone_no}' "; $row = sql_fetch($sql); - if ($row['cnt']) { - alert_close("이미 가입되어 있는 휴대폰번호 입니다."); + if ($row['mb_id']) { + alert_close("이미 가입되어 있는 휴대폰번호 입니다.\\n회원아이디 : ".$row['mb_id']); } // hash 데이터 @@ -149,6 +149,8 @@ if( $cert_enc_use == "Y" ) set_session("ss_kcpcert_hash", $hash_data); set_session("ss_kcpcert_hp_certify", 1); set_session("ss_kcpcert_adult", $adult); + set_session("ss_kcpcert_birth", $birth_day); + set_session("ss_kcpcert_sex", ($sex_code=="01"?"M":"F")); /* $sql = " update {$g4['member_table']} set mb_name = '$user_name', mb_hp = '$phone_no', mb_hp_certify = 1, mb_adult = $adult, mb_birth = '$birth_day', mb_sex = '$sex_code' where mb_id = '{$member['mb_id']}' "; diff --git a/plugin/sns/facebook/callback.php b/plugin/sns/facebook/callback.php index f301207a5..9f1d7ec22 100644 --- a/plugin/sns/facebook/callback.php +++ b/plugin/sns/facebook/callback.php @@ -22,10 +22,13 @@ $g4['title'] = '페이스북 콜백'; include_once(G4_PATH.'/head.sub.php'); if ($user) { - $sns_name = $user_profile['name']; - $g4_sns_url = G4_SNS_URL; + $sns_name = $user_profile['name']; + $sns_user = $user; set_cookie('ck_sns_name', $sns_name, 86400); + set_session('ss_facebook_user', $user); + + $g4_sns_url = G4_SNS_URL; echo << diff --git a/plugin/sns/me2day/callback.php b/plugin/sns/me2day/callback.php index 78a03a07d..7226c98cc 100644 --- a/plugin/sns/me2day/callback.php +++ b/plugin/sns/me2day/callback.php @@ -14,11 +14,14 @@ include_once(G4_PATH.'/head.sub.php'); $result = json_decode(file_get_contents("http://me2day.net/api/noop.json?uid={$user_id}&ukey={$auth_key}&akey=".$config['cf_me2day_key'])); if ($result->code == 0) { - $user = json_decode(file_get_contents("http://me2day.net/api/get_person/{$user_id}.json")); - $sns_name = $user->nickname; - $g4_sns_url = G4_SNS_URL; + $user = json_decode(file_get_contents("http://me2day.net/api/get_person/{$user_id}.json")); + $sns_name = $user->nickname; + $sns_user = $user->id; set_cookie('ck_sns_name', $sns_name, 86400); + set_session('ss_me2day_user', $sns_user); + + $g4_sns_url = G4_SNS_URL; echo << diff --git a/plugin/sns/twitter/callback.php b/plugin/sns/twitter/callback.php index 27b58b765..456769424 100644 --- a/plugin/sns/twitter/callback.php +++ b/plugin/sns/twitter/callback.php @@ -16,8 +16,8 @@ require_once(G4_SNS_PATH.'/twitter/twitterconfig.php'); /* If the oauth_token is old redirect to the connect page. */ if (isset($_REQUEST['oauth_token']) && $_SESSION['oauth_token'] !== $_REQUEST['oauth_token']) { - $_SESSION['oauth_status'] = 'oldtoken'; - header('Location: ./clearsessions.php'); + $_SESSION['oauth_status'] = 'oldtoken'; + header('Location: ./clearsessions.php'); } /* Create TwitteroAuth object with app key/secret and token key/secret from default phase */ @@ -47,12 +47,14 @@ $g4['title'] = '트위터 콜백'; include_once(G4_PATH.'/head.sub.php'); if (200 == $connection->http_code) { - - $content = $connection->get('account/verify_credentials'); - $sns_name = $content->name; - $g4_sns_url = G4_SNS_URL; + $content = $connection->get('account/verify_credentials'); + $sns_name = $content->name; + $sns_user = $content->screen_name; set_cookie('ck_sns_name', $sns_name, 86400); + set_session('ss_twitter_user', $sns_user); + + $g4_sns_url = G4_SNS_URL; echo << diff --git a/skin/board/basic/view_comment.skin.php b/skin/board/basic/view_comment.skin.php index 8acc0716c..1bf735274 100644 --- a/skin/board/basic/view_comment.skin.php +++ b/skin/board/basic/view_comment.skin.php @@ -35,9 +35,9 @@ var char_max = parseInt(); // 최대 작성일 - 페이스북에도 등록됨 - 트위터에도 등록됨 - 미투데이에도 등록됨 + 페이스북에도 등록됨 + 트위터에도 등록됨 + 미투데이에도 등록됨 @@ -127,7 +127,7 @@ var char_max = parseInt(); // 최대 내용 글자 -