From 06f2c72d846c9673949bba8ce3a611eadd5bb8b4 Mon Sep 17 00:00:00 2001 From: gnuboard Date: Tue, 19 Feb 2013 13:03:56 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EA=B8=80,=EB=8C=93=EA=B8=80=20=EC=93=B0?= =?UTF-8?q?=EA=B8=B0=EC=8B=9C=20=EC=BA=90=EC=8B=9C=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/board_list_update.php | 20 ++++++++++---------- bbs/delete_all.php | 4 +++- bbs/write_comment_update.php | 2 ++ bbs/write_update.php | 5 +++-- index.php | 3 +-- lib/common.lib.php | 9 +++++++++ 6 files changed, 28 insertions(+), 15 deletions(-) diff --git a/bbs/board_list_update.php b/bbs/board_list_update.php index 8302c1bd3..a43924024 100644 --- a/bbs/board_list_update.php +++ b/bbs/board_list_update.php @@ -4,18 +4,18 @@ include_once('./_common.php'); $count = count($_POST['chk_wr_id']); if(!$count) { - alert($_POST['btn_submit']." 하실 항목을 하나 이상 선택하세요."); + alert($_POST['btn_submit'].' 하실 항목을 하나 이상 선택하세요.'); } -if($_POST['btn_submit'] == "선택삭제") { - include "./delete_all.php"; -} else if($_POST['btn_submit'] == "선택복사") { - $sw = "copy"; - include "./move.php"; -} else if($_POST['btn_submit'] == "선택이동") { - $sw = "move"; - include "./move.php"; +if($_POST['btn_submit'] == '선택삭제') { + include './delete_all.php'; +} else if($_POST['btn_submit'] == '선택복사') { + $sw = 'copy'; + include './move.php'; +} else if($_POST['btn_submit'] == '선택이동') { + $sw = 'move'; + include './move.php'; } else { - alert("올바른 방법으로 이용해 주세요."); + alert('올바른 방법으로 이용해 주세요.'); } ?> \ No newline at end of file diff --git a/bbs/delete_all.php b/bbs/delete_all.php index 90b5e7098..06ae7bfbf 100644 --- a/bbs/delete_all.php +++ b/bbs/delete_all.php @@ -92,7 +92,7 @@ for ($i=count($tmp_array)-1; $i>=0; $i--) $result2 = sql_query($sql2); while ($row2 = sql_fetch_array($result2)) // 파일삭제 - @unlink(G4_PATH.'/data/file/'.$bo_table.'/'.$row2['bf_file']); + @unlink(G4_DATA_PATH.'/file/'.$bo_table.'/'.$row2['bf_file']); // 파일테이블 행 삭제 sql_query(" delete from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' "); @@ -136,5 +136,7 @@ if ($count_write > 0 || $count_comment > 0) // 4.11 @include_once($board_skin_path.'/delete_all.tail.skin.php'); +delete_cache_latest($bo_table); + goto_url('./board.php?bo_table='.$bo_table.'&page='.$page.$qstr); ?> diff --git a/bbs/write_comment_update.php b/bbs/write_comment_update.php index 56dc4f825..364ccfefc 100644 --- a/bbs/write_comment_update.php +++ b/bbs/write_comment_update.php @@ -312,5 +312,7 @@ else if ($w == 'cu') // 코멘트 수정 @include_once($board_skin_path.'/write_comment_update.skin.php'); @include_once($board_skin_path.'/write_comment_update.tail.skin.php'); +delete_cache_latest($bo_table); + goto_url('./board.php?bo_table='.$bo_table.'&wr_id='.$wr['wr_parent'].'&page='.$page.$qstr.'&#c_'.$comment_id); ?> diff --git a/bbs/write_update.php b/bbs/write_update.php index a27d4c09c..19b948ae7 100644 --- a/bbs/write_update.php +++ b/bbs/write_update.php @@ -602,10 +602,11 @@ if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_emai } // 사용자 코드 실행 -@include_once ($board_skin_path.'/write_update.skin.php'); - +@include_once($board_skin_path.'/write_update.skin.php'); @include_once($board_skin_path.'/write_update.tail.skin.php'); +delete_cache_latest($bo_table); + if ($file_upload_msg) alert($file_upload_msg, G4_HTTPS_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.'&page='.$page.$qstr); else diff --git a/index.php b/index.php index ed59f5b89..3f6b26af3 100644 --- a/index.php +++ b/index.php @@ -7,7 +7,6 @@ include_once('./_head.php'); diff --git a/lib/common.lib.php b/lib/common.lib.php index e90251f70..4567117e2 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1732,4 +1732,13 @@ function check_device($device) alert('모바일 전용 게시판입니다.', G4_URL); } } + + +// 게시판 최신글 캐시 파일 삭제 +function delete_cache_latest($bo_table) +{ + foreach (glob(G4_DATA_PATH.'/cache/latest-'.$bo_table.'-*') as $filename) { + unlink($filename); + } +} ?> \ No newline at end of file From 58f7a7ccd720f28226b6b62451249c83b9026589 Mon Sep 17 00:00:00 2001 From: gnuboard Date: Tue, 19 Feb 2013 14:40:42 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EA=B2=BD=EB=A1=9C=20=EB=B0=8F=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/admin.head.php | 12 -- adm/admin.lib.php | 20 +--- adm/board_delete.inc.php | 4 +- adm/board_form_update.php | 2 +- adm/index.php | 2 +- adm/member_form.php | 2 +- adm/member_form_update.php | 8 +- .../ajax.mb_email.php | 2 +- .../ajax.mb_id.php | 2 +- .../ajax.mb_nick.php | 2 +- bbs/board_head.php | 2 +- bbs/board_tail.php | 2 +- bbs/delete.php | 2 +- bbs/download.php | 2 +- bbs/gcaptcha/_common.php | 3 +- bbs/group.php | 11 +- bbs/move_update.php | 6 +- bbs/password_lost2.php | 2 +- bbs/poll_etc_update.php | 2 +- bbs/register_form.php | 4 +- bbs/register_form_update.php | 6 +- bbs/view_comment.php | 4 - bbs/write.php | 2 +- bbs/write_comment_update.php | 2 +- bbs/write_update.php | 2 +- common.php | 2 +- head.php | 14 +-- head.sub.php | 1 + {js => img}/wrest.gif | Bin js/board.js | 56 --------- js/capslock.js | 67 ----------- js/jquery.mobile-1.3.0-beta.1.min.js | 2 - .../jquery.register_form.js | 14 +-- js/wrest.js | 2 +- lib/common.lib.php | 19 --- lib/mobile.lib.php | 8 +- skin/board/basic/_common.php | 4 - skin/board/basic/list.skin.php | 2 +- skin/board/basic/view.skin.php | 8 +- skin/member/basic/_common.php | 5 - skin/member/basic/ajax_register_form.js | 113 ------------------ skin/member/basic/formmail.skin.php | 4 +- skin/member/basic/login.skin.php | 2 +- skin/member/basic/login_check.skin.php | 2 +- skin/member/basic/member_confirm.skin.php | 2 +- skin/member/basic/memo.skin.php | 2 +- skin/member/basic/memo_form.skin.php | 2 +- skin/member/basic/memo_view.skin.php | 2 +- skin/member/basic/password.skin.php | 2 +- skin/member/basic/password_lost.skin.php | 2 +- skin/member/basic/profile.skin.php | 2 +- skin/member/basic/register.skin.php | 2 +- skin/member/basic/register_form.skin.php | 7 +- skin/member/basic/register_result.skin.php | 2 +- skin/member/basic/register_update.skin.php | 2 +- skin/member/basic/scrap.skin.php | 2 +- skin/member/basic/scrap_popin.skin.php | 2 +- skin/member/basic/zip.skin.php | 2 +- tail.php | 2 +- 59 files changed, 78 insertions(+), 390 deletions(-) rename skin/member/basic/ajax_mb_email_check.php => bbs/ajax.mb_email.php (89%) rename skin/member/basic/ajax_mb_id_check.php => bbs/ajax.mb_id.php (88%) rename skin/member/basic/ajax_mb_nick_check.php => bbs/ajax.mb_nick.php (89%) rename {js => img}/wrest.gif (100%) delete mode 100644 js/board.js delete mode 100644 js/capslock.js delete mode 100644 js/jquery.mobile-1.3.0-beta.1.min.js rename skin/member/basic/ajax_register_form.jquery.js => js/jquery.register_form.js (67%) delete mode 100644 skin/board/basic/_common.php delete mode 100644 skin/member/basic/_common.php delete mode 100644 skin/member/basic/ajax_register_form.js diff --git a/adm/admin.head.php b/adm/admin.head.php index d510f35af..e46105f08 100644 --- a/adm/admin.head.php +++ b/adm/admin.head.php @@ -24,7 +24,6 @@ function print_menu2($key, $no) if ($is_admin != 'super' && (!array_key_exists($menu[$key][$i][0],$auth) || !strstr($auth[$menu[$key][$i][0]], 'r'))) continue; - // if ($no == 2) $str .= "   "; $str .= '
  • '.$menu[$key][$i][1].'
  • '; $auth_menu[$menu[$key][$i][0]] = $menu[$key][$i][1]; @@ -56,17 +55,6 @@ function imageview(id, w, h) if (el_id.style.display != 'none') selectBoxHidden(id); } - -// TEXTAREA 사이즈 변경 -function textarea_size(fld, size) -{ - var rows = parseInt(fld.rows); - - rows += parseInt(size); - if (rows > 0) { - fld.rows = rows; - } -} diff --git a/adm/admin.lib.php b/adm/admin.lib.php index d4bb2cb81..f52a0b4cb 100644 --- a/adm/admin.lib.php +++ b/adm/admin.lib.php @@ -125,23 +125,6 @@ function auth_check($auth, $attr) } -// 텍스트에리어 늘리기, 줄이기 -// 보류 : 지운아빠 2012-11-07 -function textarea_size($fld) -{ - /* - global $g4; - - $size = 10; - $s = "
    "; - $s .= " "; - $s .= ""; - $s .= "
    "; - return $s; - */ -} - - // 작업아이콘 출력 function icon($act, $link='', $target='_parent') { @@ -150,7 +133,6 @@ function icon($act, $link='', $target='_parent') $img = array('입력'=>'insert', '추가'=>'insert', '생성'=>'insert', '수정'=>'modify', '삭제'=>'delete', '이동'=>'move', '그룹'=>'move', '보기'=>'view', '미리보기'=>'view', '복사'=>'copy'); $icon = ''; if ($link) - //$s = ''.$icon.''; $s = ''.$icon.''; else $s = $icon; @@ -237,7 +219,7 @@ if (get_session('ss_mb_key') !== $admin_key) { session_destroy(); - include_once($g4['path'].'/lib/mailer.lib.php'); + include_once(G4_LIB_PATH.'/mailer.lib.php'); // 메일 알림 mailer($member['mb_nick'], $member['mb_email'], $member['mb_email'], 'XSS 공격 알림', $_SERVER['REMOTE_ADDR'].' 아이피로 XSS 공격이 있었습니다.\n\n관리자 권한을 탈취하려는 접근이므로 주의하시기 바랍니다.\n\n해당 아이피는 차단하시고 의심되는 게시물이 있는지 확인하시기 바랍니다.\n\n'.G4_URL, 0); diff --git a/adm/board_delete.inc.php b/adm/board_delete.inc.php index f61482d56..123fe00f3 100644 --- a/adm/board_delete.inc.php +++ b/adm/board_delete.inc.php @@ -2,7 +2,7 @@ // board_delete.php , boardgroup_delete.php 에서 include 하는 파일 if (!defined('_GNUBOARD_')) exit; -if (!defined("_BOARD_DELETE_")) exit; // 개별 페이지 접근 불가 +if (!defined('_BOARD_DELETE_')) exit; // 개별 페이지 접근 불가 // $tmp_bo_table 에는 $bo_table 값을 넘겨주어야 함 if (!$tmp_bo_table) { return; } @@ -27,5 +27,5 @@ sql_query(" delete from {$g4['board_file_table']} where bo_table = '{$tmp_bo_tab sql_query(" drop table {$g4['write_prefix']}{$tmp_bo_table} ", FALSE); // 게시판 폴더 전체 삭제 -rm_rf($g4['path'].'/data/file/'.$tmp_bo_table); +rm_rf(G4_DATA_PATH.'/file/'.$tmp_bo_table); ?> \ No newline at end of file diff --git a/adm/board_form_update.php b/adm/board_form_update.php index 1865ee021..83e9c58af 100644 --- a/adm/board_form_update.php +++ b/adm/board_form_update.php @@ -33,7 +33,7 @@ if ($file = $_POST['bo_include_tail']) { } } -$board_path = $g4['path'].'/data/file/'.$bo_table; +$board_path = G4_DATA_PATH.'/file/'.$bo_table; // 게시판 디렉토리 생성 @mkdir($board_path, 0707); diff --git a/adm/index.php b/adm/index.php index 64fc26463..94be0f31d 100644 --- a/adm/index.php +++ b/adm/index.php @@ -216,7 +216,7 @@ $colspan = 5; diff --git a/adm/member_form.php b/adm/member_form.php index 7367694bd..dc40f7e9d 100644 --- a/adm/member_form.php +++ b/adm/member_form.php @@ -154,7 +154,7 @@ include_once('./admin.head.php'); '; echo '삭제'; diff --git a/adm/member_form_update.php b/adm/member_form_update.php index 3e4c3caf7..761bab04f 100644 --- a/adm/member_form_update.php +++ b/adm/member_form_update.php @@ -77,7 +77,7 @@ else if ($w == 'u') // 회원 아이콘 삭제 if ($del_mb_icon) - @unlink($g4['path'].'/data/member/'.$mb_dir.'/'.$mb_id.'.gif'); + @unlink(G4_DATA_PATH.'/member/'.$mb_dir.'/'.$mb_id.'.gif'); // 아이콘 업로드 if (is_uploaded_file($_FILES['mb_icon']['tmp_name'])) { @@ -86,10 +86,10 @@ else if ($w == 'u') } if (preg_match("/(\.gif)$/i", $_FILES['mb_icon']['name'])) { - @mkdir($g4['path'].'/data/member/'.$mb_dir, 0707); - @chmod($g4['path'].'/data/member/'.$mb_dir, 0707); + @mkdir(G4_DATA_PATH.'/member/'.$mb_dir, 0707); + @chmod(G4_DATA_PATH.'/member/'.$mb_dir, 0707); - $dest_path = $g4['path'].'/data/member/'.$mb_dir.'/'.$mb_id.'.gif'; + $dest_path = G4_DATA_PATH.'/member/'.$mb_dir.'/'.$mb_id.'.gif'; move_uploaded_file($_FILES['mb_icon']['tmp_name'], $dest_path); chmod($dest_path, 0606); diff --git a/skin/member/basic/ajax_mb_email_check.php b/bbs/ajax.mb_email.php similarity index 89% rename from skin/member/basic/ajax_mb_email_check.php rename to bbs/ajax.mb_email.php index 3c736a24f..a6a884e7d 100644 --- a/skin/member/basic/ajax_mb_email_check.php +++ b/bbs/ajax.mb_email.php @@ -1,5 +1,5 @@ '; + echo ''; } // 게시판 관리의 상단 내용 diff --git a/bbs/board_tail.php b/bbs/board_tail.php index 1893a05d2..7cad781db 100644 --- a/bbs/board_tail.php +++ b/bbs/board_tail.php @@ -8,7 +8,7 @@ if ($board['bo_content_tail']) { // 게시판 관리의 하단 이미지 경로 if ($board['bo_image_tail']) { - echo ''; + echo ''; } // 게시판 관리의 하단 파일 경로 diff --git a/bbs/delete.php b/bbs/delete.php index b2bc87e1a..f5fb6c675 100644 --- a/bbs/delete.php +++ b/bbs/delete.php @@ -80,7 +80,7 @@ while ($row = sql_fetch_array($result)) $sql2 = " select * from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' "; $result2 = sql_query($sql2); while ($row2 = sql_fetch_array($result2)) - @unlink(G4_PATH.'/data/file/'.$bo_table.'/'.$row2['bf_file']); + @unlink(G4_DATA_PATH.'/file/'.$bo_table.'/'.$row2['bf_file']); // 파일테이블 행 삭제 sql_query(" delete from {$g4['board_file_table']} where bo_table = '$bo_table' and wr_id = '{$row['wr_id']}' "); diff --git a/bbs/download.php b/bbs/download.php index 5ad5508cd..af595365a 100644 --- a/bbs/download.php +++ b/bbs/download.php @@ -34,7 +34,7 @@ if ($member['mb_level'] < $board['bo_download_level']) { alert($alert_msg.'\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?wr_id='.$wr_id.'&'.$qstr.'&url='.urlencode($g4['bbs_path'].'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id)); } -$filepath = G4_PATH.'/data/file/'.$bo_table.'/'.$file['bf_file']; +$filepath = G4_DATA_PATH.'/file/'.$bo_table.'/'.$file['bf_file']; $filepath = addslashes($filepath); if (!is_file($filepath) || !file_exists($filepath)) alert('파일이 존재하지 않습니다.'); diff --git a/bbs/gcaptcha/_common.php b/bbs/gcaptcha/_common.php index d82224eec..49adf4677 100644 --- a/bbs/gcaptcha/_common.php +++ b/bbs/gcaptcha/_common.php @@ -1,4 +1,3 @@ \ No newline at end of file diff --git a/bbs/group.php b/bbs/group.php index 69b695360..ec3684040 100644 --- a/bbs/group.php +++ b/bbs/group.php @@ -1,8 +1,6 @@ var g4_cf_filter = '$config['cf_filter']'; \n"; -//echo "\n"; - if (!$member['mb_id']) // 비회원일 경우에만 echo ''.PHP_EOL; diff --git a/bbs/write.php b/bbs/write.php index 2ebff2f83..f00d187f9 100644 --- a/bbs/write.php +++ b/bbs/write.php @@ -16,7 +16,7 @@ if (!$bo_table) { check_device($board['bo_device']); -@include_once (G4_PATH.'/skin/board/write.head.skin.php'); +@include_once (G4_SKIN_PATH.'/board/write.head.skin.php'); @include_once ($board_skin_path.'/write.head.skin.php'); $notice_array = explode(',', trim($board['bo_notice'])); diff --git a/bbs/write_comment_update.php b/bbs/write_comment_update.php index 364ccfefc..04bd919c1 100644 --- a/bbs/write_comment_update.php +++ b/bbs/write_comment_update.php @@ -194,7 +194,7 @@ if ($w == 'c') // 코멘트 입력 // 4.00.15 - 메일로 보내는 코멘트의 바로가기 링크 수정 $link_url = G4_BBS_URL."/board.php?bo_table=".$bo_table."&wr_id=".$wr_id."&".$qstr."#c_".$comment_id; - include_once(G4_PATH.'/lib/mailer.lib.php'); + include_once(G4_LIB_PATH.'/mailer.lib.php'); ob_start(); include_once ('./write_update_mail.php'); diff --git a/bbs/write_update.php b/bbs/write_update.php index 19b948ae7..215c6f3e0 100644 --- a/bbs/write_update.php +++ b/bbs/write_update.php @@ -562,7 +562,7 @@ if (!($w == 'u' || $w == 'cu') && $config['cf_email_use'] && $board['bo_use_emai $subject = '"'.$board['bo_subject'].'" 게시판에 '.$str.'글이 올라왔습니다.'; $link_url = G4_BBS_URL.'/board.php?bo_table='.$bo_table.'&wr_id='.$wr_id.'&'.$qstr; - include_once(G4_PATH.'/lib/mailer.lib.php'); + include_once(G4_LIB_PATH.'/mailer.lib.php'); ob_start(); include_once ('./write_update_mail.php'); diff --git a/common.php b/common.php index c58ca60cc..b59339ed7 100644 --- a/common.php +++ b/common.php @@ -172,7 +172,7 @@ else if (is_mobile()) $_SESSION['ss_is_mobile'] = $is_mobile; define('G4_IS_MOBILE', $is_mobile); if (G4_IS_MOBILE) { - include_once(G4_PATH.'/lib/mobile.lib.php'); // 모바일 전용 라이브러리 + include_once(G4_LIB_PATH.'/mobile.lib.php'); // 모바일 전용 라이브러리 $g4['mobile_path'] = G4_PATH.'/'.$g4['mobile_dir']; } //============================================================================== diff --git a/head.php b/head.php index 7f1592372..9b3c611f7 100644 --- a/head.php +++ b/head.php @@ -63,13 +63,13 @@ include_once(G4_LIB_PATH.'/popular.lib.php');