From dc3d5e53801bbefd544886c324f031fc81e0723a Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 8 Mar 2013 11:18:46 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=EC=B6=94=EC=B2=9C,=20=EB=B9=84=EC=B6=94?= =?UTF-8?q?=EC=B2=9C=20ajax=20=EB=B0=A9=EC=8B=9D=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/good.php | 195 ++++++++++++++++++++++--------- skin/board/basic/view.skin.php | 34 +++++- skin/board/gallery/view.skin.php | 34 +++++- 3 files changed, 203 insertions(+), 60 deletions(-) diff --git a/bbs/good.php b/bbs/good.php index ba3ab55f1..a27c8dac9 100644 --- a/bbs/good.php +++ b/bbs/good.php @@ -3,69 +3,152 @@ include_once('./_common.php'); @include_once($board_skin_path.'/good.head.skin.php'); -echo ''; +// 자바스크립트 사용가능할 때 +if($_POST['js'] == "on") { + $error = $count = ""; -if (!$is_member) -{ - $href = './login.php?$qstr&url='.urlencode('./board.php?bo_table='.$bo_table.'&wr_id='.$wr_id); - - echo ''; - exit; -} - -if (!($bo_table && $wr_id)) - alert_close('값이 제대로 넘어오지 않았습니다.'); - -$ss_name = 'ss_view_'.$bo_table.'_'.$wr_id; -if (!get_session($ss_name)) - alert_close('해당 게시물에서만 추천 또는 비추천 하실 수 있습니다.'); - -$row = sql_fetch(" select count(*) as cnt from {$g4[write_prefix]}{$bo_table} ", FALSE); -if (!$row[cnt]) - alert_close('존재하는 게시판이 아닙니다.'); - -if ($good == 'good' || $good == 'nogood') -{ - if($write[mb_id] == $member[mb_id]) - alert_close('자신의 글에는 추천 또는 비추천 하실 수 없습니다.'); - - if (!$board[bo_use_good] && $good == 'good') - alert_close('이 게시판은 추천 기능을 사용하지 않습니다.'); - - if (!$board[bo_use_nogood] && $good == 'nogood') - alert_close('이 게시판은 비추천 기능을 사용하지 않습니다.'); - - $sql = " select bg_flag from {$g4[board_good_table]} - where bo_table = '{$bo_table}' - and wr_id = '{$wr_id}' - and mb_id = '{$member[mb_id]}' - and bg_flag in ('good', 'nogood') "; - $row = sql_fetch($sql); - if ($row[bg_flag]) + function print_result($error, $count) { - if ($row[bg_flag] == 'good') - $status = '추천'; - else - $status = '비추천'; - - echo ''; + echo '{ "error": "' . $error . '", "count": "' . $count . '" }'; + exit; } - else + + if (!$is_member) { - // 추천(찬성), 비추천(반대) 카운트 증가 - sql_query(" update {$g4[write_prefix]}{$bo_table} set wr_{$good} = wr_{$good} + 1 where wr_id = '{$wr_id}' "); - // 내역 생성 - sql_query(" insert {$g4[board_good_table]} set bo_table = '{$bo_table}', wr_id = '{$wr_id}', mb_id = '{$member[mb_id]}', bg_flag = '{$good}', bg_datetime = '".G4_TIME_YMDHIS."' "); + $error = '회원만 가능합니다.'; + print_result($error, $count); + } - if ($good == 'good') - $status = '추천'; - else - $status = '비추천'; + if (!($bo_table && $wr_id)) { + $error = '값이 제대로 넘어오지 않았습니다.'; + print_result($error, $count); + } - echo ''; + $ss_name = 'ss_view_'.$bo_table.'_'.$wr_id; + if (!get_session($ss_name)) { + $error = '해당 게시물에서만 추천 또는 비추천 하실 수 있습니다.'; + print_result($error, $count); + } + + $row = sql_fetch(" select count(*) as cnt from {$g4['write_prefix']}{$bo_table} ", FALSE); + if (!$row['cnt']) { + $error = '존재하는 게시판이 아닙니다.'; + print_result($error, $count); + } + + if ($good == 'good' || $good == 'nogood') + { + if($write['mb_id'] == $member['mb_id']) { + $error = '자신의 글에는 추천 또는 비추천 하실 수 없습니다.'; + print_result($error, $count); + } + + if (!$board['bo_use_good'] && $good == 'good') { + $error = '이 게시판은 추천 기능을 사용하지 않습니다.'; + print_result($error, $count); + } + + if (!$board['bo_use_nogood'] && $good == 'nogood') { + $error = '이 게시판은 비추천 기능을 사용하지 않습니다.'; + print_result($error, $count); + } + + $sql = " select bg_flag from {$g4['board_good_table']} + where bo_table = '{$bo_table}' + and wr_id = '{$wr_id}' + and mb_id = '{$member['mb_id']}' + and bg_flag in ('good', 'nogood') "; + $row = sql_fetch($sql); + if ($row['bg_flag']) + { + if ($row['bg_flag'] == 'good') + $status = '추천'; + else + $status = '비추천'; + + $error = "이미 $status 하신 글 입니다."; + print_result($error, $count); + } + else + { + // 추천(찬성), 비추천(반대) 카운트 증가 + sql_query(" update {$g4['write_prefix']}{$bo_table} set wr_{$good} = wr_{$good} + 1 where wr_id = '{$wr_id}' "); + // 내역 생성 + sql_query(" insert {$g4['board_good_table']} set bo_table = '{$bo_table}', wr_id = '{$wr_id}', mb_id = '{$member['mb_id']}', bg_flag = '{$good}', bg_datetime = '".G4_TIME_YMDHIS."' "); + + $sql = " select wr_{$good} as count from {$g4['write_prefix']}{$bo_table} where wr_id = '$wr_id' "; + $row = sql_fetch($sql); + + $count = $row['count']; + + print_result($error, $count); + } + } +} else { + include_once(G4_PATH.'/head.sub.php'); + + if (!$is_member) + { + $href = './login.php?$qstr&url='.urlencode('./board.php?bo_table='.$bo_table.'&wr_id='.$wr_id); + + alert('회원만 가능합니다.', $href); + } + + if (!($bo_table && $wr_id)) + alert('값이 제대로 넘어오지 않았습니다.'); + + $ss_name = 'ss_view_'.$bo_table.'_'.$wr_id; + if (!get_session($ss_name)) + alert('해당 게시물에서만 추천 또는 비추천 하실 수 있습니다.'); + + $row = sql_fetch(" select count(*) as cnt from {$g4['write_prefix']}{$bo_table} ", FALSE); + if (!$row['cnt']) + alert('존재하는 게시판이 아닙니다.'); + + if ($good == 'good' || $good == 'nogood') + { + if($write['mb_id'] == $member['mb_id']) + alert('자신의 글에는 추천 또는 비추천 하실 수 없습니다.'); + + if (!$board['bo_use_good'] && $good == 'good') + alert('이 게시판은 추천 기능을 사용하지 않습니다.'); + + if (!$board['bo_use_nogood'] && $good == 'nogood') + alert('이 게시판은 비추천 기능을 사용하지 않습니다.'); + + $sql = " select bg_flag from {$g4['board_good_table']} + where bo_table = '{$bo_table}' + and wr_id = '{$wr_id}' + and mb_id = '{$member['mb_id']}' + and bg_flag in ('good', 'nogood') "; + $row = sql_fetch($sql); + if ($row['bg_flag']) + { + if ($row['bg_flag'] == 'good') + $status = '추천'; + else + $status = '비추천'; + + alert("이미 $status 하신 글 입니다."); + } + else + { + // 추천(찬성), 비추천(반대) 카운트 증가 + sql_query(" update {$g4['write_prefix']}{$bo_table} set wr_{$good} = wr_{$good} + 1 where wr_id = '{$wr_id}' "); + // 내역 생성 + sql_query(" insert {$g4['board_good_table']} set bo_table = '{$bo_table}', wr_id = '{$wr_id}', mb_id = '{$member['mb_id']}', bg_flag = '{$good}', bg_datetime = '".G4_TIME_YMDHIS."' "); + + if ($good == 'good') + $status = '추천'; + else + $status = '비추천'; + + $href = './board.php?bo_table='.$bo_table.'&wr_id='.$wr_id; + + alert("이 글을 $status 하셨습니다.", '', false); + } } } @include_once($board_skin_path.'/good.tail.skin.php'); -?> - \ No newline at end of file +?> \ No newline at end of file diff --git a/skin/board/basic/view.skin.php b/skin/board/basic/view.skin.php index 79ac40243..d841819c4 100644 --- a/skin/board/basic/view.skin.php +++ b/skin/board/basic/view.skin.php @@ -144,8 +144,8 @@ include_once(G4_LIB_PATH.'/thumbnail.lib.php');
스크랩 - 추천 - 비추천 + 추천 + 비추천
\ No newline at end of file diff --git a/skin/board/gallery/view.skin.php b/skin/board/gallery/view.skin.php index 79ac40243..d841819c4 100644 --- a/skin/board/gallery/view.skin.php +++ b/skin/board/gallery/view.skin.php @@ -144,8 +144,8 @@ include_once(G4_LIB_PATH.'/thumbnail.lib.php');
스크랩 - 추천 - 비추천 + 추천 + 비추천
\ No newline at end of file From 73f3c4a8ad18b64d8010729c7dc8730d2fe74529 Mon Sep 17 00:00:00 2001 From: whitedot Date: Fri, 8 Mar 2013 11:24:28 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90:=20=EA=B2=8C?= =?UTF-8?q?=EC=8B=9C=ED=8C=90=EC=8A=A4=ED=82=A8=20=EC=B6=94=EC=B2=9C=20?= =?UTF-8?q?=EB=B9=84=EC=B6=94=EC=B2=9C=20ajax=20=EC=B2=98=EB=A6=AC=20?= =?UTF-8?q?=EC=A4=80=EB=B9=84=20=EB=A7=88=ED=81=AC=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skin/board/basic/view.skin.php | 10 ++++++++-- skin/board/gallery/view.skin.php | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/skin/board/basic/view.skin.php b/skin/board/basic/view.skin.php index 79ac40243..9d0c5a283 100644 --- a/skin/board/basic/view.skin.php +++ b/skin/board/basic/view.skin.php @@ -144,8 +144,14 @@ include_once(G4_LIB_PATH.'/thumbnail.lib.php'); Date: Fri, 8 Mar 2013 11:39:21 +0900 Subject: [PATCH 3/5] =?UTF-8?q?.gitignore=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- test.php | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index f14f4f40b..9d3c29cd1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ data config.php test* sirgle -caption_sr_test.php +sr_* diff --git a/test.php b/test.php index 5b901a2ab..b8b529015 100644 --- a/test.php +++ b/test.php @@ -1,15 +1,22 @@ - + - - + +AJAX 동적 컨텐츠 테스트 + -
깊은 산 속 옹달샘 누가 와서 먹나요
+클릭 +
+ + \ No newline at end of file From 7fe1b31a768bc220d4cf40eb13a785c6a336d766 Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 8 Mar 2013 12:00:19 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=EC=B6=94=EC=B2=9C,=20=EB=B9=84=EC=B6=94?= =?UTF-8?q?=EC=B2=9C=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20=EB=A8=B8=EC=A7=80?= =?UTF-8?q?=20=EC=B6=A9=EB=8F=8C=20=EC=BB=A4=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/board_copy.php | 7 - adm/board_copy_update.php | 158 +++++++++--------- adm/board_form.php | 4 +- adm/board_form_update.php | 11 +- adm/config_form.php | 2 +- bbs/formmail_send.php | 2 +- bbs/gcaptcha/gcaptcha.js | 2 +- bbs/gcaptcha/gcaptcha.lib.php | 8 +- bbs/memo_form_update.php | 2 +- bbs/password_lost2.php | 4 +- bbs/poll_update.php | 7 - bbs/register_form_update.php | 2 +- bbs/register_form_update_mail2.php | 2 +- bbs/write_comment_update.php | 2 +- bbs/write_update.php | 2 +- css/default.css | 2 +- install/gnuboard4s.sql | 1 - install/index.php | 2 +- install/install.inc.php | 11 +- install/install_config.php | 11 +- install/install_db.php | 77 +++++---- mobile/skin/board/basic/view_comment.skin.php | 2 +- .../skin/board/gallery/view_comment.skin.php | 2 +- skin/board/basic/view.skin.php | 37 ++-- skin/board/basic/view_comment.skin.php | 2 +- skin/board/gallery/view.skin.php | 35 ++-- skin/board/gallery/view_comment.skin.php | 2 +- 27 files changed, 219 insertions(+), 180 deletions(-) diff --git a/adm/board_copy.php b/adm/board_copy.php index 645a6ff57..a41648e88 100644 --- a/adm/board_copy.php +++ b/adm/board_copy.php @@ -1,7 +1,6 @@ 구조와 데이터 - - 자동등록방지 - - @@ -63,8 +58,6 @@ function fboardcopy_check(f) return false; } - - return true; } diff --git a/adm/board_copy_update.php b/adm/board_copy_update.php index ea39c49e5..b153dba7d 100644 --- a/adm/board_copy_update.php +++ b/adm/board_copy_update.php @@ -1,14 +1,9 @@ - + diff --git a/adm/board_form_update.php b/adm/board_form_update.php index f5ac45e21..0d2e5cf81 100644 --- a/adm/board_form_update.php +++ b/adm/board_form_update.php @@ -173,16 +173,23 @@ if ($w == '') { $bo_count_comment = $row['cnt']; // 글수 조정 + /* + 엔피씨님의 팁으로 교체합니다. 130308 + http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=27207 + */ if (isset($_POST['proc_count'])) { // 원글을 얻습니다. - $sql = " select wr_id from {$g4['write_prefix']}{$bo_table} where wr_is_comment = 0 "; + //$sql = " select wr_id from {$g4['write_prefix']}{$bo_table} where wr_is_comment = 0 "; + $sql = " select a.wr_id, (count(b.wr_parent) - 1) as cnt from {$g4['write_prefix']}{$bo_table} a, {$g4['write_prefix']}{$bo_table} b where a.wr_id=b.wr_parent and a.wr_is_comment=0 group by a.wr_id "; $result = sql_query($sql); for ($i=0; $row=sql_fetch_array($result); $i++) { + /* // 코멘트수를 얻습니다. $sql2 = " select count(*) as cnt from {$g4['write_prefix']}$bo_table where wr_parent = '{$row['wr_id']}' and wr_is_comment = 1 "; $row2 = sql_fetch($sql2); + */ - sql_query(" update {$g4['write_prefix']}{$bo_table} set wr_comment = '{$row2['cnt']}' where wr_id = '{$row['wr_id']}' "); + sql_query(" update {$g4['write_prefix']}{$bo_table} set wr_comment = '{$row['cnt']}' where wr_id = '{$row['wr_id']}' "); } } diff --git a/adm/config_form.php b/adm/config_form.php index 67d4cc8b8..0433353c1 100644 --- a/adm/config_form.php +++ b/adm/config_form.php @@ -475,7 +475,7 @@ $pg_anchor = " - + diff --git a/bbs/formmail_send.php b/bbs/formmail_send.php index 7b239cf41..2ce11c8bf 100644 --- a/bbs/formmail_send.php +++ b/bbs/formmail_send.php @@ -16,7 +16,7 @@ if (substr_count($to, "@") > 1) if (!chk_captcha()) { - alert('스팸방지에 입력한 숫자가 틀렸습니다.'); + alert('자동등록방지 숫자가 틀렸습니다.'); } diff --git a/bbs/gcaptcha/gcaptcha.js b/bbs/gcaptcha/gcaptcha.js index b6b8bd722..536dcd7bf 100644 --- a/bbs/gcaptcha/gcaptcha.js +++ b/bbs/gcaptcha/gcaptcha.js @@ -17,7 +17,7 @@ function chk_captcha() } }); if (!captcha_result) { - alert("스팸방지 숫자가 틀렸습니다."); + alert("자동등록방지 숫자가 틀렸습니다."); captcha_key.select(); return false; } diff --git a/bbs/gcaptcha/gcaptcha.lib.php b/bbs/gcaptcha/gcaptcha.lib.php index b95ec845d..9eb3fcc05 100644 --- a/bbs/gcaptcha/gcaptcha.lib.php +++ b/bbs/gcaptcha/gcaptcha.lib.php @@ -178,11 +178,11 @@ function captcha_html($class='captcha') $html .= PHP_EOL.''; $html .= PHP_EOL.''; $html .= '
'; - $html .= '스팸방지'; - $html .= '스팸방지 숫자'; + $html .= '자동등록방지'; + $html .= '자동등록방지 숫자'; $html .= '숫자를 음성으로 듣기'; - $html .= ''; - $html .= '

스팸방지 숫자를 순서대로 입력하세요.

'; + $html .= ''; + $html .= '

자동등록방지 숫자를 순서대로 입력하세요.

'; $html .= '
'; return $html; } diff --git a/bbs/memo_form_update.php b/bbs/memo_form_update.php index 92e8cdbfe..4f8c0fe3b 100644 --- a/bbs/memo_form_update.php +++ b/bbs/memo_form_update.php @@ -6,7 +6,7 @@ if ($is_guest) alert('회원만 이용하실 수 있습니다.'); if (!chk_captcha()) { - alert('스팸방지에 입력한 숫자가 틀렸습니다.'); + alert('자동등록방지 숫자가 틀렸습니다.'); } $recv_list = explode(',', trim($_POST['me_recv_mb_id'])); diff --git a/bbs/password_lost2.php b/bbs/password_lost2.php index eb28b4fdd..c606e17bb 100644 --- a/bbs/password_lost2.php +++ b/bbs/password_lost2.php @@ -3,11 +3,11 @@ include_once('./_common.php'); include_once(G4_GCAPTCHA_PATH.'/gcaptcha.lib.php'); if ($is_member) { - alert("이미 로그인중입니다."); + alert('이미 로그인중입니다.'); } if (!chk_captcha()) { - alert('스팸방지에 입력한 숫자가 틀렸습니다.'); + alert('자동등록방지 숫자가 틀렸습니다.'); } include_once($member_skin_path.'/password_lost2.skin.php'); diff --git a/bbs/poll_update.php b/bbs/poll_update.php index 0a2c81b68..f05a5fdfb 100644 --- a/bbs/poll_update.php +++ b/bbs/poll_update.php @@ -1,12 +1,5 @@
추천인아이디 :

- 관리자에서 회원정보 확인하기 + 관리자에서 회원정보 확인하기 diff --git a/bbs/write_comment_update.php b/bbs/write_comment_update.php index 3edbe59ca..754b85371 100644 --- a/bbs/write_comment_update.php +++ b/bbs/write_comment_update.php @@ -22,7 +22,7 @@ if ($is_guest) { if ($wr_name == '') alert('이름은 필히 입력하셔야 합니다.'); if(!chk_captcha()) - alert('스팸방지에 입력한 숫자가 틀렸습니다.'); + alert('자동등록방지 숫자가 틀렸습니다.'); } if ($w == "c" || $w == "cu") { diff --git a/bbs/write_update.php b/bbs/write_update.php index 8e7d12270..57f4fae6b 100644 --- a/bbs/write_update.php +++ b/bbs/write_update.php @@ -149,7 +149,7 @@ if ($w == '' || $w == 'u') { } if ($is_guest && !chk_captcha()) { - alert('스팸방지에 입력한 숫자가 틀렸습니다.'); + alert('자동등록방지 숫자가 틀렸습니다.'); } if ($w == '' || $w == 'r') { diff --git a/css/default.css b/css/default.css index f697bd2ae..c56e0c922 100644 --- a/css/default.css +++ b/css/default.css @@ -314,7 +314,7 @@ fieldset button {padding:0 15px;height:24px;border:0;background:#333;color:#fff; #mb_login .login_id {position:absolute;top:26px;left:95px} #mb_login .login_pw {position:absolute;top:52px;left:95px} #mb_login .frm_input {display:block;margin:0 0 5px 80px} -#mb_login .btn_submit {position:absolute;top:20px;left:335px;height:53px} +#mb_login .btn_submit {position:absolute;top:20px;left:335px;height:49px} #mb_login section {margin:0 0 30px;padding:20px;border:1px solid #cfded8;background:#f7f7f2} #mb_login section div {text-align:right} diff --git a/install/gnuboard4s.sql b/install/gnuboard4s.sql index 76ea526f0..f6f6d9caf 100644 --- a/install/gnuboard4s.sql +++ b/install/gnuboard4s.sql @@ -49,7 +49,6 @@ CREATE TABLE IF NOT EXISTS `g4s_board` ( `bo_use_secret` tinyint(4) NOT NULL default '0', `bo_use_dhtml_editor` tinyint(4) NOT NULL default '0', `bo_use_rss_view` tinyint(4) NOT NULL default '0', - `bo_use_comment` tinyint(4) NOT NULL default '0', `bo_use_good` tinyint(4) NOT NULL default '0', `bo_use_nogood` tinyint(4) NOT NULL default '0', `bo_use_name` tinyint(4) NOT NULL default '0', diff --git a/install/index.php b/install/index.php index 405056142..bf0a46041 100644 --- a/install/index.php +++ b/install/index.php @@ -1,5 +1,5 @@ diff --git a/install/install.inc.php b/install/install.inc.php index 0e8c51e0f..3de1ecf34 100644 --- a/install/install.inc.php +++ b/install/install.inc.php @@ -2,7 +2,7 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가 $data_path = '../'.G4_DATA_DIR; -if (!$title) $title = "그누보드4S 설치"; +if (!$title) $title = "그누보드4s 설치"; ?> @@ -13,17 +13,18 @@ if (!$title) $title = "그누보드4S 설치";