사용자: 게시판스킨, 일반/갤러리 SNS 보내기 마크업 및 스타일 완료

This commit is contained in:
whitedot
2013-05-28 17:22:29 +09:00
parent 4b30972b2c
commit 69a37b2fe1
7 changed files with 113 additions and 33 deletions

View File

@ -25,12 +25,11 @@ if ($result->code == 0) {
$(function() {
document.write("<strong>미투데이에 승인이 되었습니다.</strong>");
var opener = window.opener;
if (opener.document.getElementById("#wr_name"))
opener.document.getElementById("#wr_name").val("{$sns_name}");
opener.$("#me2day_icon").attr("src", "{$g4_sns_url}/icon/me2day.png");
opener.$("#me2day_checked").attr("disabled", false);
opener.$("#me2day_checked").attr("checked", true);
if (parent.document.getElementById("wr_name"))
parent.document.getElementById("wr_name").value = "{$sns_name}";
opener.document.getElementById("me2day_icon").setAttribute("src", "{$g4_sns_url}/icon/me2day.png");
parent.document.getElementById("me2day_checked").disabled = false;
parent.document.getElementById("me2day_checked").checked = true;
window.close();
});
</script>

View File

@ -98,6 +98,10 @@
#bo_v_act_good,
#bo_v_act_nogood {position:absolute;font-size:0;line-height:0;overflow:hidden}
#bo_v_sns {margin:0 0 20px;padding:0;list-style:none;zoom:1}
#bo_v_sns:after {display:block;visibility:hidden;clear:both;content:""}
#bo_v_sns li {float:left;margin:0 5px 0 0}
#bo_v form {padding-top:20px}
/* 게시판 댓글 */
@ -127,4 +131,9 @@
#bo_vc_w h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#bo_vc_w #char_cnt {display:block;margin:0 0 5px}
#bo_vc_sns {margin:0;padding:0;list-style:none;zoom:1}
#bo_vc_sns:after {display:block;visibility:hidden;clear:both;content:""}
#bo_vc_sns li {float:left;margin:0 20px 0 0}
#bo_vc_sns input {margin:0 0 0 5px}
#bo_vc form {padding:0}

View File

@ -11,10 +11,10 @@ $msg_url = $sns_msg.' : '.$sns_url;
$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;
$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;
/*
$sns_send = G4_BBS_URL.'/sns_send.php?longurl='.urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
@ -23,16 +23,16 @@ $sns_send .= '&amp;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>
<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>
<?php
if (G4_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";
$kakao_url = 'kakaolink://sendurl?msg='.$sns_msg.'&amp;url='.$sns_url.'&amp;appid='.$kakao_appid.'&amp;appver=1.0&amp;type=link&amp;appname='.$kakao_appname.'&amp;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 G4_SNS_URL; ?>/icon/kakaotalk.png" alt="카카오톡으로 보내기"></a></li>
<?php
}
?>

View File

@ -6,7 +6,7 @@ if (!$board['bo_use_sns']) return;
<tr>
<th scope="row">SNS 등록</th>
<td>
<div id="sns_facebook">
<ul id="bo_vc_sns">
<?php
//============================================================================
// 페이스북
@ -29,16 +29,20 @@ if (!$board['bo_use_sns']) return;
}
}
echo '<li>';
if ($facebook_user) {
echo '<input type="checkbox" name="facebook_checked" id="facebook_checked" '.(get_cookie('ck_facebook_checked')?'checked':'').' value="1">';
echo '<img src="'.G4_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"));
echo '<input type="checkbox" name="facebook_checked" id="facebook_checked" disabled value="1">';
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 '<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>';
}
echo '</li>';
}
//============================================================================
@ -78,14 +82,18 @@ if (!$board['bo_use_sns']) return;
}
}
echo '<li>';
if ($twitter_user) {
echo '<input type="checkbox" name="twitter_checked" id="twitter_checked" '.(get_cookie('ck_twitter_checked')?'checked':'').' value="1">';
echo '<img src="'.G4_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 '<input type="checkbox" name="twitter_checked" id="twitter_checked" disabled value="1">';
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 '<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>';
}
echo '</li>';
}
//============================================================================
@ -102,17 +110,21 @@ if (!$board['bo_use_sns']) return;
$me2day_user = true;
}
echo '<li>';
if ($me2day_user) {
echo '<input type="checkbox" name="me2day_checked" id="me2day_checked" '.(get_cookie('ck_me2day_checked')?'checked':'').' value="1">';
echo '<img src="'.G4_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 '<input type="checkbox" name="me2day_checked" id="me2day_checked" disabled value="1">';
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 '<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>';
}
//============================================================================
?>
</div>
</ul>
</td>
</tr>

View File

@ -122,6 +122,10 @@
#bo_v_act_good,
#bo_v_act_nogood {position:absolute;font-size:0;line-height:0;overflow:hidden}
#bo_v_sns {margin:0 0 20px;padding:0;list-style:none;zoom:1}
#bo_v_sns:after {display:block;visibility:hidden;clear:both;content:""}
#bo_v_sns li {float:left;margin:0 5px 0 0}
#bo_v form {padding-top:20px}
/* 게시판 댓글 */
@ -151,4 +155,9 @@
#bo_vc_w h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
#bo_vc_w #char_cnt {display:block;margin:0 0 5px}
#bo_vc_sns {margin:0;padding:0;list-style:none;zoom:1}
#bo_vc_sns:after {display:block;visibility:hidden;clear:both;content:""}
#bo_vc_sns li {float:left;margin:0 20px 0 0}
#bo_vc_sns input {margin:0 0 0 5px}
#bo_vc form {padding:0}

View File

@ -0,0 +1,39 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if (!$board['bo_use_sns']) 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;
/*
$sns_send = G4_BBS_URL.'/sns_send.php?longurl='.urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
//$sns_send .= '&amp;title='.urlencode(utf8_strcut(get_text($view['subject']),140));
$sns_send .= '&amp;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>
<?php
if (G4_IS_MOBILE) {
$kakao_url = 'kakaolink://sendurl?msg='.$sns_msg.'&amp;url='.$sns_url.'&amp;appid='.$kakao_appid.'&amp;appver=1.0&amp;type=link&amp;appname='.$kakao_appname.'&amp;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>
<?php
}
?>
</ul>

View File

@ -6,7 +6,7 @@ if (!$board['bo_use_sns']) return;
<tr>
<th scope="row">SNS 등록</th>
<td>
<div id="sns_facebook">
<ul id="bo_vc_sns">
<?php
//============================================================================
// 페이스북
@ -29,16 +29,20 @@ if (!$board['bo_use_sns']) return;
}
}
echo '<li>';
if ($facebook_user) {
echo '<input type="checkbox" name="facebook_checked" id="facebook_checked" '.(get_cookie('ck_facebook_checked')?'checked':'').' value="1">';
echo '<img src="'.G4_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"));
echo '<input type="checkbox" name="facebook_checked" id="facebook_checked" disabled value="1">';
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 '<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>';
}
echo '</li>';
}
//============================================================================
@ -78,14 +82,18 @@ if (!$board['bo_use_sns']) return;
}
}
echo '<li>';
if ($twitter_user) {
echo '<input type="checkbox" name="twitter_checked" id="twitter_checked" '.(get_cookie('ck_twitter_checked')?'checked':'').' value="1">';
echo '<img src="'.G4_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 '<input type="checkbox" name="twitter_checked" id="twitter_checked" disabled value="1">';
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 '<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>';
}
echo '</li>';
}
//============================================================================
@ -102,17 +110,21 @@ if (!$board['bo_use_sns']) return;
$me2day_user = true;
}
echo '<li>';
if ($me2day_user) {
echo '<input type="checkbox" name="me2day_checked" id="me2day_checked" '.(get_cookie('ck_me2day_checked')?'checked':'').' value="1">';
echo '<img src="'.G4_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 '<input type="checkbox" name="me2day_checked" id="me2day_checked" disabled value="1">';
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 '<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>';
}
//============================================================================
?>
</div>
</ul>
</td>
</tr>