Merge branch 'g5'
This commit is contained in:
@ -56,8 +56,7 @@ if (!isset($board['bo_use_sns'])) {
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
sql_query(" ALTER TABLE `{$g5['write_prefix']}{$row['bo_table']}`
|
||||
ADD `wr_facebook_user` VARCHAR(255) NOT NULL DEFAULT '' AFTER `wr_ip`,
|
||||
ADD `wr_twitter_user` VARCHAR(255) NOT NULL DEFAULT '' AFTER `wr_facebook_user`,
|
||||
ADD `wr_me2day_user` VARCHAR(255) NOT NULL DEFAULT '' AFTER `wr_twitter_user` ", false);
|
||||
ADD `wr_twitter_user` VARCHAR(255) NOT NULL DEFAULT '' AFTER `wr_facebook_user` ", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -54,8 +54,7 @@ if(!isset($config['cf_facebook_appid'])) {
|
||||
ADD `cf_facebook_appid` VARCHAR(255) NOT NULL AFTER `cf_googl_shorturl_apikey`,
|
||||
ADD `cf_facebook_secret` VARCHAR(255) NOT NULL AFTER `cf_facebook_appid`,
|
||||
ADD `cf_twitter_key` VARCHAR(255) NOT NULL AFTER `cf_facebook_secret`,
|
||||
ADD `cf_twitter_secret` VARCHAR(255) NOT NULL AFTER `cf_twitter_key`,
|
||||
ADD `cf_me2day_key` VARCHAR(255) NOT NULL AFTER `cf_twitter_secret` ", true);
|
||||
ADD `cf_twitter_secret` VARCHAR(255) NOT NULL AFTER `cf_twitter_key` ", true);
|
||||
}
|
||||
|
||||
// uniqid 테이블이 없을 경우 생성
|
||||
@ -939,12 +938,6 @@ if ($config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
<input type="text" name="cf_twitter_secret" value="<?php echo $config['cf_twitter_secret'] ?>" id="cf_twitter_secret" class="frm_input" size="35">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cf_me2day_key">미투데이 Key</label></th>
|
||||
<td colspan="3">
|
||||
<input type="text" name="cf_me2day_key" value="<?php echo $config['cf_me2day_key'] ?>" id="cf_me2day_key" class="frm_input"> <a href="http://me2day.net/me2/app/get_appkey" target="_blank" class="btn_frmline">앱 등록하기</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cf_googl_shorturl_apikey">구글 짧은주소 API Key</label></th>
|
||||
<td>
|
||||
|
||||
@ -125,7 +125,6 @@ $sql = " update {$g5['config_table']}
|
||||
cf_facebook_secret = '{$_POST['cf_facebook_secret']}',
|
||||
cf_twitter_key = '{$_POST['cf_twitter_key']}',
|
||||
cf_twitter_secret = '{$_POST['cf_twitter_secret']}',
|
||||
cf_me2day_key = '{$_POST['cf_me2day_key']}',
|
||||
cf_1_subj = '{$_POST['cf_1_subj']}',
|
||||
cf_2_subj = '{$_POST['cf_2_subj']}',
|
||||
cf_3_subj = '{$_POST['cf_3_subj']}',
|
||||
|
||||
@ -29,7 +29,6 @@ CREATE TABLE `__TABLE_NAME__` (
|
||||
`wr_ip` varchar(255) NOT NULL,
|
||||
`wr_facebook_user` varchar(255) NOT NULL,
|
||||
`wr_twitter_user` varchar(255) NOT NULL,
|
||||
`wr_me2day_user` varchar(255) NOT NULL,
|
||||
`wr_1` varchar(255) NOT NULL,
|
||||
`wr_2` varchar(255) NOT NULL,
|
||||
`wr_3` varchar(255) NOT NULL,
|
||||
|
||||
@ -12,12 +12,6 @@ switch($_REQUEST['sns']) {
|
||||
case 'twitter' :
|
||||
header("Location:http://twitter.com/home?status=".$title_url);
|
||||
break;
|
||||
case 'me2day' :
|
||||
header("Location:http://me2day.net/posts/new?new_post[body]=".$title_url);
|
||||
break;
|
||||
case 'yozm' :
|
||||
header("Location:http://yozm.daum.net/api/popup/prePost?sourceid=41&prefix=".$title_url);
|
||||
break;
|
||||
case 'gplus' :
|
||||
header("Location:https://plus.google.com/share?url=".$short_url);
|
||||
break;
|
||||
|
||||
@ -160,7 +160,6 @@ if ($w == 'c') // 댓글 입력
|
||||
wr_ip = '{$_SERVER['REMOTE_ADDR']}',
|
||||
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',
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
if (!$board['bo_use_sns']) return;
|
||||
|
||||
set_cookie('ck_facebook_checked', false, 86400*31);
|
||||
set_cookie('ck_twitter_checked' , false, 86400*31);
|
||||
set_cookie('ck_me2day_checked' , false, 86400*31);
|
||||
|
||||
//============================================================================
|
||||
// 페이스북
|
||||
@ -52,7 +51,7 @@ $wr_twitter_user = "";
|
||||
if ($_POST['twitter_checked']) {
|
||||
include_once(G5_SNS_PATH."/twitter/twitteroauth/twitteroauth.php");
|
||||
include_once(G5_SNS_PATH."/twitter/twitterconfig.php");
|
||||
|
||||
|
||||
if ( !(empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret'])) ) {
|
||||
$post = googl_short_url($comment_url).' '.$wr_content;
|
||||
$post = utf8_strcut($post, 140);
|
||||
@ -61,30 +60,11 @@ if ($_POST['twitter_checked']) {
|
||||
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);
|
||||
// 등록
|
||||
$connection->post('statuses/update', array('status' => $post));
|
||||
|
||||
|
||||
set_cookie('ck_twitter_checked', true, 86400*31);
|
||||
}
|
||||
|
||||
$wr_twitter_user = get_session("ss_twitter_user");
|
||||
}
|
||||
//============================================================================
|
||||
|
||||
|
||||
//============================================================================
|
||||
// 미투데이
|
||||
//----------------------------------------------------------------------------
|
||||
$wr_me2day_user = "";
|
||||
if ($_POST['me2day_checked']) {
|
||||
if (!empty($_SESSION['me2day']['user_id']) && !empty($_SESSION['me2day']['user_key'])) {
|
||||
$user_id = $_SESSION['me2day']['user_id'];
|
||||
$user_key = $_SESSION['me2day']['user_key'];
|
||||
$auth_key = "12345678" . md5("12345678" . $user_key);
|
||||
$result = file_get_contents("http://me2day.net/api/create_post/{$user_id}.json?uid={$user_id}&ukey={$auth_key}&akey=".$config['cf_me2day_key']."&post[body]=".urlencode($wr_content));
|
||||
|
||||
set_cookie('ck_me2day_checked', true, 86400*31);
|
||||
}
|
||||
|
||||
$wr_me2day_user = get_session("ss_me2day_user");
|
||||
}
|
||||
//============================================================================
|
||||
?>
|
||||
@ -299,7 +299,6 @@ CREATE TABLE IF NOT EXISTS `g5_config` (
|
||||
`cf_facebook_secret` varchar(255) NOT NULL,
|
||||
`cf_twitter_key` varchar(255) NOT NULL,
|
||||
`cf_twitter_secret` varchar(255) NOT NULL,
|
||||
`cf_me2day_key` varchar(255) NOT NULL,
|
||||
`cf_1_subj` varchar(255) NOT NULL DEFAULT '',
|
||||
`cf_2_subj` varchar(255) NOT NULL DEFAULT '',
|
||||
`cf_3_subj` varchar(255) NOT NULL DEFAULT '',
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 884 B |
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB |
@ -1,3 +0,0 @@
|
||||
<?php
|
||||
include_once("../../../common.php");
|
||||
?>
|
||||
@ -1,55 +0,0 @@
|
||||
<?php
|
||||
include_once("./_common.php");
|
||||
|
||||
$user_id = $_GET['user_id'];
|
||||
$user_key = $_GET['user_key'];
|
||||
$auth_key = "12345678" . md5("12345678" . $user_key);
|
||||
|
||||
$_SESSION['me2day']['user_id'] = $user_id;
|
||||
$_SESSION['me2day']['user_key'] = $user_key;
|
||||
|
||||
$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) {
|
||||
|
||||
$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);
|
||||
|
||||
$g5_sns_url = G5_SNS_URL;
|
||||
|
||||
echo <<<EOT
|
||||
<script>
|
||||
$(function() {
|
||||
document.write("<strong>미투데이에 승인이 되었습니다.</strong>");
|
||||
|
||||
var opener = window.opener;
|
||||
opener.$("#wr_name").val("{$sns_name}");
|
||||
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();
|
||||
});
|
||||
</script>
|
||||
EOT;
|
||||
|
||||
} else {
|
||||
|
||||
echo <<<EOT
|
||||
<script>
|
||||
$(function() {
|
||||
alert("미투데이에 승인이 되지 않았습니다.");
|
||||
window.close();
|
||||
});
|
||||
</script>
|
||||
EOT;
|
||||
|
||||
}
|
||||
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
@ -13,7 +13,6 @@ $kakao_appname = urlencode(str_replace('\"', '"', $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;
|
||||
$me2day_url = 'http://me2day.net/posts/new?new_post[body]='.$msg_url;
|
||||
$gplus_url = 'https://plus.google.com/share?url='.$sns_url;
|
||||
|
||||
/*
|
||||
@ -26,7 +25,6 @@ $sns_send .= '&title='.$sns_msg;
|
||||
<ul id="bo_v_sns">
|
||||
<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 (G5_IS_MOBILE) {
|
||||
|
||||
@ -13,6 +13,3 @@ if (!$board['bo_use_sns']) return;
|
||||
<?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 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 G5_SNS_URL; ?>/icon/me2day<?php echo $sns_mc_icon; ?>.png" alt="미투데이에도 등록됨"></a>
|
||||
<?php } ?>
|
||||
|
||||
@ -64,7 +64,7 @@ if (!$board['bo_use_sns']) return;
|
||||
if (empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) || empty($_SESSION['access_token']['oauth_token_secret'])) {
|
||||
$twitter_url = G5_SNS_URL."/twitter/redirect.php";
|
||||
} else {
|
||||
$access_token = $_SESSION['access_token'];
|
||||
$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');
|
||||
|
||||
@ -73,12 +73,12 @@ if (!$board['bo_use_sns']) return;
|
||||
$twitter_user = true;
|
||||
$twitter_url = $connection->getAuthorizeURL($token);
|
||||
break;
|
||||
default :
|
||||
default :
|
||||
$twitter_url = G5_SNS_URL."/twitter/redirect.php";
|
||||
}
|
||||
}
|
||||
*/
|
||||
$access_token = $_SESSION['access_token'];
|
||||
$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');
|
||||
|
||||
@ -87,7 +87,7 @@ if (!$board['bo_use_sns']) return;
|
||||
$twitter_user = true;
|
||||
$twitter_url = $connection->getAuthorizeURL($token);
|
||||
break;
|
||||
default :
|
||||
default :
|
||||
$twitter_url = G5_SNS_URL."/twitter/redirect.php";
|
||||
}
|
||||
}
|
||||
@ -106,42 +106,6 @@ if (!$board['bo_use_sns']) return;
|
||||
echo '</li>';
|
||||
}
|
||||
//============================================================================
|
||||
|
||||
|
||||
//============================================================================
|
||||
// 미투데이
|
||||
//----------------------------------------------------------------------------
|
||||
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']));
|
||||
$me2day_url = $result->url;
|
||||
} 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) {
|
||||
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="'.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>';
|
||||
}
|
||||
echo '</li>';
|
||||
}
|
||||
//============================================================================
|
||||
?>
|
||||
</ul>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user