불필요한 아이콘 파일 삭제
1
.gitignore
vendored
@ -1,6 +1,5 @@
|
||||
.htaccess
|
||||
data
|
||||
config.php
|
||||
test
|
||||
sirgle
|
||||
sr_*
|
||||
|
||||
@ -46,6 +46,13 @@ if(!isset($config['cf_mobile_pages'])) {
|
||||
sql_query(" UPDATE `{$g4['config_table']}` SET cf_mobile_pages = '5' ", TRUE);
|
||||
}
|
||||
|
||||
if(!isset($config['cf_facebook_use'])) {
|
||||
sql_query(" ALTER TABLE `{$g4['config_table']}`
|
||||
ADD `cf_facebook_use` TINYINT NOT NULL DEFAULT '0' AFTER `cf_kcpcert_use`
|
||||
ADD `cf_facebook_appid` VARCHAR(255) NOT NULL AFTER `cf_facebook_use`,
|
||||
ADD `cf_facebook_secret` VARCHAR(255) NOT NULL AFTER `cf_facebook_secret` ", true);
|
||||
}
|
||||
|
||||
// uniqid 테이블이 없을 경우 생성
|
||||
if(!sql_query(" select uq_id from {$g4['uniqid_table']} limit 1 ", false)) {
|
||||
sql_query(" CREATE TABLE IF NOT EXISTS `{$g4['uniqid_table']}` (
|
||||
@ -66,6 +73,7 @@ $pg_anchor = '<ul class="anchor">
|
||||
<li><a href="#anc_cf_article_mail">글작성메일</a></li>
|
||||
<li><a href="#anc_cf_join_mail">가입메일</a></li>
|
||||
<li><a href="#anc_cf_vote_mail">투표메일</a></li>
|
||||
<li><a href="#anc_cf_sns">SNS</a></li>
|
||||
<li><a href="#anc_cf_extra">여분필드</a></li>
|
||||
</ul>';
|
||||
?>
|
||||
@ -699,6 +707,38 @@ $pg_anchor = '<ul class="anchor">
|
||||
</table>
|
||||
</section>
|
||||
|
||||
|
||||
<section id="anc_cf_sns" class="cbox">
|
||||
<h2>소셜네트워크서비스(SNS : Social Network Service)</h2>
|
||||
<?php echo $pg_anchor ?>
|
||||
|
||||
<table class="frm_tbl">
|
||||
<colgroup>
|
||||
<col class="grid_3">
|
||||
<col class="grid_6">
|
||||
<col class="grid_3">
|
||||
<col class="grid_6">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"><label for="cf_facebook_use">페이스북 사용</label></th>
|
||||
<td><input type="checkbox" name="cf_facebook_use" value="1" id="cf_facebook_use" <?php echo $config['cf_facebook_use']?'checked':''; ?>> 사용</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cf_facebook_appid">페이스북 앱 ID</label></th>
|
||||
<td>
|
||||
<input type="text" name="cf_facebook_appid" value="<?php echo $config['cf_facebook_appid'] ?>" id="cf_facebook_appid" class="frm_input"> <a href="https://developers.facebook.com/apps" target="_blank" class="btn_frmline">앱 등록페이지</a>
|
||||
</td>
|
||||
<th scope="row"><label for="cf_facebook_secret">페이스북 앱 Secret</label></th>
|
||||
<td>
|
||||
<input type="text" name="cf_facebook_secret" value="<?php echo $config['cf_facebook_secret'] ?>" id="cf_facebook_secret" class="frm_input" size="30">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
|
||||
<section id="anc_cf_extra" class="cbox">
|
||||
<h2>여분필드 기본 설정</h2>
|
||||
<?php echo $pg_anchor ?>
|
||||
|
||||
@ -100,13 +100,16 @@ $sql = " update {$g4['config_table']}
|
||||
cf_privacy = '{$_POST['cf_privacy']}',
|
||||
cf_open_modify = '{$_POST['cf_open_modify']}',
|
||||
cf_memo_send_point = '{$_POST['cf_memo_send_point']}',
|
||||
cf_kcpcert_use = '{$_POST['cf_kcpcert_use']}',
|
||||
cf_kcpcert_site_cd = '{$_POST['cf_kcpcert_site_cd']}',
|
||||
cf_mobile_new_skin = '{$_POST['cf_mobile_new_skin']}',
|
||||
cf_mobile_search_skin = '{$_POST['cf_mobile_search_skin']}',
|
||||
cf_mobile_connect_skin = '{$_POST['cf_mobile_connect_skin']}',
|
||||
cf_mobile_member_skin = '{$_POST['cf_mobile_member_skin']}',
|
||||
cf_gcaptcha_mp3 = '{$_POST['cf_gcaptcha_mp3']}',
|
||||
cf_kcpcert_site_cd = '{$_POST['cf_kcpcert_site_cd']}',
|
||||
cf_kcpcert_use = '{$_POST['cf_kcpcert_use']}',
|
||||
cf_facebook_use = '{$_POST['cf_facebook_use']}',
|
||||
cf_facebook_appid = '{$_POST['cf_facebook_appid']}',
|
||||
cf_facebook_secret = '{$_POST['cf_facebook_secret']}',
|
||||
cf_1_subj = '{$_POST['cf_1_subj']}',
|
||||
cf_2_subj = '{$_POST['cf_2_subj']}',
|
||||
cf_3_subj = '{$_POST['cf_3_subj']}',
|
||||
|
||||
@ -75,7 +75,10 @@ if ($w == '' || $w == 'u') {
|
||||
if ($w=='') {
|
||||
if ($msg = exist_mb_id($mb_id)) alert($msg);
|
||||
|
||||
if (!exist_mb_id($mb_recommend)) alert("추천인이 존재하지 않습니다.");
|
||||
if ($config['cf_use_recommend']) {
|
||||
if (!exist_mb_id($mb_recommend))
|
||||
alert("추천인이 존재하지 않습니다.");
|
||||
}
|
||||
|
||||
if (strtolower($mb_id) == strtolower($mb_recommend)) {
|
||||
alert('본인을 추천할 수 없습니다.');
|
||||
|
||||
@ -144,4 +144,4 @@ define('G4_FACEBOOK_CALLBACK', G4_SNS_URL.'/facebook/callback.php');
|
||||
// 게시판에서 링크의 기본갯수를 말합니다.
|
||||
// 필드를 추가하면 이 숫자를 필드수에 맞게 늘려주십시오.
|
||||
define('G4_LINK_COUNT', 2);
|
||||
?>
|
||||
?>`
|
||||
@ -5,7 +5,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
if ($msg = valid_mb_hp($mb_hp)) alert($msg, "", true, true);
|
||||
if ($msg = exist_mb_hp($mb_hp, $mb_id)) alert($msg, "", true, true);
|
||||
|
||||
$reg_hp = preg_replace("/[^0-9]/", "", trim($_POST['mb_hp']));
|
||||
$reg_mb_hp = preg_replace("/[^0-9]/", "", trim($_POST['mb_hp']));
|
||||
|
||||
/* ======================================================================================================= */
|
||||
/* = 휴대폰인증 및 성인인증 = */
|
||||
@ -17,7 +17,7 @@ if($w == '') {
|
||||
alert('휴대폰인증이 되지 않았습니다. 휴대폰인증을 해주세요.', '', true, true);
|
||||
|
||||
// 본인인증 hash 체크
|
||||
$reg_hash = md5($reg_hp.$mb_name.$kcpcert_no);
|
||||
$reg_hash = md5($reg_mb_hp.$mb_name.$kcpcert_no);
|
||||
if(get_session('ss_kcpcert_hash') != $reg_hash)
|
||||
alert('이름 또는 휴대폰번호가 올바르지 않습니다. 정상적인 방법으로 이용해 주세요.', '', true, true);
|
||||
|
||||
@ -25,14 +25,14 @@ if($w == '') {
|
||||
// 휴대폰번호 변경체크
|
||||
$old_hp = preg_replace("/[^0-9]/", "", trim($_POST['old_mb_hp']));
|
||||
|
||||
if($old_hp !== $reg_hp) {
|
||||
if($old_hp !== $reg_mb_hp) {
|
||||
// 본인인증체크
|
||||
$kcpcert_no = get_session('ss_kcpcert_no');
|
||||
if(!$kcpcert_no)
|
||||
alert('휴대폰번호가 변경됐습니다. 휴대폰인증을 해주세요.', '', true, true);
|
||||
|
||||
// 본인인증 hash 체크
|
||||
$reg_hash = md5($reg_hp.$mb_name.$kcpcert_no);
|
||||
$reg_hash = md5($reg_mb_hp.$mb_name.$kcpcert_no);
|
||||
if(get_session('ss_kcpcert_hash') != $reg_hash)
|
||||
alert('이름 또는 휴대폰인증 정보가 올바르지 않습니다. 정상적인 방법으로 이용해 주세요.', '', true, true);
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
$g4_path = "../.."; // common.php 의 상대 경로
|
||||
$g4_path = "../../.."; // common.php 의 상대 경로
|
||||
include_once($g4_path."/common.php");
|
||||
?>
|
||||
@ -1,41 +1,5 @@
|
||||
<?php
|
||||
include_once("./_common.php");
|
||||
|
||||
require_once(G4_SNS_PATH."/facebook/src/facebook.php");
|
||||
|
||||
//https://www.facebook.com/dialog/oauth?client_id=440461349373258&redirect_uri=http%3A%2F%2Fchin.so%2Fbbs%2Fajax.sns.php%3Fsns_name%3Dfacebook%26_%3D1364434991642&state=951675978f0f4a6f5a2dfc01fb45e653
|
||||
|
||||
//http://chin.so/plugin/facebook/callback.php?code=AQDKN0YBYm9NB_Ca_XtFZckplQk74Oubsd8OVuFDMHGiXDdiZ9cxr-Sw2cs37XvKQ4h0ryhC21nAbB2I0KhqtWaFyPGpDEnQuMMxZRdwKZvvwRRQrGzl7ttI9oQAQ5Y0_WuROIl-4lKTifbZseSP5tJt_YTX8CXfc7h5w6C73N7tPS66UvtsmbJTYT02uXjTiCKPGnqeTgZjZ7XjzRYEn_l_&state=951675978f0f4a6f5a2dfc01fb45e653#_=_
|
||||
|
||||
$config = array(
|
||||
'appId' => FACEBOOK_APPID,
|
||||
'secret' => FACEBOOK_SECRET,
|
||||
);
|
||||
|
||||
$facebook = new Facebook($config);
|
||||
|
||||
if ($_GET['logout'] == 'yes') {
|
||||
unset($_SESSION['fb_'.FACEBOOK_APPID.'_code']);
|
||||
unset($_SESSION['fb_'.FACEBOOK_APPID.'_user_id']);
|
||||
unset($_SESSION['fb_'.FACEBOOK_APPID.'_access_token']);
|
||||
header("Location: ".$_SERVER['PHP_SELF']."");
|
||||
}
|
||||
|
||||
$user = $facebook->getUser();
|
||||
|
||||
if ($user) {
|
||||
try {
|
||||
$user_profile = $facebook->api('/me');
|
||||
} catch (FacebookApiException $e) {
|
||||
error_log($e);
|
||||
$user = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if ($user_profile) {
|
||||
sql_query(" update {$g4['member_table']} set mb_sns_facebook = '{$_REQUEST['code']}' where mb_id = '{$member['mb_id']}' ");
|
||||
alert_close("페이스북 승인이 성공 했습니다.\\n\\n댓글의 체크를 해제하지 않으시면 모든 댓글 등록시 페이스북에도 자동 등록됩니다.");
|
||||
} else {
|
||||
sql_query(" update {$g4['member_table']} set mb_sns_facebook = '' where mb_id = '{$member['mb_id']}' ");
|
||||
alert_close("페이스북을 로그아웃 했습니다.");
|
||||
}
|
||||
die('콜백');
|
||||
?>
|
||||
BIN
plugin/sns/icon/facebook_off.png
Normal file
|
After Width: | Height: | Size: 920 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
BIN
plugin/sns/icon/twitter_off.png
Normal file
|
After Width: | Height: | Size: 969 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
@ -76,7 +76,7 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
|
||||
<?php if ($is_comment_write) {
|
||||
if($w == '')
|
||||
$w = 'c';
|
||||
?>
|
||||
?>
|
||||
<aside id="bo_vc_w">
|
||||
<h2>댓글쓰기</h2>
|
||||
<form name="fviewcomment" action="./write_comment_update.php" onsubmit="return fviewcomment_submit(this);" method="post" autocomplete="off">
|
||||
@ -113,6 +113,47 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
|
||||
<td><?php echo $captcha_html; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<th scope="row">SNS 등록</th>
|
||||
<td>
|
||||
<div id="sns_facebook">
|
||||
<?php
|
||||
include(G4_SNS_PATH.'/facebook/src/facebook.php');
|
||||
|
||||
$facebook = new Facebook(array('appId'=>G4_FACEBOOK_APPID,'secret'=>G4_FACEBOOK_SECRET));
|
||||
// Get User ID
|
||||
$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) {
|
||||
error_log($e);
|
||||
$user = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Login or logout url will be needed depending on current user state.
|
||||
if ($user) {
|
||||
//echo $logoutUrl = $facebook->getLogoutUrl();
|
||||
$loginUrl = $facebook->getLogoutUrl();
|
||||
} else {
|
||||
//$loginUrl = $facebook->getLoginUrl(array('redirect_uri'=>urlencode(G4_SNS_URL.'/facebook/callback.php')));
|
||||
$loginUrl = $facebook->getLoginUrl(array('redirect_uri'=>(G4_SNS_URL.'/facebook/callback.php')));
|
||||
//$loginUrl = $facebook->getLoginUrl();
|
||||
}
|
||||
|
||||
?>
|
||||
<div><a href="<?php echo $loginUrl; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/facebook_off.png" id="icon_facebook"></a></div>
|
||||
<div><input type="checkbox" name="chk_facebook" value="1"></div>
|
||||
</div>
|
||||
<div id="sns_twitter">
|
||||
<div><img src="<?php echo G4_SNS_URL; ?>/icon/twitter_off.png" id="icon_twitter"></div>
|
||||
<div><input type="checkbox" name="chk_twitter" value="1"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">내용</th>
|
||||
<td>
|
||||
|
||||
@ -214,7 +214,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
<?php if ($w == "" && $config['cf_use_recommend']) { ?>
|
||||
<tr>
|
||||
<th scope="row"><label for="reg_mb_recommend">추천인아이디</label></th>
|
||||
<td><input type="text" name="mb_recommend" id="reg_mb_recommend" class="frm_input"></td>
|
||||
<td><input type="text" name="mb_recommend" id="reg_mb_recommend" class="frm_input" required></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
|
||||