SNS 수정중

This commit is contained in:
whitedot
2013-05-29 19:11:03 +09:00
parent 21c2db173a
commit fe087865a7
11 changed files with 126 additions and 80 deletions

View File

@ -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 = '' ";
}
}
//===============================================================

View File

@ -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);
}
}

View File

@ -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',

View File

@ -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");
}
//============================================================================
?>

View File

@ -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']}' ";

View File

@ -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 <<<EOT
<script>

View File

@ -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 <<<EOT
<script>

View File

@ -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 <<<EOT
<script>

View File

@ -35,9 +35,9 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
<?php } ?>
작성일
<span class="bo_vc_hdinfo"><time datetime="<?php echo date('Y-m-d\TH:i:s+09:00', strtotime($list[$i]['datetime'])) ?>"><?php echo $list[$i]['datetime'] ?></time></span>
<?php if (strstr($list[$i]['wr_sns'], "fb")) { ?><img src="<?php echo G4_SNS_URL; ?>/icon/facebook.png" alt="페이스북에도 등록됨"><?php } ?>
<?php if (strstr($list[$i]['wr_sns'], "tw")) { ?><img src="<?php echo G4_SNS_URL; ?>/icon/twitter.png" alt="트위터에도 등록됨"><?php } ?>
<?php if (strstr($list[$i]['wr_sns'], "me")) { ?><img src="<?php echo G4_SNS_URL; ?>/icon/me2day.png" alt="미투데이에도 등록됨"><?php } ?>
<?php if ($list[$i]['wr_facebook_user']) { ?><a href="https://www.facebook.com/profile.php?id=<?php echo $list[$i]['wr_facebook_user']; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/facebook.png" alt="페이스북에도 등록됨"></a><?php } ?>
<?php if ($list[$i]['wr_twitter_user']) { ?><a href="https://www.twitter.com/<?php echo $list[$i]['wr_twitter_user']; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/twitter.png" alt="트위터에도 등록됨"></a><?php } ?>
<?php if ($list[$i]['wr_me2day_user']) { ?><a href="http://me2day.net/<?php echo $list[$i]['wr_me2day_user']; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/me2day.png" alt="미투데이에도 등록됨"></a><?php } ?>
</header>
<!-- 댓글 출력 -->
@ -127,7 +127,7 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
<th scope="row">내용</th>
<td>
<?php if ($comment_min || $comment_max) { ?><strong id="char_cnt"><span id="char_count"></span>글자</strong><?php } ?>
<textarea id="wr_content" name="wr_content" maxlength="10000" required class="required"
<textarea id="wr_content" name="wr_content" maxlength="10000" required class="required" title="내용"
<?php if ($comment_min || $comment_max) { ?>onkeyup="check_byte('wr_content', 'char_count');"<?php } ?>><?php echo $c_wr_content; ?></textarea>
<?php if ($comment_min || $comment_max) { ?><script> check_byte('wr_content', 'char_count'); </script><?php } ?>
<script>
@ -146,7 +146,7 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
</table>
<div class="btn_confirm">
<input type="submit" class="btn_submit" value="댓글등록">
<input type="submit" id="btn_submit" class="btn_submit" value="댓글등록">
</div>
</form>

View File

