양

트랙백의 기능에 대한 이해와 추가기능

· 2006-12-08 (금) 02:40:35 · 2192
트랙백에 대한 기능을 잘 모르시는 초보분들을 위해서 글을 남기며 추가 기능을
넣고자 합니다.
게시글에 있는 트랙백 주소를 복사한 후
내가 새글을 입력할 때 복사한 트랙백 주소를 입력한 후 글을 입력하면
트랙백 주소를 복사했던 글에 코멘트가 기록 되고 나의 글이 링크 됩니다.
주소를 복사한 게시글에 나의 글을 홍보하는 것 경우가 되는 것 같더군요
그래서 내가 쓴 글에도 트랙백 주소를 복사한 글을 소개가 같이 될 수 있도록
수정해 보았습니다.

write_update.skin.php파일에 아래의 내용을 삽입하면 됩니다.

if ($re_trackback) {
$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 $g4[write_prefix]$bo_table
where wr_parent = '$wr_id' and wr_is_comment = 1 ";
$row = sql_fetch($sql);
$row[max_comment] += 1;


$arr2 = explode("/", $wr_trackback);
$bo2 = $arr2[5];
$wr2 = $arr2[6];

$sql4 = " select * from $g4[write_prefix]{$bo2}
where wr_parent = '$wr2' and wr_is_comment = 0 ";
$row4 = sql_fetch($sql4);

$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 = '$row4[wr_subject]\n$row4[wr_content]',
wr_trackback = '$wr_trackback',
wr_name = '$row4[wr_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 $g4[write_prefix]$bo_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 = "$g4[write_prefix]$bo_table TABLE INSERT 오류";

}
}

도움이 되시길 바랍니다..^^
|
댓글을 작성하시려면 로그인이 필요합니다.

그누4 플러그인

3,524건

그누보드에는 여러가지 기능 추가가 쉽도록 제작 되었습니다. 플러그인의 저작권은 해당 플러그인 제작자님께 있으며, 그누보드의 저작권과 다를 수 있습니다. 플러그인 다운로드시 좋아요와 감사의 코멘트를 남기시면 제작자에게 큰 힘이됩니다. ^^y

+
제목 글쓴이 날짜 조회
06-12-20 조회 2,659
06-12-20 조회 2,443
06-12-17 조회 2,170
06-12-16 조회 2,371
06-12-15 조회 3,643
06-12-14 조회 3,995
06-12-14 조회 3,301
06-12-09 조회 2,739
06-12-08 조회 2,193
06-12-05 조회 2,518
06-12-03 조회 2,876
06-11-30 조회 2,533
06-11-30 조회 2,679
06-11-29 조회 2,639
06-11-21 조회 2,079