sns 사용 때 게시글 보기 로딩 속도 개선

This commit is contained in:
chicpro
2014-06-10 16:10:17 +09:00
parent cd50ef5d48
commit c8a69b054e
8 changed files with 166 additions and 108 deletions

View File

@ -98,7 +98,7 @@ if ($w == '') {
if ($member['mb_id'])
alert('글을 답변할 권한이 없습니다.');
else
alert('글을 답변할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?$qstr&url='.urlencode($_SERVER['PHP_SELF'].'?bo_table='.$bo_table));
alert('답변글을 작성할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?'.$qstr.'&url='.urlencode($_SERVER['PHP_SELF'].'?bo_table='.$bo_table));
}
$tmp_point = isset($member['mb_point']) ? $member['mb_point'] : 0;

View File

@ -117,7 +117,14 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
</tr>
<?php } ?>
<?php
include(G5_SNS_PATH."/view_comment_write.sns.skin.php");
if($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) {
?>
<tr>
<th scope="row">SNS 동시등록</th>
<td id="bo_vc_send_sns"></td>
</tr>
<?php
}
?>
<tr>
<th scope="row">내용</th>
@ -298,5 +305,12 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
}
comment_box('', 'c'); // 댓글 입력폼이 보이도록 처리하기위해서 추가 (root님)
<?php if($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) { ?>
// sns 등록
$(function() {
$("#bo_vc_send_sns").load( "<?php echo G5_SNS_URL; ?>/view_comment_write.sns.skin.php?bo_table=<?php echo $bo_table; ?>" );
});
<?php } ?>
</script>
<?php } ?>

View File

@ -117,7 +117,14 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
</tr>
<?php } ?>
<?php
include(G5_SNS_PATH."/view_comment_write.sns.skin.php");
if($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) {
?>
<tr>
<th scope="row">SNS 동시등록</th>
<td id="bo_vc_send_sns"></td>
</tr>
<?php
}
?>
<tr>
<th scope="row">내용</th>
@ -298,5 +305,12 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
}
comment_box('', 'c'); // 댓글 입력폼이 보이도록 처리하기위해서 추가 (root님)
<?php if($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) { ?>
// sns 등록
$(function() {
$("#bo_vc_send_sns").load( "<?php echo G5_SNS_URL; ?>/view_comment_write.sns.skin.php?bo_table=<?php echo $bo_table; ?>" );
});
<?php } ?>
</script>
<?php } ?>

3
plugin/sns/_common.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once('../../common.php');
?>

View File

@ -4,23 +4,26 @@ 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;
//$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 = 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;
$gplus_url = 'https://plus.google.com/share?url='.$sns_url;
*/
/*
$sns_send = G5_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;
*/
$facebook_url = $sns_send.'&amp;sns=facebook';
$twitter_url = $sns_send.'&amp;sns=twitter';
$gplus_url = $sns_send.'&amp;sns=gplus';
?>
<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>

View File

@ -1,17 +1,15 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once('./_common.php');
if (!$board['bo_use_sns']) return;
if (!$board['bo_use_sns']) die('');
?>
<tr>
<th scope="row">SNS 동시등록</th>
<td>
<ul id="bo_vc_sns">
<?php
//============================================================================
// 페이스북
//----------------------------------------------------------------------------
if ($config['cf_facebook_appid']) {
<ul id="bo_vc_sns">
<?php
//============================================================================
// 페이스북
//----------------------------------------------------------------------------
if ($config['cf_facebook_appid']) {
$facebook_user = get_session("ss_facebook_user");
if (!$facebook_user) {
include_once(G5_SNS_PATH."/facebook/src/facebook.php");
@ -46,14 +44,14 @@ if (!$board['bo_use_sns']) return;
echo '<script>$(function(){ $("#facebook_url").live("click", function(){ window.open(this.href, "facebook_url", "width=600,height=250"); }); });</script>';
}
echo '</li>';
}
//============================================================================
}
//============================================================================
//============================================================================
// 트위터
//----------------------------------------------------------------------------
if ($config['cf_twitter_key']) {
//============================================================================
// 트위터
//----------------------------------------------------------------------------
if ($config['cf_twitter_key']) {
$twitter_user = get_session("ss_twitter_user");
if (!$twitter_user) {
include_once(G5_SNS_PATH."/twitter/twitteroauth/twitteroauth.php");
@ -104,9 +102,7 @@ if (!$board['bo_use_sns']) return;
echo '<script>$(function(){ $("#twitter_url").live("click", function(){ window.open(this.href, "twitter_url", "width=600,height=250"); }); });</script>';
}
echo '</li>';
}
//============================================================================
?>
</ul>
</td>
</tr>
}
//============================================================================
?>
</ul>

View File

@ -125,7 +125,14 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
</tr>
<?php } ?>
<?php
include(G5_SNS_PATH."/view_comment_write.sns.skin.php");
if($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) {
?>
<tr>
<th scope="row">SNS 동시등록</th>
<td id="bo_vc_send_sns"></td>
</tr>
<?php
}
?>
<tr>
<th scope="row">내용</th>
@ -306,6 +313,13 @@ function comment_delete()
}
comment_box('', 'c'); // 댓글 입력폼이 보이도록 처리하기위해서 추가 (root님)
<?php if($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) { ?>
// sns 등록
$(function() {
$("#bo_vc_send_sns").load( "<?php echo G5_SNS_URL; ?>/view_comment_write.sns.skin.php?bo_table=<?php echo $bo_table; ?>" );
});
<?php } ?>
</script>
<?php } ?>
<!-- } 댓글 쓰기 끝 -->

View File

@ -125,7 +125,14 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
</tr>
<?php } ?>
<?php
include(G5_SNS_PATH."/view_comment_write.sns.skin.php");
if($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) {
?>
<tr>
<th scope="row">SNS 동시등록</th>
<td id="bo_vc_send_sns"></td>
</tr>
<?php
}
?>
<tr>
<th scope="row">내용</th>
@ -306,6 +313,13 @@ function comment_delete()
}
comment_box('', 'c'); // 댓글 입력폼이 보이도록 처리하기위해서 추가 (root님)
<?php if($board['bo_use_sns'] && ($config['cf_facebook_appid'] || $config['cf_twitter_key'])) { ?>
// sns 등록
$(function() {
$("#bo_vc_send_sns").load( "<?php echo G5_SNS_URL; ?>/view_comment_write.sns.skin.php?bo_table=<?php echo $bo_table; ?>" );
});
<?php } ?>
</script>
<?php } ?>
<!-- } 댓글 쓰기 끝 -->