@ -12,20 +12,23 @@ if (!$board['bo_use_sns']) return;
// 페이스북
//----------------------------------------------------------------------------
if ($config['cf_facebook_appid']) {
include_once(G4_SNS_PATH."/facebook/src/facebook.php");
$facebook = new Facebook(array(
'appId' => $config['cf_facebook_appid'],
'secret' => $config['cf_facebook_secret']
));
$facebook_user = get_session("ss_facebook_user");
if (!$facebook_user) {
include_once(G4_SNS_PATH."/facebook/src/facebook.php");
$facebook = new Facebook(array(
'appId' => $config['cf_facebook_appid'],
'secret' => $config['cf_facebook_secret']
));
$facebook_user = $facebook->getUser();
$facebook_user = $facebook->getUser();
if ($facebook_user) {
try {
$facebook_user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$facebook_user = null;
if ($facebook_user) {
try {
$facebook_user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$facebook_user = null;
}
}
}
@ -51,17 +54,33 @@ if (!$board['bo_use_sns']) return;
// 트위터
//----------------------------------------------------------------------------
if ($config['cf_twitter_key']) {
include_once(G4_SNS_PATH."/twitter/twitteroauth/twitteroauth.php");
include_once(G4_SNS_PATH."/twitter/twitterconfig.php");
$twitter_user = get_session("ss_twitter_user");
if (!$twitter_user) {
include_once(G4_SNS_PATH."/twitter/twitteroauth/twitteroauth.php");
include_once(G4_SNS_PATH."/twitter/twitterconfig.php");
$twitter_user = false;
if (empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret'])) {
$twitter_url = G4_SNS_URL."/twitter/redirect.php";
} else {
$twitter_user = false;
/*
if (empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret'])) {
$twitter_url = G4_SNS_URL."/twitter/redirect.php";
} else {
$access_token = $_SESSION['access_token'];
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);
$content = $connection->get('account/verify_credentials');
switch ($connection->http_code) {
case 200:
$twitter_user = true;
$twitter_url = $connection->getAuthorizeURL($token);
break;
default :
$twitter_url = G4_SNS_URL."/twitter/redirect.php";
}
}
*/
$access_token = $_SESSION['access_token'];
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);
$content = $connection->get('account/verify_credentials');
//print_r2($content);
switch ($connection->http_code) {
case 200:
@ -93,6 +112,7 @@ if (!$board['bo_use_sns']) return;
// 미투데이
//----------------------------------------------------------------------------
if ($config['cf_me2day_key']) {
/*
$me2day_user = false;
if (empty($_SESSION['me2day']['user_id']) || empty($_SESSION['me2day']['user_key'])) {
$result = json_decode(file_get_contents("http://me2day.net/api/get_auth_url.json?akey=".$config['cf_me2day_key']));
@ -100,6 +120,13 @@ if (!$board['bo_use_sns']) return;
} else {
$me2day_user = true;
}
*/
$me2day_user = get_session("ss_me2day_user");
if (!$me2day_user) {
$result = json_decode(file_get_contents("http://me2day.net/api/get_auth_url.json?akey=".$config['cf_me2day_key']));
$me2day_url = $result->url;
}
echo '<li>';
if ($me2day_user) {

View File

@ -102,7 +102,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
<?php if ($config['cf_kcpcert_use']) { ?>
<span class="frm_info">휴대폰번호는 휴대폰 본인확인 기능을 이용하여 입력하세요.</span>
<?php } ?>
<input type="text" name="mb_hp" value="<?php echo $member[mb_hp] ?>" id="reg_mb_hp" <?php echo ($config['cf_req_hp']||$config['cf_kcpcert_use'])?"required":""; ?> class="frm_input <?php echo ($config['cf_req_hp']||$config['cf_kcpcert_use'])?"required":""; ?>" <?php echo $config['cf_kcpcert_use']?"readonly":""; ?> maxlength="20">
<input type="text" name="mb_hp" value="<?php echo $member[mb_hp] ?>" id="reg_mb_hp" <?php echo ($config['cf_req_hp'])?"required":""; ?> class="frm_input <?php echo ($config['cf_req_hp'])?"required":""; ?>" <?php echo $config['cf_kcpcert_use']?"readonly":""; ?> maxlength="20">
<?php if ($config['cf_kcpcert_use']) { ?>
<input type="hidden" name="old_mb_hp" value="<?php echo $member['mb_hp'] ?>">
<button type="button" id="win_kcpcert" class="btn_frmline">휴대폰 본인확인</button>
@ -272,32 +272,32 @@ function fregisterform_submit(f)
}
}
if (f.w.value == '') {
if (f.w.value == "") {
if (f.mb_password.value.length < 3) {
alert('패스워드를 3글자 이상 입력하십시오.');
alert("패스워드를 3글자 이상 입력하십시오.");
f.mb_password.focus();
return false;
}
}
if (f.mb_password.value != f.mb_password_re.value) {
alert('패스워드가 같지 않습니다.');
alert("패스워드가 같지 않습니다.");
f.mb_password_re.focus();
return false;
}
if (f.mb_password.value.length > 0) {
if (f.mb_password_re.value.length < 3) {
alert('패스워드를 3글자 이상 입력하십시오.');
alert("패스워드를 3글자 이상 입력하십시오.");
f.mb_password_re.focus();
return false;
}
}
// 이름 검사
if (f.w.value=='') {
if (f.w.value=="") {
if (f.mb_name.value.length < 1) {
alert('이름을 입력하십시오.');
alert("이름을 입력하십시오.");
f.mb_name.focus();
return false;
}
@ -305,7 +305,7 @@ function fregisterform_submit(f)
/*
var pattern = /([^가-힣\x20])/i;
if (pattern.test(f.mb_name.value)) {
alert('이름은 한글로 입력하십시오.');
alert("이름은 한글로 입력하십시오.");
f.mb_name.select();
return false;
}
@ -332,19 +332,19 @@ function fregisterform_submit(f)
}
}
if (typeof f.mb_icon != 'undefined') {
if (typeof f.mb_icon != "undefined") {
if (f.mb_icon.value) {
if (!f.mb_icon.value.toLowerCase().match(/.(gif)$/i)) {
alert('회원아이콘이 gif 파일이 아닙니다.');
alert("회원아이콘이 gif 파일이 아닙니다.");
f.mb_icon.focus();
return false;
}
}
}
if (typeof(f.mb_recommend) != 'undefined') {
if (typeof(f.mb_recommend) != "undefined") {
if (f.mb_id.value == f.mb_recommend.value) {
alert('본인을 추천할 수 없습니다.');
alert("본인을 추천할 수 없습니다.");
f.mb_recommend.focus();
return false;
}
@ -357,34 +357,34 @@ function fregisterform_submit(f)
}
}
<?php if ($config['cf_kcpcert_use']) { ?>
var error = "";
$.ajax({
url: "<?php echo G4_KCP_URL ?>/kcpcert.ajax.php",
type: "POST",
data: {
"w": f.w.value,
"mb_name": f.mb_name.value,
"mb_hp": f.mb_hp.value,
"old_mb_hp":f.old_mb_hp.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
error = data.error;
}
});
if (typeof(f.mb_hp) != "undefined" && f.mb_hp.value) {
var error = "";
$.ajax({
url: "<?php echo G4_KCPCERT_URL ?>/kcpcert.ajax.php",
type: "POST",
data: {
"w": f.w.value,
"mb_name": f.mb_name.value,
"mb_hp": f.mb_hp.value,
"old_mb_hp":f.old_mb_hp.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
error = data.error;
}
});
if (error) {
alert(error);
return false;
if (error) {
alert(error);
return false;
}
}
<?php } ?>
<?php echo chk_captcha_js(); ?>
document.getElementById("btn_submit").disabled = true;
document.getElementById("btn_submit").disabled = "disabled";
return true;
}