From aee36ec5e7778864502343adfb07711e24d07e57 Mon Sep 17 00:00:00 2001 From: chicpro Date: Wed, 16 Jan 2013 14:53:56 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=9E=A9=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=EC=97=90=20=EA=B2=B8=EC=86=90=ED=95=9C=20JS=20?= =?UTF-8?q?=EC=9E=91=EC=97=85=20=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/scrap.php | 50 ++++++++--------- bbs/scrap_popin.php | 27 ++++++--- bbs/scrap_popin_update.php | 83 +++++++++++++++------------- skin/board/neo/view.skin.php | 2 +- skin/member/neo/scrap.skin.php | 30 ++++++---- skin/member/neo/scrap_popin.skin.php | 7 +-- 6 files changed, 112 insertions(+), 87 deletions(-) diff --git a/bbs/scrap.php b/bbs/scrap.php index d8fa04e8b..4fc239807 100644 --- a/bbs/scrap.php +++ b/bbs/scrap.php @@ -1,34 +1,34 @@ @@ -11,6 +11,10 @@ if (!$member[mb_id]) { opener.location.href = '$href'; window.close(); + HEREDOC; exit; } @@ -24,27 +28,32 @@ echo << HEREDOC; -if ($write[wr_is_comment]) +if ($write['wr_is_comment']) alert_close('코멘트는 스크랩 할 수 없습니다.'); -$sql = " select count(*) as cnt from {$g4[scrap_table]} - where mb_id = '{$member[mb_id]}' - and bo_table = '{$bo_table}' - and wr_id = '{$wr_id}' "; +$sql = " select count(*) as cnt from {$g4['scrap_table']} + where mb_id = '{$member['mb_id']}' + and bo_table = '$bo_table' + and wr_id = '$wr_id' "; $row = sql_fetch($sql); -if ($row[cnt]) { +if ($row['cnt']) { echo << - if (confirm('이미 스크랩하신 글 입니다.'.PHP_EOL.PHP_EOL.'지금 스크랩을 확인하시겠습니까?')) + if (confirm('이미 스크랩하신 글 입니다.\\n\\n지금 스크랩을 확인하시겠습니까?')) document.location.href = './scrap.php'; else window.close(); + HEREDOC; exit; } -$member_skin_path = $g4['path'].'/skin/member/'.$config[cf_member_skin]; +$member_skin_path = $g4['path'].'/skin/member/'.$config['cf_member_skin']; include_once($member_skin_path.'/scrap_popin.skin.php'); include_once($g4['path'].'/tail.sub.php'); diff --git a/bbs/scrap_popin_update.php b/bbs/scrap_popin_update.php index 9953cfb05..7346de0ec 100644 --- a/bbs/scrap_popin_update.php +++ b/bbs/scrap_popin_update.php @@ -3,93 +3,102 @@ include_once('./_common.php'); include_once($g4['path'].'/head.sub.php'); -if (!$member[mb_id]) +if (!$is_member) { $href = './login.php?'.$qstr.'&url='.urlencode('./board.php?bo_table='.$bo_table.'&wr_id='.$wr_id); echo ''; exit; } -$sql = " select count(*) as cnt from $g4[scrap_table] - where mb_id = '$member[mb_id]' +$sql = " select count(*) as cnt from {$g4['scrap_table']} + where mb_id = '{$member['mb_id']}' and bo_table = '$bo_table' and wr_id = '$wr_id' "; $row = sql_fetch($sql); -if ($row[cnt]) +if ($row['cnt']) { echo ' - '; + + '; exit; } // 덧글이 넘어오고 코멘트를 쓸 권한이 있다면 -if ($wr_content && ($member[mb_level] >= $board[bo_comment_level])) +if ($wr_content && ($member['mb_level'] >= $board['bo_comment_level'])) { $wr = get_write($write_table, $wr_id); // 원글이 존재한다면 - if ($wr[wr_id]) + if ($wr['wr_id']) { - $mb_id = $member[mb_id]; - $wr_name = $member[mb_nick]; - $wr_password = $member[mb_password]; - $wr_email = $member[mb_email]; - $wr_homepage = $member[mb_homepage]; + $mb_id = $member['mb_id']; + $wr_name = $member['mb_nick']; + $wr_password = $member['mb_password']; + $wr_email = $member['mb_email']; + $wr_homepage = $member['mb_homepage']; - $sql = " select max(wr_comment) as max_comment from {$write_table} - where wr_parent = '{$wr_id}' and wr_is_comment = 1 "; + $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; + $row['max_comment'] += 1; $sql = " insert into $write_table - set ca_name = '{$wr[ca_name]}', + set ca_name = '{$wr['ca_name']}', wr_option = '', - wr_num = '{$wr[wr_num]}', + wr_num = '{$wr['wr_num']}', wr_reply = '', - wr_parent = '{$wr_id}', - wr_is_comment = 1, - wr_comment = '{$row[max_comment]}', - wr_content = '{$wr_content}', - mb_id = '{$mb_id}', - wr_password = '{$wr_password}', - wr_name = '{$wr_name}', - wr_email = '{$wr_email}', - wr_homepage = '{$wr_homepage}', - wr_datetime = '{$g4[time_ymdhis]}', - wr_ip = '{$_SERVER[REMOTE_ADDR]}' "; + wr_parent = '$wr_id', + wr_is_comment = '1', + wr_comment = '{$row['max_comment']}', + wr_content = '$wr_content', + mb_id = '$mb_id', + wr_password = '$wr_password', + wr_name = '$wr_name', + wr_email = '$wr_email', + wr_homepage = '$wr_homepage', + wr_datetime = '{$g4['time_ymdhis']}', + wr_ip = '{$_SERVER['REMOTE_ADDR']}' "; sql_query($sql); $comment_id = mysql_insert_id(); // 원글에 코멘트수 증가 - sql_query(" update {$write_table} set wr_comment = wr_comment + 1 where wr_id = '{$wr_id}' "); + sql_query(" update $write_table set wr_comment = wr_comment + 1 where wr_id = '$wr_id' "); // 새글 INSERT //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(" 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]}' ) "); + 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']}' ) "); // 코멘트 1 증가 - sql_query(" update {$g4[board_table]} set bo_count_comment = bo_count_comment + 1 where bo_table = '{$bo_table}' "); + sql_query(" update {$g4['board_table']} set bo_count_comment = bo_count_comment + 1 where bo_table = '$bo_table' "); // 포인트 부여 - insert_point($member[mb_id], $board[bo_comment_point], '{$board[bo_subject]} {$wr_id}-{$comment_id} 코멘트쓰기', $bo_table, $comment_id, '코멘트'); + insert_point($member['mb_id'], $board['bo_comment_point'], "{$board['bo_subject']} {$wr_id}-{$comment_id} 코멘트쓰기", $bo_table, $comment_id, '코멘트'); } } -$sql = " insert into {$g4[scrap_table]} ( mb_id, bo_table, wr_id, ms_datetime ) - values ( '{$member[mb_id]}', '{$bo_table}', '{$wr_id}', '{$g4[time_ymdhis]}' ) "; +$sql = " insert into {$g4['scrap_table']} ( mb_id, bo_table, wr_id, ms_datetime ) + values ( '{$member['mb_id']}', '$bo_table', '$wr_id', '{$g4['time_ymdhis']}' ) "; sql_query($sql); echo << - if (confirm('이 글을 스크랩 하였습니다.'.PHP_EOL.PHP_EOL.'지금 스크랩을 확인하시겠습니까?')) + if (confirm('이 글을 스크랩 하였습니다.'."\n\n".'지금 스크랩을 확인하시겠습니까?')) document.location.href = './scrap.php'; else window.close(); + HEREDOC; ?> diff --git a/skin/board/neo/view.skin.php b/skin/board/neo/view.skin.php index 4a28d0d16..c45d3ebbf 100644 --- a/skin/board/neo/view.skin.php +++ b/skin/board/neo/view.skin.php @@ -120,7 +120,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 diff --git a/skin/member/neo/scrap.skin.php b/skin/member/neo/scrap.skin.php index b8c665d41..4abdc1e9e 100644 --- a/skin/member/neo/scrap.skin.php +++ b/skin/member/neo/scrap.skin.php @@ -1,5 +1,5 @@
@@ -19,11 +19,11 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 - - - - - 삭제 + + + + + 삭제 @@ -32,10 +32,18 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
- +
-
- 창닫기 -
-
\ No newline at end of file +
+ + + \ No newline at end of file diff --git a/skin/member/neo/scrap_popin.skin.php b/skin/member/neo/scrap_popin.skin.php index 20ced3830..662b48735 100644 --- a/skin/member/neo/scrap_popin.skin.php +++ b/skin/member/neo/scrap_popin.skin.php @@ -1,5 +1,5 @@
@@ -14,7 +14,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 제목 - + @@ -23,8 +23,6 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 - -

스크랩을 하시면서 감사 혹은 격려의 댓글을 남기실 수 있습니다.

@@ -32,4 +30,5 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
+
\ No newline at end of file