SNS 적용중
This commit is contained in:
@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
include_once("./_common.php");
|
include_once("./_common.php");
|
||||||
|
|
||||||
|
|
||||||
$title = str_replace('\"', '"',$_REQUEST['title']);
|
$title = str_replace('\"', '"',$_REQUEST['title']);
|
||||||
$short_url = googl_short_url($_REQUEST['longurl']);
|
$short_url = googl_short_url($_REQUEST['longurl']);
|
||||||
$title_url = $title.' : '.$short_url;
|
$title_url = $title.' : '.$short_url;
|
||||||
|
|||||||
@ -25,7 +25,7 @@ if ($user) {
|
|||||||
$sns_name = $user_profile['name'];
|
$sns_name = $user_profile['name'];
|
||||||
$g4_sns_url = G4_SNS_URL;
|
$g4_sns_url = G4_SNS_URL;
|
||||||
|
|
||||||
set_cookie('ck_sns_name', $sns_name);
|
set_cookie('ck_sns_name', $sns_name, 86400);
|
||||||
|
|
||||||
echo <<<EOT
|
echo <<<EOT
|
||||||
<script>
|
<script>
|
||||||
@ -34,7 +34,7 @@ if ($user) {
|
|||||||
|
|
||||||
var opener = window.opener;
|
var opener = window.opener;
|
||||||
opener.$("#wr_name").val("{$sns_name}");
|
opener.$("#wr_name").val("{$sns_name}");
|
||||||
opener.$("#facebook_icon").attr("src", "{$g4_sns_url}/icon/facebook_on.png");
|
opener.$("#facebook_icon").attr("src", "{$g4_sns_url}/icon/facebook.png");
|
||||||
opener.$("#facebook_checked").attr("disabled", false);
|
opener.$("#facebook_checked").attr("disabled", false);
|
||||||
opener.$("#facebook_checked").attr("checked", true);
|
opener.$("#facebook_checked").attr("checked", true);
|
||||||
window.close();
|
window.close();
|
||||||
|
|||||||
BIN
plugin/sns/icon/kakaotalk.png
Normal file
BIN
plugin/sns/icon/kakaotalk.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
BIN
plugin/sns/icon/kakaotalk_off.png
Normal file
BIN
plugin/sns/icon/kakaotalk_off.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@ -18,7 +18,7 @@ if ($result->code == 0) {
|
|||||||
$sns_name = $user->nickname;
|
$sns_name = $user->nickname;
|
||||||
$g4_sns_url = G4_SNS_URL;
|
$g4_sns_url = G4_SNS_URL;
|
||||||
|
|
||||||
set_cookie('ck_sns_name', $sns_name);
|
set_cookie('ck_sns_name', $sns_name, 86400);
|
||||||
|
|
||||||
echo <<<EOT
|
echo <<<EOT
|
||||||
<script>
|
<script>
|
||||||
@ -27,7 +27,7 @@ if ($result->code == 0) {
|
|||||||
|
|
||||||
var opener = window.opener;
|
var opener = window.opener;
|
||||||
opener.$("#wr_name").val("{$sns_name}");
|
opener.$("#wr_name").val("{$sns_name}");
|
||||||
opener.$("#me2day_icon").attr("src", "{$g4_sns_url}/icon/me2day_on.png");
|
opener.$("#me2day_icon").attr("src", "{$g4_sns_url}/icon/me2day.png");
|
||||||
opener.$("#me2day_checked").attr("disabled", false);
|
opener.$("#me2day_checked").attr("disabled", false);
|
||||||
opener.$("#me2day_checked").attr("checked", true);
|
opener.$("#me2day_checked").attr("checked", true);
|
||||||
window.close();
|
window.close();
|
||||||
|
|||||||
@ -52,7 +52,7 @@ if (200 == $connection->http_code) {
|
|||||||
$sns_name = $content->name;
|
$sns_name = $content->name;
|
||||||
$g4_sns_url = G4_SNS_URL;
|
$g4_sns_url = G4_SNS_URL;
|
||||||
|
|
||||||
set_cookie('ck_sns_name', $sns_name);
|
set_cookie('ck_sns_name', $sns_name, 86400);
|
||||||
|
|
||||||
echo <<<EOT
|
echo <<<EOT
|
||||||
<script>
|
<script>
|
||||||
@ -61,7 +61,7 @@ if (200 == $connection->http_code) {
|
|||||||
|
|
||||||
var opener = window.opener;
|
var opener = window.opener;
|
||||||
opener.$("#wr_name").val("{$sns_name}");
|
opener.$("#wr_name").val("{$sns_name}");
|
||||||
opener.$("#twitter_icon").attr("src", "{$g4_sns_url}/icon/twitter_on.png");
|
opener.$("#twitter_icon").attr("src", "{$g4_sns_url}/icon/twitter.png");
|
||||||
opener.$("#twitter_checked").attr("disabled", false);
|
opener.$("#twitter_checked").attr("disabled", false);
|
||||||
opener.$("#twitter_checked").attr("checked", true);
|
opener.$("#twitter_checked").attr("checked", true);
|
||||||
window.close();
|
window.close();
|
||||||
|
|||||||
@ -169,17 +169,9 @@ include_once(G4_LIB_PATH.'/thumbnail.lib.php');
|
|||||||
?>
|
?>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$sns_send = G4_BBS_URL.'/sns_send.php?longurl='.urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
|
include_once($board_skin_path."/view.sns.skin.php");
|
||||||
$sns_send .= '&title='.urlencode(utf8_strcut(get_text($view['wr_subject']),140));
|
|
||||||
?>
|
?>
|
||||||
<ul>
|
|
||||||
<li><a href="<?=$sns_send?>&sns=facebook" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/facebook.png" alt="이 글을 내 페이스북 계정으로 보내기"></a></li>
|
|
||||||
<li><a href="<?=$sns_send?>&sns=twitter" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/twitter.png" alt="이 글을 내 트위터 계정으로 보내기"></a></li>
|
|
||||||
<li><a href="<?=$sns_send?>&sns=me2day" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/me2day.png" alt="이 글을 내 미투데이 계정으로 보내기"></a></li>
|
|
||||||
<li><a href="<?=$sns_send?>&sns=gplus" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/gplus.png" alt="이 글을 내 구글플러스 계정으로 보내기"></a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// 코멘트 입출력
|
// 코멘트 입출력
|
||||||
|
|||||||
33
skin/board/basic/view.sns.skin.php
Normal file
33
skin/board/basic/view.sns.skin.php
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||||
|
|
||||||
|
if (!$config['cf_sns_use']) return;
|
||||||
|
|
||||||
|
$sns_msg = urlencode(str_replace('\"', '"', $view['subject']));
|
||||||
|
$sns_url = googl_short_url('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
|
||||||
|
$msg_url = $sns_msg.' : '.$sns_url;
|
||||||
|
|
||||||
|
// 카카오톡 매뉴얼 : https://github.com/kakao/kakaolink-web
|
||||||
|
$kakao_appid = $_SERVER['HTTP_HOST']; // Mobile Site Domain 정확히 입력하지 않을 경우 이용이 제한될 수 있습니다.
|
||||||
|
$kakao_appname = $g4['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;
|
||||||
|
$kakao_url = "kakaolink://sendurl?msg={$sns_msg}&url={$sns_url}&appid={$kakao_appid}&appver=1.0&type=link&appname={$kakao_appname}&apiver=2.0";
|
||||||
|
|
||||||
|
/*
|
||||||
|
$sns_send = G4_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>
|
||||||
|
<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 $kakao_url; ?>" target="_blank"><img src="<?php echo G4_SNS_URL; ?>/icon/kakaotalk.png" alt="이 글을 카카오톡으로 보내기"></a></li>
|
||||||
|
</ul>
|
||||||
@ -96,7 +96,7 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
|
|||||||
<?php if ($is_guest) { ?>
|
<?php if ($is_guest) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"><label for="wr_name">이름<strong class="sound_only">필수</strong></label></th>
|
<th scope="row"><label for="wr_name">이름<strong class="sound_only">필수</strong></label></th>
|
||||||
<td><input type="text" name="wr_name" id="wr_name" required class="frm_input required" size="5" maxLength="20"></td>
|
<td><input type="text" name="wr_name" id="wr_name" required class="frm_input required" size="5" maxLength="20" value="<?php echo get_cookie("ck_sns_name"); ?>"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"><label for="wr_password">패스워드<strong class="sound_only">필수</strong></label></th>
|
<th scope="row"><label for="wr_password">패스워드<strong class="sound_only">필수</strong></label></th>
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||||
|
|
||||||
//if (!$is_member) return;
|
|
||||||
if (!$config['cf_sns_use']) return;
|
if (!$config['cf_sns_use']) return;
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user