댓글 등록된 SNS 를 코멘트에 표시

This commit is contained in:
gnuboard
2013-05-29 10:51:02 +09:00
parent 22aee8998c
commit 8b57547440
4 changed files with 15 additions and 69 deletions

View File

@ -134,6 +134,11 @@ if ($w == 'c') // 댓글 입력
$tmp_comment_reply = '';
}
// SNS 등록
$wr_sns = array();
include_once("./write_comment_update.sns.php");
$wr_sns = implode(",", $wr_sns);
$sql = " insert into $write_table
set ca_name = '{$wr['ca_name']}',
wr_option = '$wr_secret',
@ -153,6 +158,7 @@ if ($w == 'c') // 댓글 입력
wr_datetime = '".G4_TIME_YMDHIS."',
wr_last = '',
wr_ip = '{$_SERVER['REMOTE_ADDR']}',
wr_sns = '$wr_sns',
wr_1 = '$wr_1',
wr_2 = '$wr_2',
wr_3 = '$wr_3',
@ -167,13 +173,8 @@ if ($w == 'c') // 댓글 입력
$comment_id = mysql_insert_id();
// SNS 등록
$wr_sns = array();
include_once("./write_comment_update.sns.php");
$wr_sns = implode(",", $wr_sns);
// 원글에 댓글수 증가 & 마지막 시간 반영
sql_query(" update $write_table set wr_comment = wr_comment + 1, wr_sns = '$wr_sns', wr_last = '".G4_TIME_YMDHIS."' where wr_id = '$wr_id' ");
sql_query(" update $write_table set wr_comment = wr_comment + 1, wr_last = '".G4_TIME_YMDHIS."' where wr_id = '$wr_id' ");
// 새글 INSERT
sql_query(" insert into {$g4['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '$bo_table', '$comment_id', '$wr_id', '".G4_TIME_YMDHIS."', '{$member['mb_id']}' ) ");

View File

@ -1,41 +0,0 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 휴대폰번호 체크
if ($msg = valid_mb_hp($mb_hp)) alert($msg, "", true, true);
if ($msg = exist_mb_hp($mb_hp, $mb_id)) alert($msg, "", true, true);
$reg_mb_hp = preg_replace("/[^0-9]/", "", trim($_POST['mb_hp']));
/* ======================================================================================================= */
/* = 휴대폰인증 및 성인인증 = */
/* ======================================================================================================= */
if($w == '') {
// 본인인증체크
$kcpcert_no = get_session('ss_kcpcert_no');
if(!$kcpcert_no)
alert('휴대폰인증이 되지 않았습니다. 휴대폰인증을 해주세요.', '', true, true);
// 본인인증 hash 체크
$reg_hash = md5($reg_mb_hp.$mb_name.$kcpcert_no);
if(get_session('ss_kcpcert_hash') != $reg_hash)
alert('이름 또는 휴대폰번호가 올바르지 않습니다. 정상적인 방법으로 이용해 주세요.', '', true, true);
} else if($w == 'u') {
// 휴대폰번호 변경체크
$old_hp = preg_replace("/[^0-9]/", "", trim($_POST['old_mb_hp']));
if($old_hp !== $reg_mb_hp) {
// 본인인증체크
$kcpcert_no = get_session('ss_kcpcert_no');
if(!$kcpcert_no)
alert('휴대폰번호가 변경됐습니다. 휴대폰인증을 해주세요.', '', true, true);
// 본인인증 hash 체크
$reg_hash = md5($reg_mb_hp.$mb_name.$kcpcert_no);
if(get_session('ss_kcpcert_hash') != $reg_hash)
alert('이름 또는 휴대폰인증 정보가 올바르지 않습니다. 정상적인 방법으로 이용해 주세요.', '', true, true);
}
}
/* ======================================================================================================= */
?>

View File

@ -16,11 +16,13 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
$comment_id = $list[$i]['wr_id'];
$cmt_depth = ""; // 댓글단계
$cmt_depth = strlen($list[$i]['wr_comment_reply']) * 20;
$str = $list[$i]['content'];
$comment = $list[$i]['content'];
/*
if (strstr($list[$i]['wr_option'], "secret")) {
$str = $str;
}
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $str);
*/
$comment = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $comment);
?>
<article id="c_<?php echo $comment_id ?>" <?php if ($cmt_depth) { ?>style="margin-left:<?php echo $cmt_depth ?>px;border-top-color:#e0e0e0"<?php } ?>>
<header>
@ -38,7 +40,10 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
<!-- 댓글 출력 -->
<p>
<?php if (strstr($list[$i]['wr_option'], "secret")) echo "<img src=\"".$board_skin_url."/img/icon_secret.gif\" alt=\"비밀글\">"; ?>
<?php echo $str ?>
<?php if (strstr($list[$i]['wr_sns'], "fb")) echo "<img src=\"".G4_SNS_URL."/icon/facebook.png\" alt=\"페이스북에도 등록됨\">"; ?>
<?php if (strstr($list[$i]['wr_sns'], "tw")) echo "<img src=\"".G4_SNS_URL."/icon/twitter.png\" alt=\"트위터에도 등록됨\">"; ?>
<?php if (strstr($list[$i]['wr_sns'], "me")) echo "<img src=\"".G4_SNS_URL."/icon/me2day.png\" alt=\"미투데이에도 등록됨\">"; ?>
<?php echo $comment ?>
</p>
<span id="edit_<?php echo $comment_id ?>"></span><!-- 수정 -->
@ -168,16 +173,6 @@ var char_max = parseInt(<?php echo $comment_max ?>); // 최대
f.is_good.value = 0;
/*
var s;
if (s = word_filter_check(document.getElementById('wr_content').value))
{
alert("내용에 금지단어('"+s+"')가 포함되어있습니다");
document.getElementById('wr_content').focus();
return false;
}
*/
var subject = "";
var content = "";
$.ajax({

View File

@ -70,15 +70,6 @@ if (!$board['bo_use_sns']) return;
break;
default :
$twitter_url = G4_SNS_URL."/twitter/redirect.php";
// 안먹히는 코드 ㅠㅠ
if ($member['mb_twitter_token'] && $member['mb_twitter_token_secret']) {
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $member['mb_twitter_token'], $member['mb_twitter_token_secret']);
$content = $connection->get('account/verify_credentials');
if (200 == $connection->http_code) {
$twitter_user = true;
$twitter_url = $connection->getAuthorizeURL($token);
}
}
}
}