trackback 트랙백 기능 제거
This commit is contained in:
@ -40,7 +40,6 @@ $sql = " insert into {$g4['board_table']}
|
||||
bo_download_level = '{$board[bo_download_level]}',
|
||||
bo_html_level = '{$board[bo_html_level]}',
|
||||
bo_link_level = '{$board[bo_link_level]}',
|
||||
bo_trackback_level = '{$board[bo_trackback_level]}',
|
||||
bo_count_modify = '{$board[bo_count_modify]}',
|
||||
bo_count_delete = '{$board[bo_count_delete]}',
|
||||
bo_read_point = '{$board[bo_read_point]}',
|
||||
@ -57,7 +56,6 @@ $sql = " insert into {$g4['board_table']}
|
||||
bo_use_nogood = '{$board[bo_use_nogood]}',
|
||||
bo_use_signature = '{$board[bo_use_signature]}',
|
||||
bo_use_ip_view = '{$board[bo_use_ip_view]}',
|
||||
bo_use_trackback = '{$board[bo_use_trackback]}',
|
||||
bo_use_list_view = '{$board['o_use_list_view']}',
|
||||
bo_use_list_content = '{$board[bo_use_list_content]}',
|
||||
bo_table_width = '{$board[bo_table_width]}',
|
||||
|
||||
@ -247,17 +247,6 @@ include_once ('./admin.head.php');
|
||||
<label for="chk_html_level">동일그룹 모두 적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bo_trackback_level">트랙백쓰기 권한</label></th>
|
||||
<td>
|
||||
<?=help('트랙백이란? 쉽게 설명하여 "내가 작성하는 글을 다른사람에게 알리는 기능" 입니다.'.PHP_EOL.'자세한 내용은 검색엔진에서 "트랙백"으로 검색을 해보시기 바랍니다.')?>
|
||||
<?=get_member_level_select('bo_trackback_level', 1, 10, $board['bo_trackback_level']) ?>
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" id="chk_trackback_level" name="chk_trackback_level" value="1">
|
||||
<label for="chk_trackback_level">동일그룹 모두 적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@ -399,17 +388,6 @@ include_once ('./admin.head.php');
|
||||
<label for="chk_use_ip_view">동일그룹 모두 적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bo_use_trackback">트랙백 사용</label></th>
|
||||
<td>
|
||||
<input type="checkbox" id="bo_use_trackback" name="bo_use_trackback" value="1" <?=$board['bo_use_trackback']?'checked':'';?>>
|
||||
사용 (트랙백쓰기 권한 보다 우선함)
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" id="chk_use_trackback" name="chk_use_trackback" value="1">
|
||||
<label for="chk_use_trackback">동일그룹 모두 적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bo_use_list_content">목록에서 내용 사용</label></th>
|
||||
<td>
|
||||
|
||||
@ -70,7 +70,6 @@ $sql_common = " gr_id = '{$_POST['gr_id']}',
|
||||
bo_comment_level = '{$_POST[bo_comment_level]}',
|
||||
bo_html_level = '{$_POST[bo_html_level]}',
|
||||
bo_link_level = '{$_POST[bo_link_level]}',
|
||||
bo_trackback_level = '{$_POST[bo_trackback_level]}',
|
||||
bo_count_modify = '{$_POST[bo_count_modify]}',
|
||||
bo_count_delete = '{$_POST[bo_count_delete]}',
|
||||
bo_upload_level = '{$_POST[bo_upload_level]}',
|
||||
@ -92,7 +91,6 @@ $sql_common = " gr_id = '{$_POST['gr_id']}',
|
||||
bo_use_name = '{$_POST[bo_use_name]}',
|
||||
bo_use_signature = '{$_POST[bo_use_signature]}',
|
||||
bo_use_ip_view = '{$_POST[bo_use_ip_view]}',
|
||||
bo_use_trackback = '{$_POST[bo_use_trackback]}',
|
||||
bo_use_list_view = '{$_POST[bo_use_list_view]}',
|
||||
bo_use_list_content = '{$_POST[bo_use_list_content]}',
|
||||
bo_use_email = '{$_POST[bo_use_email]}',
|
||||
@ -248,7 +246,6 @@ if ($chk_link_level) $s .= " , bo_link_level = '{$bo_link_level}' ";
|
||||
if ($chk_upload_level) $s .= " , bo_upload_level = '{$bo_upload_level}' ";
|
||||
if ($chk_download_level) $s .= " , bo_download_level = '{$bo_download_level}' ";
|
||||
if ($chk_html_level) $s .= " , bo_html_level = '{$bo_html_level}' ";
|
||||
if ($chk_trackback_level) $s .= " , bo_trackback_level = '{$bo_trackback_level}' ";
|
||||
if ($chk_count_modify) $s .= " , bo_count_modify = '{$bo_count_modify}' ";
|
||||
if ($chk_count_delete) $s .= " , bo_count_delete = '{$bo_count_delete}' ";
|
||||
if ($chk_read_point) $s .= " , bo_read_point = '{$bo_read_point}' ";
|
||||
@ -269,7 +266,6 @@ if ($chk_use_nogood) $s .= " , bo_use_nogood = '{$bo_use_nogood}' ";
|
||||
if ($chk_use_name) $s .= " , bo_use_name = '{$bo_use_name}' ";
|
||||
if ($chk_use_signature) $s .= " , bo_use_signature = '{$bo_use_signature}' ";
|
||||
if ($chk_use_ip_view) $s .= " , bo_use_ip_view = '{$bo_use_ip_view}' ";
|
||||
if ($chk_use_trackback) $s .= " , bo_use_trackback = '{$bo_use_trackback}' ";
|
||||
if ($chk_use_list_view) $s .= " , bo_use_list_view = '{$bo_use_list_view}' ";
|
||||
if ($chk_use_list_content) $s .= " , bo_use_list_content = '{$bo_use_list_content}' ";
|
||||
if ($chk_use_email) $s .= " , bo_use_email = '{$bo_use_email}' ";
|
||||
|
||||
@ -59,7 +59,6 @@ while ($row = sql_fetch_array($result))
|
||||
wr_link2 = '".addslashes($row2[wr_link2])."',
|
||||
wr_link1_hit = '$row2[wr_link1_hit]',
|
||||
wr_link2_hit = '$row2[wr_link2_hit]',
|
||||
wr_trackback = '".addslashes($row2[wr_trackback])."',
|
||||
wr_hit = '$row2[wr_hit]',
|
||||
wr_good = '$row2[wr_good]',
|
||||
wr_nogood = '$row2[wr_nogood]',
|
||||
|
||||
194
bbs/tb.php
194
bbs/tb.php
@ -1,194 +0,0 @@
|
||||
<?
|
||||
//
|
||||
// 트랙백 핑 받는 페이지
|
||||
//
|
||||
define("_GNUBOARD_", TRUE);
|
||||
|
||||
include_once('./_common.php');
|
||||
// 오류는 write_log() 함수로 남긴다.
|
||||
include_once($g4['path'].'/lib/etc.lib.php');
|
||||
|
||||
function tb_xml_msg($error, $msg='')
|
||||
{
|
||||
global $g4;
|
||||
|
||||
$s = '';
|
||||
$s .= '<?xml version="1.0" encoding="'.$g4[charset].'"?>'.PHP_EOL;
|
||||
$s .= '<response>'.PHP_EOL;
|
||||
$s .= '<error>'.$error.'</error>'.PHP_EOL;
|
||||
$s .= '<message>'.$msg.'</message>'.PHP_EOL;
|
||||
$s .= '</response>'.PHP_EOL;
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
$arr = explode("/", $_SERVER[PATH_INFO]);
|
||||
// 영문자 숫자 _ 과 일치하지 않는 문자는 삭제한다. (최대 20자)
|
||||
$bo_table = preg_replace("/\W/", "", substr($arr[1],0,20));
|
||||
// 정수형으로 변환
|
||||
$wr_id = (int)$arr[2];
|
||||
// 영소문자 숫자 와 일치하지 않는 문자는 삭제한다. (최대 32자)
|
||||
$to_token = preg_replace("/[^a-z0-9]/", "", substr($arr[3],0,32));
|
||||
|
||||
$write_table = $g4[write_prefix] . $bo_table; // 게시판 테이블 전체이름
|
||||
|
||||
$sql = " select wr_id, ca_name, wr_email from {$write_table} where wr_id = '{$wr_id}' ";
|
||||
$wr = sql_fetch($sql, FALSE);
|
||||
|
||||
// wr_id가 없거나 트랙백으로 넘어온게 아니라면
|
||||
if (!$wr[wr_id] || !($_POST[title] && $_POST[excerpt] && $_POST[url] && $_POST[blog_name]))
|
||||
{
|
||||
$tmp_dir = str_replace('/tb.php', '', $_SERVER[SCRIPT_NAME]);
|
||||
header('location:'.$tmp_dir.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$to_token)
|
||||
{
|
||||
if (isset($_POST))
|
||||
write_log($g4['path'].'/data/log/tb.log', $_POST);
|
||||
|
||||
echo tb_xml_msg(1, '토큰값이 넘어오지 않았습니다.');
|
||||
exit;
|
||||
}
|
||||
|
||||
$sql = " select to_token from {$g4[token_table]} where to_token = '{$to_token}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row[to_token] && $to_token)
|
||||
{
|
||||
// 두번 이상 트랙백을 보내지 못하도록 하기 위하여 토큰을 삭제한다
|
||||
sql_query(" delete from {$g4[token_table]} where to_token = '{$to_token}' ");
|
||||
|
||||
// 토큰검사 (3시간 이상 지난 토큰은 삭제)
|
||||
if (isset($g4['token_time']) == false)
|
||||
$g4['token_time'] = 3;
|
||||
|
||||
$sql = " delete from {$g4[token_table]} where to_datetime < '".date("Y-m-d", $g4[server_time] - 3600 * $g4['token_time'])."' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo tb_xml_msg(1, '트랙백 주소가 올바르지 않습니다. (토큰 유효시간 경과 등)');
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = $_POST[title];
|
||||
$excerpt = $_POST[excerpt];
|
||||
|
||||
if (strlen($title) > 255) $title = cut_str($title, 255);
|
||||
if (strlen($excerpt) > 255) $excerpt = cut_str($excerpt, 255);
|
||||
|
||||
$msg = "";
|
||||
// 두번씩 INSERT 되는것을 막기 위해
|
||||
if ($_POST[title])
|
||||
{
|
||||
$board = sql_fetch(" select bo_subject, bo_use_trackback from {$g4[board_table]} where bo_table = '{$bo_table}' ");
|
||||
if (!$board[bo_use_trackback])
|
||||
$msg = '트랙백 사용이 금지된 게시판입니다.';
|
||||
|
||||
if (!$msg)
|
||||
{
|
||||
$next_num = get_next_num($write_table);
|
||||
|
||||
$sql = " select max(wr_comment) as max_comment from {$write_table} where wr_parent = '{$wr_id}' and wr_is_comment = 1 ";
|
||||
$row = sql_fetch($sql);
|
||||
$row[max_comment] += 1;
|
||||
|
||||
$sql = " insert into {$g4[write_prefix]}{$bo_table}
|
||||
set wr_num = '{$next_num}',
|
||||
wr_parent = '{$wr_id}',
|
||||
wr_is_comment = 1,
|
||||
wr_comment = '{$row[max_comment]}',
|
||||
wr_content = '{$title}\n{$excerpt}',
|
||||
wr_trackback = '{$_POST[url]}',
|
||||
wr_name = '{$_POST[blog_name]}',
|
||||
wr_password = '".sql_password($g4[server_time])."',
|
||||
wr_datetime = '{$g4[time_ymdhis]}',
|
||||
wr_ip = '{$_SERVER[REMOTE_ADDR]}' ";
|
||||
$result = sql_query($sql, FALSE);
|
||||
if ($result)
|
||||
{
|
||||
$comment_id = mysql_insert_id();
|
||||
sql_query(" update {$write_table} set wr_comment = wr_comment + 1 where wr_id = '{$wr_id}' ", FALSE);
|
||||
sql_query(" insert into {$g4[board_new_table]} ( bo_table, wr_id, wr_parent, bn_datetime ) values ( '{$bo_table}', '{$comment_id}', '{$wr_id}', '{$g4[time_ymdhis]}' ) ");
|
||||
sql_query(" update {$g4[board_table]} set bo_count_comment = bo_count_comment + 1 where bo_table = '{$bo_table}' ", FALSE);
|
||||
} else
|
||||
$msg = "$write_table TABLE INSERT 오류";
|
||||
}
|
||||
|
||||
//write_log("$g4['path']/data/log/aaa", $msg);
|
||||
|
||||
if ($msg) // 비정상(오류)
|
||||
{
|
||||
echo tb_xml_msg(1, $msg);
|
||||
exit;
|
||||
}
|
||||
else // 정상
|
||||
{
|
||||
// 메일발송 사용
|
||||
if ($config[cf_email_use] && $board[bo_use_email])
|
||||
{
|
||||
include_once($g4['path'].'/lib/mailer.lib.php');
|
||||
|
||||
// 관리자의 정보를 얻고
|
||||
$super_admin = get_admin('super');
|
||||
$group_admin = get_admin('group');
|
||||
$board_admin = get_admin('board');
|
||||
|
||||
$wr_name = $blog_name = get_text(stripslashes($_POST[blog_name]));
|
||||
$wr_subject = $title = get_text(stripslashes($title));
|
||||
$wr_content = $excerpt = nl2br(get_text(stripslashes($excerpt)));
|
||||
|
||||
$link_url = 'http://'.$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI];
|
||||
|
||||
$subject = $board[bo_subject].' 게시판에 트랙백에 의한 글이 올라왔습니다.';
|
||||
|
||||
define("_GNUBOARD_", TRUE);
|
||||
ob_start();
|
||||
include_once ('./write_update_mail.php');
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
// 게시판 관리자에게 보내는 메일
|
||||
if ($config[cf_email_wr_board_admin])
|
||||
mailer($blog_name, '', $board_admin[mb_email], $subject, $content, 1);
|
||||
|
||||
// 그룹 관리자에게 보내는 메일
|
||||
if ($group_admin[mb_email] != $board_admin[mb_email])
|
||||
{
|
||||
if ($config[cf_email_wr_group_admin])
|
||||
mailer($blog_name, '', $group_admin[mb_email], $subject, $content, 1);
|
||||
}
|
||||
|
||||
// 최고관리자에게 보내는 메일
|
||||
if ($super_admin[mb_email] != $board_admin[mb_email])
|
||||
{
|
||||
if ($config[cf_email_wr_super_admin])
|
||||
mailer($blog_name, '', $super_admin[mb_email], $subject, $content, 1);
|
||||
}
|
||||
|
||||
// 답변 메일받기 (원게시자에게 보내는 메일)
|
||||
//if ($wr[wr_recv_email] && $wr[wr_email] && $wr[wr_email] != $admin[mb_email])
|
||||
if (strstr($wr[wr_option], 'mail') && $wr[wr_email] && $wr[wr_email] != $admin[mb_email])
|
||||
{
|
||||
if ($config[cf_email_wr_write])
|
||||
mailer($blog_name, "", $wr[wr_email], $subject, $content, 1);
|
||||
|
||||
// 코멘트 쓴 모든이에게 메일 발송
|
||||
if ($config[cf_email_wr_comment_all])
|
||||
{
|
||||
$sql = " select wr_email from {$write_table}
|
||||
where wr_email not in ( '{$admin[mb_email]}' , '{$wr[wr_email]}', '' )
|
||||
and wr_parent = '{$wr_id}'
|
||||
group by wr_email ";
|
||||
$result = sql_query($sql);
|
||||
while ($row=sql_fetch_array($result))
|
||||
mailer($blog_name, '', $row[wr_email], $subject, $content, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo tb_xml_msg(0, '');
|
||||
?>
|
||||
@ -1,37 +0,0 @@
|
||||
<?
|
||||
// 토큰 생성
|
||||
include_once('./_common.php');
|
||||
|
||||
// 오류는 write_log() 로 잡는다.
|
||||
include_once($g4['path'].'/lib/etc.lib.php');
|
||||
//write_log($g4['path'].'/lib/log/aaa', 1);
|
||||
|
||||
if (isset($g4['token_time']) == false)
|
||||
$g4['token_time'] = 3;
|
||||
|
||||
$sql = " delete from {$g4[token_table]}
|
||||
where to_datetime < '".date("Y-m-d", $g4[server_time] - 86400 * $g4['token_time'])."' ";
|
||||
sql_query($sql);
|
||||
|
||||
$sql = " select count(*) as cnt from {$g4[token_table]}
|
||||
where to_ip = '{$_SERVER[REMOTE_ADDR]}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row[cnt] >= 100)
|
||||
return;
|
||||
|
||||
$i=0;
|
||||
while(1) {
|
||||
$token = md5(uniqid(rand(), true));
|
||||
$sql = " insert into g4_token
|
||||
set to_token = '{$token}',
|
||||
to_datetime = '{$g4['time_ymdhis']}',
|
||||
to_ip = '{$_SERVER[REMOTE_ADDR]}' ";
|
||||
$result = sql_query($sql, FALSE);
|
||||
if ($result)
|
||||
break;
|
||||
// 무한루프방지
|
||||
if ($i++ >= 10)
|
||||
break;
|
||||
}
|
||||
echo $token;
|
||||
?>
|
||||
@ -126,14 +126,6 @@ if (strstr($sfl, 'content'))
|
||||
//$view['rich_content'] = preg_replace("/{img\:([0-9]+)[:]?([^}]*)}/ie", "view_image(\$view, '\\1', '\\2')", $view['content']);
|
||||
$view['rich_content'] = preg_replace("/{이미지\:([0-9]+)[:]?([^}]*)}/ie", "view_image(\$view, '\\1', '\\2')", $view['content']);
|
||||
|
||||
// 트랙백
|
||||
$trackback_url = '';
|
||||
if ($member['mb_level'] >= $board['bo_trackback_level']) {
|
||||
if (isset($g4['token_time']) == false)
|
||||
$g4['token_time'] = 3;
|
||||
$trackback_url = $g4['url'].'/'.$g4['bbs'].'/tb.php/'.$bo_table.'/'.$wr_id;
|
||||
}
|
||||
|
||||
$is_signature = false;
|
||||
$signature = '';
|
||||
if ($board['bo_use_signature'] && $view['mb_id']) {
|
||||
|
||||
@ -45,7 +45,6 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
$list[$i]['content'] = search_font($stx, $list[$i]['content']);
|
||||
}
|
||||
|
||||
$list[$i]['trackback'] = url_auto_link($row['wr_trackback']);
|
||||
$list[$i]['datetime'] = substr($row['wr_datetime'],2,14);
|
||||
|
||||
// 관리자가 아니라면 중간 IP 주소를 감춘후 보여줍니다.
|
||||
|
||||
@ -253,12 +253,6 @@ if ($board['bo_use_file_content']) {
|
||||
$is_file_content = true;
|
||||
}
|
||||
|
||||
// 트랙백
|
||||
$is_trackback = false;
|
||||
if ($board['bo_use_trackback'] && $member['mb_level'] >= $board['bo_trackback_level']) {
|
||||
$is_trackback = true;
|
||||
}
|
||||
|
||||
$name = "";
|
||||
$email = "";
|
||||
$homepage = "";
|
||||
@ -275,7 +269,6 @@ if ($w == "" || $w == "r") {
|
||||
$html_checked = "";
|
||||
$html_value = "";
|
||||
$secret_checked = "";
|
||||
$trackback = "";
|
||||
|
||||
if ($w == '') {
|
||||
$password_required = 'required';
|
||||
@ -299,8 +292,6 @@ if ($w == '') {
|
||||
$link[$i] = $write['wr_link'.$i];
|
||||
}
|
||||
|
||||
$trackback = $write['wr_trackback'];
|
||||
|
||||
if (strstr($write['wr_option'], 'html1')) {
|
||||
$html_checked = 'checked';
|
||||
$html_value = 'html1';
|
||||
|
||||
@ -11,8 +11,6 @@ if (substr_count($wr_content, '&#') > 50) {
|
||||
|
||||
@include_once($board_skin_path.'/write_update.head.skin.php');
|
||||
|
||||
include_once($g4['path'].'/lib/trackback.lib.php');
|
||||
|
||||
$upload_max_filesize = ini_get('upload_max_filesize');
|
||||
|
||||
if (empty($_POST))
|
||||
@ -291,7 +289,6 @@ if ($w == '' || $w == 'r')
|
||||
wr_link2 = '{$wr_link2}',
|
||||
wr_link1_hit = 0,
|
||||
wr_link2_hit = 0,
|
||||
wr_trackback = '{$wr_trackback}',
|
||||
wr_hit = 0,
|
||||
wr_good = 0,
|
||||
wr_nogood = 0,
|
||||
@ -595,18 +592,6 @@ if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_emai
|
||||
// 사용자 코드 실행
|
||||
@include_once ($board_skin_path.'/write_update.skin.php');
|
||||
|
||||
// 트랙백 주소가 있다면
|
||||
if (($w != 'u' && $wr_trackback) || ($w=='u' && $wr_trackback && $re_trackback))
|
||||
{
|
||||
$trackback_url = $g4['url'].'/'.$g4['bbs'].'/tb.php/'.$bo_table.'/'.$wr_id;
|
||||
$msg = "";
|
||||
$msg = send_trackback($wr_trackback, $trackback_url, $wr_subject, $board['bo_subject'], $_POST['wr_content']);
|
||||
if ($msg) {
|
||||
echo '<meta http-equiv="content-type" content="text/html; charset='.$g4['charset'].'">'.PHP_EOL;
|
||||
echo '<script>alert('.$msg.' '.$wr_trackback.');</script>';
|
||||
}
|
||||
}
|
||||
|
||||
@include_once($board_skin_path.'/write_update.tail.skin.php');
|
||||
if ($g4['https_url'])
|
||||
$https_url = $g4['url'].'/'.$g4['bbs'];
|
||||
|
||||
19
js/ajax.js
19
js/ajax.js
@ -20,22 +20,3 @@ function create_request() {
|
||||
else
|
||||
return request;
|
||||
}
|
||||
|
||||
// 트랙백을 사용한다면 토큰을 실시간으로 생성
|
||||
var trackback_url = "";
|
||||
function trackback_send_server(url) {
|
||||
req = create_request();
|
||||
trackback_url = url;
|
||||
req.onreadystatechange = function() {
|
||||
if (req.readyState == 4) {
|
||||
if (req.status == 200) {
|
||||
var token = req.responseText;
|
||||
prompt("아래 주소를 복사하세요. 이 주소는 스팸을 막기 위하여 한번만 사용 가능합니다.", trackback_url+"/"+token);
|
||||
trackback_url = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
req.open("POST", g4_path+'/'+g4_bbs+'/'+'tb_token.php', true);
|
||||
//req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||
req.send(null);
|
||||
}
|
||||
|
||||
@ -1,77 +0,0 @@
|
||||
<?
|
||||
if (!defined('_GNUBOARD_')) exit;
|
||||
|
||||
/////////////////////////////////////////
|
||||
// //
|
||||
// mics'php - Trackback Sender //
|
||||
// //
|
||||
// COPYLEFT (c) by micsland.com //
|
||||
// //
|
||||
// MODIFIED (c) by sir.co.kr //
|
||||
// //
|
||||
/////////////////////////////////////////
|
||||
|
||||
// return 값이 있으면 오류, 없으면 정상
|
||||
function send_trackback($tb_url, $url, $title, $blog_name, $excerpt)
|
||||
{
|
||||
/*
|
||||
// allow_url_fopen = Off 일 경우 트랙백 사용할 수 없었던 오류를 수정
|
||||
// allow_url_fopen = On 일 경우에만 사용 가능
|
||||
//주소가 유효한지 검사
|
||||
$p_fp = fopen($tb_url,"r");
|
||||
if($p_fp)
|
||||
@fclose($p_fp);
|
||||
else
|
||||
return "트랙백 URL이 존재하지 않습니다.";
|
||||
*/
|
||||
|
||||
//내용 정리
|
||||
$title = strip_tags($title);
|
||||
$excerpt = strip_tags($excerpt);
|
||||
|
||||
$tmp_data = "url=".rawurlencode($url)."&title=".rawurlencode($title)."&blog_name=".rawurlencode($blog_name)."&excerpt=".rawurlencode($excerpt);
|
||||
|
||||
//주소 처리
|
||||
$uinfo = parse_url($tb_url);
|
||||
if($uinfo['query']) $tmp_data .= "&".$uinfo['query'];
|
||||
if(!$uinfo['port']) $uinfo['port'] = "80";
|
||||
|
||||
//최종 전송 자료
|
||||
$send_str = 'POST '.$uinfo['path'].' HTTP/1.1\r\n'.
|
||||
'Host: '.$uinfo['host'].'\r\n'.
|
||||
'User-Agent: GNUBOARD\r\n'.
|
||||
'Content-Type: application/x-www-form-urlencoded\r\n'.
|
||||
'Content-length: ".strlen($tmp_data)."\r\n'.
|
||||
'Connection: close\r\n\r\n'.
|
||||
$tmp_data;
|
||||
$fp = @fsockopen($uinfo['host'],$uinfo['port']);
|
||||
if(!$fp)
|
||||
return '트랙백 URL이 존재하지 않습니다.';
|
||||
|
||||
//전송
|
||||
//$fp = fsockopen($uinfo[host],$uinfo[port]);
|
||||
fputs($fp,$send_str);
|
||||
|
||||
//응답 받음
|
||||
while(!feof($fp)) $response .= fgets($fp,128);
|
||||
fclose($fp);
|
||||
|
||||
//트랙백 URL인지 확인
|
||||
if(!strstr($response,'<response>'))
|
||||
return '올바른 트랙백 URL이 아닙니다.';
|
||||
|
||||
//XML 부분만 뽑음
|
||||
$response = strchr($response,'<?');
|
||||
$response = substr($response,0,strpos($response,'</response>'));
|
||||
|
||||
//에러 검사
|
||||
if(strstr($response,'<error>0</error>'))
|
||||
return '';
|
||||
else {
|
||||
$tb_error_str = strchr($response,'<message>');
|
||||
$tb_error_str = substr($tb_error_str,0,strpos($tb_error_str,'</message>'));
|
||||
$tb_error_str = str_replace('<message>','',$tb_error_str);
|
||||
return '트랙백 전송중 오류가 발생했습니다: '.$tb_error_str;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -45,7 +45,6 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
</td>
|
||||
<td align="right" style="padding:6px 6px 0 0;" width=120>
|
||||
<? if ($scrap_href) { echo "<a href=\"javascript:;\" onclick=\"win_scrap('$scrap_href');\"><img src='$board_skin_path/img/btn_scrap.gif' border='0' align='absmiddle'></a> "; } ?>
|
||||
<? if ($trackback_url) { ?><a href="javascript:trackback_send_server('<?=$trackback_url?>');" style="letter-spacing:0;" title='주소 복사'><img src="<?=$board_skin_path?>/img/btn_trackback.gif" border='0' align="absmiddle"></a><?}?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -58,7 +58,6 @@ for ($i=0; $i<count($list); $i++) {
|
||||
echo $str;
|
||||
?>
|
||||
</div>
|
||||
<? if ($list[$i]['trackback']) { echo "<p>".$list[$i]['trackback']."</p>"; } ?>
|
||||
<span id='edit_<?=$comment_id?>' style='display:none;'></span><!-- 수정 -->
|
||||
<span id='reply_<?=$comment_id?>' style='display:none;'></span><!-- 답변 -->
|
||||
</div>
|
||||
|
||||
@ -225,15 +225,6 @@ if ($option) {
|
||||
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
|
||||
<? } ?>
|
||||
|
||||
<? if ($is_trackback) { ?>
|
||||
<tr>
|
||||
<td class=write_head>트랙백주소</td>
|
||||
<td><input class='ed' size=50 name=wr_trackback itemname="트랙백" value="<?=$trackback?>">
|
||||
<? if ($w=='u') { ?><input type=checkbox name="re_trackback" value="1">핑 보냄<? } ?></td>
|
||||
</tr>
|
||||
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
|
||||
<? } ?>
|
||||
|
||||
<? if ($is_guest) { ?>
|
||||
<tr>
|
||||
<td class=write_head><img id='kcaptcha_image' /></td>
|
||||
|
||||
@ -133,10 +133,9 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
<? if ($is_signature) { ?><p><?=$signature?></p><? } ?>
|
||||
|
||||
<? if ($scrap_href || $trackback_url || $good_href || $nogood_href) { ?>
|
||||
<? if ($scrap_href || $good_href || $nogood_href) { ?>
|
||||
<ul>
|
||||
<? if ($scrap_href) { ?><li><a href="javascript:;" onclick="win_scrap('<?=$scrap_href?>');">스크랩</a></li><? } ?>
|
||||
<? if ($trackback_url) { ?><li><a href="javascript:trackback_send_server('<?=$trackback_url?>');">트랙백주소</a></li><?}?>
|
||||
<? if ($good_href) {?><li>추천 <?=number_format($view['wr_good'])?> <a href="<?=$good_href?>" target="hiddenframe">추천</a></li><? } ?>
|
||||
<? if ($nogood_href) {?><li>비추천 <?=number_format($view['wr_nogood'])?> <a href="<?=$nogood_href?>" target="hiddenframe">비추천</a></li><? } ?>
|
||||
</ul>
|
||||
|
||||
@ -45,9 +45,6 @@ var char_max = parseInt(<?=$comment_max?>); // 최대
|
||||
<!-- 댓글 출력 -->
|
||||
<p><?=$str?></p>
|
||||
|
||||
<? if ($list[$i]['trackback']) { ?>
|
||||
<p><?=$list[$i]['trackback']?></p>
|
||||
<? } ?>
|
||||
<span id="edit_<?=$comment_id?>"></span><!-- 수정 -->
|
||||
<span id="reply_<?=$comment_id?>"></span><!-- 답변 -->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user