g4를 g5로 변경
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
include_once("./_common.php");
|
||||
include_once(G4_SNS_PATH."/facebook/src/facebook.php");
|
||||
include_once(G5_SNS_PATH."/facebook/src/facebook.php");
|
||||
|
||||
$facebook = new Facebook(array(
|
||||
'appId' => $config['cf_facebook_appid'],
|
||||
@ -18,8 +18,8 @@ if ($user) {
|
||||
}
|
||||
}
|
||||
|
||||
$g4['title'] = '페이스북 콜백';
|
||||
include_once(G4_PATH.'/head.sub.php');
|
||||
$g5['title'] = '페이스북 콜백';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
|
||||
if ($user) {
|
||||
$sns_name = $user_profile['name'];
|
||||
@ -28,7 +28,7 @@ if ($user) {
|
||||
set_cookie('ck_sns_name', $sns_name, 86400);
|
||||
set_session('ss_facebook_user', $user);
|
||||
|
||||
$g4_sns_url = G4_SNS_URL;
|
||||
$g5_sns_url = G5_SNS_URL;
|
||||
|
||||
echo <<<EOT
|
||||
<script>
|
||||
@ -37,7 +37,7 @@ if ($user) {
|
||||
|
||||
var opener = window.opener;
|
||||
opener.$("#wr_name").val("{$sns_name}");
|
||||
opener.$("#facebook_icon").attr("src", "{$g4_sns_url}/icon/facebook.png");
|
||||
opener.$("#facebook_icon").attr("src", "{$g5_sns_url}/icon/facebook.png");
|
||||
opener.$("#facebook_checked").attr("disabled", false);
|
||||
opener.$("#facebook_checked").attr("checked", true);
|
||||
window.close();
|
||||
@ -58,5 +58,5 @@ EOT;
|
||||
|
||||
}
|
||||
|
||||
include_once(G4_PATH.'/tail.sub.php');
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
@ -8,8 +8,8 @@ $auth_key = "12345678" . md5("12345678" . $user_key);
|
||||
$_SESSION['me2day']['user_id'] = $user_id;
|
||||
$_SESSION['me2day']['user_key'] = $user_key;
|
||||
|
||||
$g4['title'] = '미투데이 콜백';
|
||||
include_once(G4_PATH.'/head.sub.php');
|
||||
$g5['title'] = '미투데이 콜백';
|
||||
include_once(G5_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) {
|
||||
@ -21,7 +21,7 @@ if ($result->code == 0) {
|
||||
set_cookie('ck_sns_name', $sns_name, 86400);
|
||||
set_session('ss_me2day_user', $sns_user);
|
||||
|
||||
$g4_sns_url = G4_SNS_URL;
|
||||
$g5_sns_url = G5_SNS_URL;
|
||||
|
||||
echo <<<EOT
|
||||
<script>
|
||||
@ -30,7 +30,7 @@ if ($result->code == 0) {
|
||||
|
||||
var opener = window.opener;
|
||||
opener.$("#wr_name").val("{$sns_name}");
|
||||
opener.$("#me2day_icon").attr("src", "{$g4_sns_url}/icon/me2day.png");
|
||||
opener.$("#me2day_icon").attr("src", "{$g5_sns_url}/icon/me2day.png");
|
||||
opener.$("#me2day_checked").attr("disabled", false);
|
||||
opener.$("#me2day_checked").attr("checked", true);
|
||||
window.close();
|
||||
@ -51,5 +51,5 @@ EOT;
|
||||
|
||||
}
|
||||
|
||||
include_once(G4_PATH.'/tail.sub.php');
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
|
||||
@ -9,8 +9,8 @@ include_once("./_common.php");
|
||||
|
||||
/* Start session and load lib */
|
||||
//session_start();
|
||||
require_once(G4_SNS_PATH.'/twitter/twitteroauth/twitteroauth.php');
|
||||
require_once(G4_SNS_PATH.'/twitter/twitterconfig.php');
|
||||
require_once(G5_SNS_PATH.'/twitter/twitteroauth/twitteroauth.php');
|
||||
require_once(G5_SNS_PATH.'/twitter/twitterconfig.php');
|
||||
|
||||
//print_r2($_SESSION); print_r2($_REQUEST); exit;
|
||||
|
||||
@ -43,8 +43,8 @@ if (200 == $connection->http_code) {
|
||||
exit;
|
||||
*/
|
||||
|
||||
$g4['title'] = '트위터 콜백';
|
||||
include_once(G4_PATH.'/head.sub.php');
|
||||
$g5['title'] = '트위터 콜백';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
|
||||
if (200 == $connection->http_code) {
|
||||
$content = $connection->get('account/verify_credentials');
|
||||
@ -54,7 +54,7 @@ if (200 == $connection->http_code) {
|
||||
set_cookie('ck_sns_name', $sns_name, 86400);
|
||||
set_session('ss_twitter_user', $sns_user);
|
||||
|
||||
$g4_sns_url = G4_SNS_URL;
|
||||
$g5_sns_url = G5_SNS_URL;
|
||||
|
||||
echo <<<EOT
|
||||
<script>
|
||||
@ -63,7 +63,7 @@ if (200 == $connection->http_code) {
|
||||
|
||||
var opener = window.opener;
|
||||
opener.$("#wr_name").val("{$sns_name}");
|
||||
opener.$("#twitter_icon").attr("src", "{$g4_sns_url}/icon/twitter.png");
|
||||
opener.$("#twitter_icon").attr("src", "{$g5_sns_url}/icon/twitter.png");
|
||||
opener.$("#twitter_checked").attr("disabled", false);
|
||||
opener.$("#twitter_checked").attr("checked", true);
|
||||
window.close();
|
||||
@ -84,5 +84,5 @@ EOT;
|
||||
|
||||
}
|
||||
|
||||
include_once(G4_PATH.'/tail.sub.php');
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
|
||||
@ -9,7 +9,7 @@ include_once("./_common.php");
|
||||
/**
|
||||
* Exit with an error message if the CONSUMER_KEY or CONSUMER_SECRET is not defined.
|
||||
*/
|
||||
require_once(G4_SNS_PATH.'/twitter/twitterconfig.php');
|
||||
require_once(G5_SNS_PATH.'/twitter/twitterconfig.php');
|
||||
if (CONSUMER_KEY === '' || CONSUMER_SECRET === '' || CONSUMER_KEY === 'CONSUMER_KEY_HERE' || CONSUMER_SECRET === 'CONSUMER_SECRET_HERE') {
|
||||
echo 'You need a consumer key and secret to test the sample code. Get one from <a href="https://dev.twitter.com/apps">dev.twitter.com/apps</a>';
|
||||
exit;
|
||||
|
||||
@ -8,8 +8,8 @@ include_once("./_common.php");
|
||||
|
||||
/* Load required lib files. */
|
||||
//session_start();
|
||||
require_once(G4_SNS_PATH.'/twitter/twitteroauth/twitteroauth.php');
|
||||
require_once(G4_SNS_PATH.'/twitter/twitterconfig.php');
|
||||
require_once(G5_SNS_PATH.'/twitter/twitteroauth/twitteroauth.php');
|
||||
require_once(G5_SNS_PATH.'/twitter/twitterconfig.php');
|
||||
|
||||
/* If access tokens are not available redirect to connect page. */
|
||||
if (empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret'])) {
|
||||
|
||||
@ -3,8 +3,8 @@ include_once("./_common.php");
|
||||
|
||||
/* Start session and load library. */
|
||||
//session_start();
|
||||
require_once(G4_SNS_PATH.'/twitter/twitteroauth/twitteroauth.php');
|
||||
require_once(G4_SNS_PATH.'/twitter/twitterconfig.php');
|
||||
require_once(G5_SNS_PATH.'/twitter/twitteroauth/twitteroauth.php');
|
||||
require_once(G5_SNS_PATH.'/twitter/twitterconfig.php');
|
||||
|
||||
/* Build TwitterOAuth object with client credentials. */
|
||||
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
|
||||
|
||||
@ -6,5 +6,5 @@
|
||||
|
||||
define('CONSUMER_KEY', $config['cf_twitter_key']);
|
||||
define('CONSUMER_SECRET', $config['cf_twitter_secret']);
|
||||
define('OAUTH_CALLBACK', G4_SNS_URL.'/twitter/callback.php');
|
||||
define('OAUTH_CALLBACK', G5_SNS_URL.'/twitter/callback.php');
|
||||
//define('OAUTH_CALLBACK', '');
|
||||
|
||||
@ -9,7 +9,7 @@ $msg_url = $sns_msg.' : '.$sns_url;
|
||||
|
||||
// 카카오톡 매뉴얼 : https://github.com/kakao/kakaolink-web
|
||||
$kakao_appid = $_SERVER['HTTP_HOST']; // Mobile Site Domain 정확히 입력하지 않을 경우 이용이 제한될 수 있습니다.
|
||||
$kakao_appname = $g4['title'];
|
||||
$kakao_appname = $g5['title'];
|
||||
|
||||
$facebook_url = 'http://www.facebook.com/sharer/sharer.php?s=100&p[url]='.$sns_url.'&p[title]='.$sns_msg;
|
||||
$twitter_url = 'http://twitter.com/home?status='.$msg_url;
|
||||
@ -17,22 +17,22 @@ $me2day_url = 'http://me2day.net/posts/new?new_post[body]='.$msg_url;
|
||||
$gplus_url = 'https://plus.google.com/share?url='.$sns_url;
|
||||
|
||||
/*
|
||||
$sns_send = G4_BBS_URL.'/sns_send.php?longurl='.urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
|
||||
$sns_send = G5_BBS_URL.'/sns_send.php?longurl='.urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
|
||||
//$sns_send .= '&title='.urlencode(utf8_strcut(get_text($view['subject']),140));
|
||||
$sns_send .= '&title='.$sns_msg;
|
||||
*/
|
||||
|
||||
?>
|
||||
<ul id="bo_v_sns">
|
||||
<li><a href="<?php echo $facebook_url; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/facebook.png" alt="페이스북으로 보내기"></a></li>
|
||||
<li><a href="<?php echo $twitter_url; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/twitter.png" alt="트위터로 보내기"></a></li>
|
||||
<li><a href="<?php echo $me2day_url; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/me2day.png" alt="미투데이로 보내기"></a></li>
|
||||
<li><a href="<?php echo $gplus_url; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/gplus.png" alt="구글플러스로 보내기"></a></li>
|
||||
<li><a href="<?php echo $facebook_url; ?>" target="_blank"><img src="<?php echo G5_SNS_URL; ?>/icon/facebook.png" alt="페이스북으로 보내기"></a></li>
|
||||
<li><a href="<?php echo $twitter_url; ?>" target="_blank"><img src="<?php echo G5_SNS_URL; ?>/icon/twitter.png" alt="트위터로 보내기"></a></li>
|
||||
<li><a href="<?php echo $me2day_url; ?>" target="_blank"><img src="<?php echo G5_SNS_URL; ?>/icon/me2day.png" alt="미투데이로 보내기"></a></li>
|
||||
<li><a href="<?php echo $gplus_url; ?>" target="_blank"><img src="<?php echo G5_SNS_URL; ?>/icon/gplus.png" alt="구글플러스로 보내기"></a></li>
|
||||
<?php
|
||||
if (G4_IS_MOBILE) {
|
||||
if (G5_IS_MOBILE) {
|
||||
$kakao_url = 'kakaolink://sendurl?msg='.$sns_msg.'&url='.$sns_url.'&appid='.$kakao_appid.'&appver=1.0&type=link&appname='.$kakao_appname.'&apiver=2.0';
|
||||
?>
|
||||
<li><a href="<?php echo $kakao_url; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/kakaotalk.png" alt="카카오톡으로 보내기"></a></li>
|
||||
<li><a href="<?php echo $kakao_url; ?>" target="_blank"><img src="<?php echo G5_SNS_URL; ?>/icon/kakaotalk.png" alt="카카오톡으로 보내기"></a></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
@ -2,17 +2,17 @@
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
$mobile_sns_icon = '';
|
||||
if (G4_IS_MOBILE) $sns_mc_icon = '';
|
||||
if (G5_IS_MOBILE) $sns_mc_icon = '';
|
||||
else $sns_mc_icon = '_cmt';
|
||||
|
||||
if (!$board['bo_use_sns']) return;
|
||||
?>
|
||||
<?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<?php echo $sns_mc_icon; ?>.png" alt="페이스북에도 등록됨"></a>
|
||||
<a href="https://www.facebook.com/profile.php?id=<?php echo $list[$i]['wr_facebook_user']; ?>" target="_blank"><img src="<?php echo G5_SNS_URL; ?>/icon/facebook<?php echo $sns_mc_icon; ?>.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<?php echo $sns_mc_icon; ?>.png" alt="트위터에도 등록됨"></a>
|
||||
<a href="https://www.twitter.com/<?php echo $list[$i]['wr_twitter_user']; ?>" target="_blank"><img src="<?php echo G5_SNS_URL; ?>/icon/twitter<?php echo $sns_mc_icon; ?>.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<?php echo $sns_mc_icon; ?>.png" alt="미투데이에도 등록됨"></a>
|
||||
<a href="http://me2day.net/<?php echo $list[$i]['wr_me2day_user']; ?>" target="_blank"><img src="<?php echo G5_SNS_URL; ?>/icon/me2day<?php echo $sns_mc_icon; ?>.png" alt="미투데이에도 등록됨"></a>
|
||||
<?php } ?>
|
||||
|
||||
@ -14,7 +14,7 @@ if (!$board['bo_use_sns']) return;
|
||||
if ($config['cf_facebook_appid']) {
|
||||
$facebook_user = get_session("ss_facebook_user");
|
||||
if (!$facebook_user) {
|
||||
include_once(G4_SNS_PATH."/facebook/src/facebook.php");
|
||||
include_once(G5_SNS_PATH."/facebook/src/facebook.php");
|
||||
$facebook = new Facebook(array(
|
||||
'appId' => $config['cf_facebook_appid'],
|
||||
'secret' => $config['cf_facebook_secret']
|
||||
@ -34,13 +34,13 @@ if (!$board['bo_use_sns']) return;
|
||||
|
||||
echo '<li>';
|
||||
if ($facebook_user) {
|
||||
echo '<img src="'.G4_SNS_URL.'/icon/facebook.png" id="facebook_icon">';
|
||||
echo '<img src="'.G5_SNS_URL.'/icon/facebook.png" id="facebook_icon">';
|
||||
echo '<label for="" class="sound_only">페이스북 동시 등록</label>';
|
||||
echo '<input type="checkbox" name="facebook_checked" id="facebook_checked" '.(get_cookie('ck_facebook_checked')?'checked':'').' value="1">';
|
||||
} else {
|
||||
$facebook_url = $facebook->getLoginUrl(array("redirect_uri"=>G4_SNS_URL."/facebook/callback.php", "scope"=>"publish_stream,read_stream,offline_access", "display"=>"popup"));
|
||||
$facebook_url = $facebook->getLoginUrl(array("redirect_uri"=>G5_SNS_URL."/facebook/callback.php", "scope"=>"publish_stream,read_stream,offline_access", "display"=>"popup"));
|
||||
|
||||
echo '<a href="'.$facebook_url.'" id="facebook_url" onclick="return false;"><img src="'.G4_SNS_URL.'/icon/facebook'.($facebook_user?'':'_off').'.png" id="facebook_icon"></a>';
|
||||
echo '<a href="'.$facebook_url.'" id="facebook_url" onclick="return false;"><img src="'.G5_SNS_URL.'/icon/facebook'.($facebook_user?'':'_off').'.png" id="facebook_icon"></a>';
|
||||
echo '<label for="" class="sound_only">페이스북 동시 등록</label>';
|
||||
echo '<input type="checkbox" name="facebook_checked" id="facebook_checked" disabled value="1">';
|
||||
echo '<script>$(function(){ $("#facebook_url").click(function(){ window.open(this.href, "facebook_url", "width=600,height=250"); }); });</script>';
|
||||
@ -56,13 +56,13 @@ if (!$board['bo_use_sns']) return;
|
||||
if ($config['cf_twitter_key']) {
|
||||
$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");
|
||||
include_once(G5_SNS_PATH."/twitter/twitteroauth/twitteroauth.php");
|
||||
include_once(G5_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";
|
||||
$twitter_url = G5_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']);
|
||||
@ -74,7 +74,7 @@ if (!$board['bo_use_sns']) return;
|
||||
$twitter_url = $connection->getAuthorizeURL($token);
|
||||
break;
|
||||
default :
|
||||
$twitter_url = G4_SNS_URL."/twitter/redirect.php";
|
||||
$twitter_url = G5_SNS_URL."/twitter/redirect.php";
|
||||
}
|
||||
}
|
||||
*/
|
||||
@ -88,17 +88,17 @@ if (!$board['bo_use_sns']) return;
|
||||
$twitter_url = $connection->getAuthorizeURL($token);
|
||||
break;
|
||||
default :
|
||||
$twitter_url = G4_SNS_URL."/twitter/redirect.php";
|
||||
$twitter_url = G5_SNS_URL."/twitter/redirect.php";
|
||||
}
|
||||
}
|
||||
|
||||
echo '<li>';
|
||||
if ($twitter_user) {
|
||||
echo '<img src="'.G4_SNS_URL.'/icon/twitter.png" id="twitter_icon">';
|
||||
echo '<img src="'.G5_SNS_URL.'/icon/twitter.png" id="twitter_icon">';
|
||||
echo '<label for="" class="sound_only">트위터 동시 등록</label>';
|
||||
echo '<input type="checkbox" name="twitter_checked" id="twitter_checked" '.(get_cookie('ck_twitter_checked')?'checked':'').' value="1">';
|
||||
} else {
|
||||
echo '<a href="'.$twitter_url.'" id="twitter_url" onclick="return false;"><img src="'.G4_SNS_URL.'/icon/twitter'.($twitter_user?'':'_off').'.png" id="twitter_icon"></a>';
|
||||
echo '<a href="'.$twitter_url.'" id="twitter_url" onclick="return false;"><img src="'.G5_SNS_URL.'/icon/twitter'.($twitter_user?'':'_off').'.png" id="twitter_icon"></a>';
|
||||
echo '<label for="" class="sound_only">트위터 동시 등록</label>';
|
||||
echo '<input type="checkbox" name="twitter_checked" id="twitter_checked" disabled value="1">';
|
||||
echo '<script>$(function(){ $("#twitter_url").click(function(){ window.open(this.href, "twitter_url", "width=600,height=250"); }); });</script>';
|
||||
@ -130,11 +130,11 @@ if (!$board['bo_use_sns']) return;
|
||||
|
||||
echo '<li>';
|
||||
if ($me2day_user) {
|
||||
echo '<img src="'.G4_SNS_URL.'/icon/me2day.png" id="me2day_icon">';
|
||||
echo '<img src="'.G5_SNS_URL.'/icon/me2day.png" id="me2day_icon">';
|
||||
echo '<label for="" class="sound_only">미투데이 동시 등록</label>';
|
||||
echo '<input type="checkbox" name="me2day_checked" id="me2day_checked" '.(get_cookie('ck_me2day_checked')?'checked':'').' value="1">';
|
||||
} else {
|
||||
echo '<a href="'.$me2day_url.'" id="me2day_url" onclick="return false;"><img src="'.G4_SNS_URL.'/icon/me2day'.($me2day_user?'':'_off').'.png" id="me2day_icon"></a>';
|
||||
echo '<a href="'.$me2day_url.'" id="me2day_url" onclick="return false;"><img src="'.G5_SNS_URL.'/icon/me2day'.($me2day_user?'':'_off').'.png" id="me2day_icon"></a>';
|
||||
echo '<label for="" class="sound_only">미투데이 동시 등록</label>';
|
||||
echo '<input type="checkbox" name="me2day_checked" id="me2day_checked" disabled value="1">';
|
||||
echo '<script>$(function(){ $("#me2day_url").click(function(){ window.open(this.href, "me2day_url", "width=1000,height=800"); }); });</script>';
|
||||
|
||||
Reference in New Issue
Block a user