diff --git a/adm/admin.head.php b/adm/admin.head.php index c175f62f3..c8253f8ac 100644 --- a/adm/admin.head.php +++ b/adm/admin.head.php @@ -95,7 +95,7 @@ function imageview(id, w, h) continue; } $current_class = ""; - if (isset($sub_menu) && (substr($sub_menu, 0, 2) == substr($menu['menu'.$key][0][0], 0, 2))) + if (isset($sub_menu) && (substr($sub_menu, 0, 3) == substr($menu['menu'.$key][0][0], 0, 3))) $current_class = " gnb_1dli_air"; $gnb_str .= '
  • '.PHP_EOL; $gnb_str .= $href1 . $menu['menu'.$key][0][1] . $href2; diff --git a/adm/popular_list.php b/adm/popular_list.php index cc16fae58..725039337 100644 --- a/adm/popular_list.php +++ b/adm/popular_list.php @@ -57,7 +57,7 @@ $sql = " select * limit {$from_record}, {$rows} "; $result = sql_query($sql); -$listall = '전체목록'; +$listall = '전체목록'; $g5['title'] = '인기검색어관리'; include_once('./admin.head.php'); diff --git a/adm/shop_admin/itemform.php b/adm/shop_admin/itemform.php index 04c99b37f..372f5a64f 100644 --- a/adm/shop_admin/itemform.php +++ b/adm/shop_admin/itemform.php @@ -48,6 +48,9 @@ else if ($w == "u") $sql = " select * from {$g5['g5_shop_item_table']} where it_id = '$it_id' "; $it = sql_fetch($sql); + if(!$it) + alert('상품정보가 존재하지 않습니다.'); + if (!$ca_id) $ca_id = $it['ca_id']; diff --git a/adm/shop_admin/itemqaform.php b/adm/shop_admin/itemqaform.php index a1655b722..eafc1964c 100644 --- a/adm/shop_admin/itemqaform.php +++ b/adm/shop_admin/itemqaform.php @@ -12,7 +12,7 @@ $sql = " select * $iq = sql_fetch($sql); if (!$iq['iq_id']) alert('등록된 자료가 없습니다.'); -$name = get_sideview($is['mb_id'], get_text($iq['iq_name']), $is['mb_email'], $is['mb_homepage']); +$name = get_sideview($iq['mb_id'], get_text($iq['iq_name']), $iq['mb_email'], $iq['mb_homepage']); $g5['title'] = '상품문의'; include_once (G5_ADMIN_PATH.'/admin.head.php'); diff --git a/adm/shop_admin/orderdeliveryexcel.php b/adm/shop_admin/orderdeliveryexcel.php index c232aa51a..3c31257dc 100644 --- a/adm/shop_admin/orderdeliveryexcel.php +++ b/adm/shop_admin/orderdeliveryexcel.php @@ -40,11 +40,11 @@ for($i=1; $row=sql_fetch_array($result); $i++) { $worksheet->write($i, 0, ' '.$row['od_id']); $worksheet->write($i, 1, $row['od_name']); - $worksheet->write($i, 2, $row['od_tel']); - $worksheet->write($i, 3, $row['od_hp']); + $worksheet->write($i, 2, ' '.$row['od_tel']); + $worksheet->write($i, 3, ' '.$row['od_hp']); $worksheet->write($i, 4, $row['od_b_name']); - $worksheet->write($i, 5, $row['od_b_tel']); - $worksheet->write($i, 6, $row['od_b_hp']); + $worksheet->write($i, 5, ' '.$row['od_b_tel']); + $worksheet->write($i, 6, ' '.$row['od_b_hp']); $worksheet->write($i, 7, print_address($row['od_b_addr1'], $row['od_b_addr2'], $row['od_b_addr3'], $row['od_b_addr_jibeon'])); $worksheet->write($i, 8, $row['od_delivery_company']); $worksheet->write($i, 9, $row['od_invoice']); diff --git a/adm/shop_admin/orderform.php b/adm/shop_admin/orderform.php index 1dc5e6e69..d99f693d7 100644 --- a/adm/shop_admin/orderform.php +++ b/adm/shop_admin/orderform.php @@ -10,16 +10,6 @@ auth_check($auth[$sub_menu], "w"); $g5['title'] = "주문 내역 수정"; include_once(G5_ADMIN_PATH.'/admin.head.php'); -//------------------------------------------------------------------------------ -// 설정 시간이 지난 주문서 없는 장바구니 자료 삭제 -//------------------------------------------------------------------------------ -$keep_term = $default['de_cart_keep_term']; -if (!$keep_term) $keep_term = 15; // 기본값 15일 -$beforetime = date('Y-m-d', ( G5_SERVER_TIME - (86400 * $keep_term) ) ); -$sql = " delete from {$g5['g5_shop_cart_table']} where ct_status = '쇼핑' and substring(ct_time, 1, 10) < '$beforetime' "; -sql_query($sql); -//------------------------------------------------------------------------------ - // 완료된 주문에 포인트를 적립한다. save_order_point("완료"); diff --git a/adm/shop_admin/orderlistdelete.php b/adm/shop_admin/orderlistdelete.php index 09d2aff75..2e874d69d 100644 --- a/adm/shop_admin/orderlistdelete.php +++ b/adm/shop_admin/orderlistdelete.php @@ -13,11 +13,18 @@ for ($i=0; $iwrite($i, 0, $row['od_b_zip1'].'-'.$row['od_b_zip2']); $worksheet->write($i, 1, print_address($row['od_b_addr1'], $row['od_b_addr2'], $row['od_b_addr3'], $row['od_b_addr_jibeon'])); $worksheet->write($i, 2, $row['od_b_name']); - $worksheet->write($i, 3, $row['od_b_tel']); - $worksheet->write($i, 4, $row['od_b_hp']); + $worksheet->write($i, 3, ' '.$row['od_b_tel']); + $worksheet->write($i, 4, ' '.$row['od_b_hp']); $worksheet->write($i, 5, $row['it_name']); $worksheet->write($i, 6, $row['ct_qty']); $worksheet->write($i, 7, $row['ct_option']); diff --git a/adm/sms_admin/sms_write_send.php b/adm/sms_admin/sms_write_send.php index 5265708ce..c59301258 100644 --- a/adm/sms_admin/sms_write_send.php +++ b/adm/sms_admin/sms_write_send.php @@ -181,7 +181,7 @@ if ($result) $hs_memo = "인증 받지 못하였습니다. 계정을 다시 확인해 주세요."; break; default: // "미 확인 오류" - $hs_memo = "알 수 없는 오류로 전송이 실패하었습니다."; + $hs_memo = "알 수 없는 오류로 전송이 실패하였습니다."; break; } $wr_failure++; diff --git a/bbs/qadelete.php b/bbs/qadelete.php index efa1b050e..07373f40d 100644 --- a/bbs/qadelete.php +++ b/bbs/qadelete.php @@ -17,7 +17,7 @@ if(!$count) for($i=0; $i<$count; $i++) { $qa_id = $tmp_array[$i]; - $sql = " select qa_id, qa_type, qa_status, qa_parent, qa_content, qa_file1, qa_file2 + $sql = " select qa_id, mb_id, qa_type, qa_status, qa_parent, qa_content, qa_file1, qa_file2 from {$g5['qa_content_table']} where qa_id = '$qa_id' "; $row = sql_fetch($sql); @@ -25,6 +25,10 @@ for($i=0; $i<$count; $i++) { if(!$row['qa_id']) continue; + // 자신의 글이 아니면 건너뜀 + if($is_admin != 'super' && $row['mb_id'] != $member['mb_id']) + continue; + // 첨부파일 삭제 for($k=1; $k<=2; $k++) { @unlink(G5_DATA_PATH.'/qa/'.$row['qa_file'.$k]); diff --git a/bbs/qawrite_update.php b/bbs/qawrite_update.php index 232678ab4..3671cfcfd 100644 --- a/bbs/qawrite_update.php +++ b/bbs/qawrite_update.php @@ -10,10 +10,11 @@ $w == u : 수정 if($is_guest) alert('회원이시라면 로그인 후 이용해 보십시오.', './login.php?url='.urlencode(G5_BBS_URL.'/qalist.php')); -$qaconfig = get_qa_config(); - $msg = array(); +// 1:1문의 설정값 +$qaconfig = get_qa_config(); + // e-mail 체크 if(isset($_POST['qa_email']) && $qa_email) { $qa_email = get_email_address(trim($_POST['qa_email'])); @@ -71,9 +72,6 @@ for ($i=1; $i<=5; $i++) { } } -// 1:1문의 설정값 -$qaconfig = get_qa_config(); - if($w == 'u' || $w == 'a' || $w == 'r') { if($w == 'a' && !$is_admin) alert('답변은 관리자만 등록할 수 있습니다.'); diff --git a/bbs/register_form_update.php b/bbs/register_form_update.php index 6359a5fdd..458673a9f 100644 --- a/bbs/register_form_update.php +++ b/bbs/register_form_update.php @@ -20,7 +20,16 @@ if (!chk_captcha()) { alert('자동등록방지 숫자가 틀렸습니다.'); } -$mb_id = trim($_POST['mb_id']); +if($w == 'u') + $mb_id = isset($_SESSION['ss_mb_id']) ? trim($_SESSION['ss_mb_id']) : ''; +else if($w == '') + $mb_id = trim($_POST['mb_id']); +else + alert('잘못된 접근입니다', G5_URL); + +if(!$mb_id) + alert('회원아이디 값이 없습니다. 올바른 방법으로 이용해 주십시오.'); + $mb_password = trim($_POST['mb_password']); $mb_password_re = trim($_POST['mb_password_re']); $mb_name = trim($_POST['mb_name']); @@ -123,50 +132,6 @@ $mb_addr_jibeon = preg_match("/^(N|R)$/", $mb_addr_jibeon) ? $mb_addr_jibeon : ' // 사용자 코드 실행 @include_once($member_skin_path.'/register_form_update.head.skin.php'); -$mb_dir = G5_DATA_PATH.'/member/'.substr($mb_id,0,2); - -// 아이콘 삭제 -if (isset($_POST['del_mb_icon'])) { - @unlink($mb_dir.'/'.$mb_id.'.gif'); -} - -$msg = ""; - -// 아이콘 업로드 -$mb_icon = ''; -if (isset($_FILES['mb_icon']) && is_uploaded_file($_FILES['mb_icon']['tmp_name'])) { - if (preg_match("/(\.gif)$/i", $_FILES['mb_icon']['name'])) { - // 아이콘 용량이 설정값보다 이하만 업로드 가능 - if ($_FILES['mb_icon']['size'] <= $config['cf_member_icon_size']) { - @mkdir($mb_dir, G5_DIR_PERMISSION); - @chmod($mb_dir, G5_DIR_PERMISSION); - $dest_path = $mb_dir.'/'.$mb_id.'.gif'; - move_uploaded_file($_FILES['mb_icon']['tmp_name'], $dest_path); - chmod($dest_path, G5_FILE_PERMISSION); - if (file_exists($dest_path)) { - //=================================================================\ - // 090714 - // gif 파일에 악성코드를 심어 업로드 하는 경우를 방지 - // 에러메세지는 출력하지 않는다. - //----------------------------------------------------------------- - $size = getimagesize($dest_path); - if ($size[2] != 1) // gif 파일이 아니면 올라간 이미지를 삭제한다. - @unlink($dest_path); - else - // 아이콘의 폭 또는 높이가 설정값 보다 크다면 이미 업로드 된 아이콘 삭제 - if ($size[0] > $config['cf_member_icon_width'] || $size[1] > $config['cf_member_icon_height']) - @unlink($dest_path); - //=================================================================\ - } - } else { - $msg .= '회원아이콘을 '.number_format($config['cf_member_icon_size']).'바이트 이하로 업로드 해주십시오.'; - } - - } else { - $msg .= $_FILES['mb_icon']['name'].'은(는) gif 파일이 아닙니다.'; - } -} - //=============================================================== // 본인확인 //--------------------------------------------------------------- @@ -213,7 +178,6 @@ if ($config['cf_cert_use'] && $cert_type && $md5_cert_no) { //=============================================================== if ($w == '') { - $sql = " insert into {$g5['member_table']} set mb_id = '{$mb_id}', mb_password = '".sql_password($mb_password)."', @@ -303,11 +267,10 @@ if ($w == '') { set_session('ss_mb_reg', $mb_id); } else if ($w == 'u') { - if (!trim($_SESSION['ss_mb_id'])) alert('로그인 되어 있지 않습니다.'); - if ($_SESSION['ss_mb_id'] != $mb_id) + if (trim($_POST['mb_id']) != $mb_id) alert("로그인된 정보와 수정하려는 정보가 틀리므로 수정할 수 없습니다.\\n만약 올바르지 않은 방법을 사용하신다면 바로 중지하여 주십시오."); $sql_password = ""; @@ -368,6 +331,52 @@ if ($w == '') { } +// 회원 아이콘 +$mb_dir = G5_DATA_PATH.'/member/'.substr($mb_id,0,2); + +// 아이콘 삭제 +if (isset($_POST['del_mb_icon'])) { + @unlink($mb_dir.'/'.$mb_id.'.gif'); +} + +$msg = ""; + +// 아이콘 업로드 +$mb_icon = ''; +if (isset($_FILES['mb_icon']) && is_uploaded_file($_FILES['mb_icon']['tmp_name'])) { + if (preg_match("/(\.gif)$/i", $_FILES['mb_icon']['name'])) { + // 아이콘 용량이 설정값보다 이하만 업로드 가능 + if ($_FILES['mb_icon']['size'] <= $config['cf_member_icon_size']) { + @mkdir($mb_dir, G5_DIR_PERMISSION); + @chmod($mb_dir, G5_DIR_PERMISSION); + $dest_path = $mb_dir.'/'.$mb_id.'.gif'; + move_uploaded_file($_FILES['mb_icon']['tmp_name'], $dest_path); + chmod($dest_path, G5_FILE_PERMISSION); + if (file_exists($dest_path)) { + //=================================================================\ + // 090714 + // gif 파일에 악성코드를 심어 업로드 하는 경우를 방지 + // 에러메세지는 출력하지 않는다. + //----------------------------------------------------------------- + $size = getimagesize($dest_path); + if ($size[2] != 1) // gif 파일이 아니면 올라간 이미지를 삭제한다. + @unlink($dest_path); + else + // 아이콘의 폭 또는 높이가 설정값 보다 크다면 이미 업로드 된 아이콘 삭제 + if ($size[0] > $config['cf_member_icon_width'] || $size[1] > $config['cf_member_icon_height']) + @unlink($dest_path); + //=================================================================\ + } + } else { + $msg .= '회원아이콘을 '.number_format($config['cf_member_icon_size']).'바이트 이하로 업로드 해주십시오.'; + } + + } else { + $msg .= $_FILES['mb_icon']['name'].'은(는) gif 파일이 아닙니다.'; + } +} + + // 인증메일 발송 if ($config['cf_use_email_certify'] && $old_email != $mb_email) { $subject = '['.$config['cf_title'].'] 인증확인 메일입니다.'; @@ -442,14 +451,14 @@ unset($_SESSION['ss_cert_adult']); if ($msg) echo ''; -if ($w == "") { +if ($w == '') { goto_url(G5_HTTP_BBS_URL.'/register_result.php'); } else if ($w == 'u') { $row = sql_fetch(" select mb_password from {$g5['member_table']} where mb_id = '{$member['mb_id']}' "); $tmp_password = $row['mb_password']; if ($old_email != $mb_email && $config['cf_use_email_certify']) { - set_session("ss_mb_id", ""); + set_session('ss_mb_id', ''); alert('회원 정보가 수정 되었습니다.\n\nE-mail 주소가 변경되었으므로 다시 인증하셔야 합니다.', G5_URL); } else { alert('회원 정보가 수정 되었습니다.', G5_URL); diff --git a/bbs/scrap_popin_update.php b/bbs/scrap_popin_update.php index 49fe298ad..ffb6e8137 100644 --- a/bbs/scrap_popin_update.php +++ b/bbs/scrap_popin_update.php @@ -40,10 +40,10 @@ if ($wr_content && ($member['mb_level'] >= $board['bo_comment_level'])) if ($wr['wr_id']) { $mb_id = $member['mb_id']; - $wr_name = $member['mb_nick']; + $wr_name = addslashes(clean_xss_tags($board['bo_use_name'] ? $member['mb_name'] : $member['mb_nick'])); $wr_password = $member['mb_password']; - $wr_email = $member['mb_email']; - $wr_homepage = $member['mb_homepage']; + $wr_email = addslashes($member['mb_email']); + $wr_homepage = addslashes(clean_xss_tags($member['mb_homepage'])); $sql = " select max(wr_comment) as max_comment from $write_table where wr_parent = '$wr_id' and wr_is_comment = '1' "; diff --git a/bbs/write.php b/bbs/write.php index 4a8e9672f..03f8b3aae 100644 --- a/bbs/write.php +++ b/bbs/write.php @@ -3,9 +3,6 @@ include_once('./_common.php'); include_once(G5_EDITOR_LIB); include_once(G5_CAPTCHA_PATH.'/captcha.lib.php'); -set_session('ss_bo_table', $_REQUEST['bo_table']); -set_session('ss_wr_id', $_REQUEST['wr_id']); - if (!$board['bo_table']) { alert('존재하지 않는 게시판입니다.', G5_URL); } @@ -294,10 +291,10 @@ $homepage = ""; if ($w == "" || $w == "r") { if ($is_member) { if (isset($write['wr_name'])) { - $name = get_text(cut_str($write['wr_name'],20)); + $name = get_text(cut_str(stripslashes($write['wr_name']),20)); } - $email = $member['mb_email']; - $homepage = get_text($member['mb_homepage']); + $email = get_email_address($member['mb_email']); + $homepage = get_text(stripslashes($member['mb_homepage'])); } } @@ -318,9 +315,9 @@ if ($w == '') { } } - $name = get_text(cut_str($write['wr_name'],20)); + $name = get_text(cut_str(stripslashes($write['wr_name']),20)); $email = get_email_address($write['wr_email']); - $homepage = get_text($write['wr_homepage']); + $homepage = get_text(stripslashes($write['wr_homepage'])); for ($i=1; $i<=G5_LINK_COUNT; $i++) { $write['wr_link'.$i] = get_text($write['wr_link'.$i]); @@ -353,6 +350,9 @@ if ($w == '') { } } +set_session('ss_bo_table', $_REQUEST['bo_table']); +set_session('ss_wr_id', $_REQUEST['wr_id']); + $subject = ""; if (isset($write['wr_subject'])) { $subject = str_replace("\"", """, get_text(cut_str($write['wr_subject'], 255), 0)); @@ -408,7 +408,7 @@ include_once('./board_head.php'); $action_url = https_url(G5_BBS_DIR)."/write_update.php"; -echo ''; +echo ''; include_once ($board_skin_path.'/write.skin.php'); include_once('./board_tail.php'); diff --git a/bbs/write_comment_update.php b/bbs/write_comment_update.php index 667e5131e..ceb54a5ee 100644 --- a/bbs/write_comment_update.php +++ b/bbs/write_comment_update.php @@ -15,7 +15,7 @@ $w = $_POST["w"]; $wr_name = trim($_POST['wr_name']); $wr_email = ''; if (!empty($_POST['wr_email'])) - $wr_email = trim($_POST['wr_email']); + $wr_email = get_email_address(trim($_POST['wr_email'])); // 비회원의 경우 이름이 누락되는 경우가 있음 if ($is_guest) { @@ -52,10 +52,10 @@ if ($is_member) { $mb_id = $member['mb_id']; // 4.00.13 - 실명 사용일때 댓글에 닉네임으로 입력되던 오류를 수정 - $wr_name = $board['bo_use_name'] ? $member['mb_name'] : $member['mb_nick']; + $wr_name = addslashes(clean_xss_tags($board['bo_use_name'] ? $member['mb_name'] : $member['mb_nick'])); $wr_password = $member['mb_password']; - $wr_email = $member['mb_email']; - $wr_homepage = $member['mb_homepage']; + $wr_email = addslashes($member['mb_email']); + $wr_homepage = addslashes(clean_xss_tags($member['mb_homepage'])); } else { diff --git a/bbs/write_update.php b/bbs/write_update.php index 1124b849c..fcc33c999 100644 --- a/bbs/write_update.php +++ b/bbs/write_update.php @@ -28,11 +28,15 @@ if ($wr_content == '') { $wr_link1 = ''; if (isset($_POST['wr_link1'])) { $wr_link1 = substr($_POST['wr_link1'],0,1000); + $wr_link1 = trim(strip_tags($wr_link1)); + $wr_link1 = preg_replace("#[\\\]+$#", "", $wr_link1); } $wr_link2 = ''; if (isset($_POST['wr_link2'])) { $wr_link2 = substr($_POST['wr_link2'],0,1000); + $wr_link2 = trim(strip_tags($wr_link2)); + $wr_link2 = preg_replace("#[\\\]+$#", "", $wr_link2); } $msg = implode('
    ', $msg); @@ -52,10 +56,6 @@ if (empty($_POST)) { alert("파일 또는 글내용의 크기가 서버에서 설정한 값을 넘어 오류가 발생하였습니다.\\npost_max_size=".ini_get('post_max_size')." , upload_max_filesize=".$upload_max_filesize."\\n게시판관리자 또는 서버관리자에게 문의 바랍니다."); } -$w = $_POST['w']; -$wr_link1 = trim(strip_tags($_POST['wr_link1'])); -$wr_link2 = trim(strip_tags($_POST['wr_link2'])); - $notice_array = explode(",", $board['bo_notice']); if ($w == 'u' || $w == 'r') { @@ -177,6 +177,220 @@ if ($w == '' || $w == 'r') { if (!isset($_POST['wr_subject']) || !trim($_POST['wr_subject'])) alert('제목을 입력하여 주십시오.'); +if ($w == '' || $w == 'r') { + + if ($member['mb_id']) { + $mb_id = $member['mb_id']; + $wr_name = addslashes(clean_xss_tags($board['bo_use_name'] ? $member['mb_name'] : $member['mb_nick'])); + $wr_password = $member['mb_password']; + $wr_email = addslashes($member['mb_email']); + $wr_homepage = addslashes(clean_xss_tags($member['mb_homepage'])); + } else { + $mb_id = ''; + // 비회원의 경우 이름이 누락되는 경우가 있음 + $wr_name = clean_xss_tags(trim($_POST['wr_name'])); + if (!$wr_name) + alert('이름은 필히 입력하셔야 합니다.'); + $wr_password = sql_password($wr_password); + $wr_email = get_email_address(trim($_POST['wr_email'])); + $wr_homepage = clean_xss_tags($wr_homepage); + } + + if ($w == 'r') { + // 답변의 원글이 비밀글이라면 비밀번호는 원글과 동일하게 넣는다. + if ($secret) + $wr_password = $wr['wr_password']; + + $wr_id = $wr_id . $reply; + $wr_num = $write['wr_num']; + $wr_reply = $reply; + } else { + $wr_num = get_next_num($write_table); + $wr_reply = ''; + } + + $sql = " insert into $write_table + set wr_num = '$wr_num', + wr_reply = '$wr_reply', + wr_comment = 0, + ca_name = '$ca_name', + wr_option = '$html,$secret,$mail', + wr_subject = '$wr_subject', + wr_content = '$wr_content', + wr_link1 = '$wr_link1', + wr_link2 = '$wr_link2', + wr_link1_hit = 0, + wr_link2_hit = 0, + wr_hit = 0, + wr_good = 0, + wr_nogood = 0, + mb_id = '{$member['mb_id']}', + wr_password = '$wr_password', + wr_name = '$wr_name', + wr_email = '$wr_email', + wr_homepage = '$wr_homepage', + wr_datetime = '".G5_TIME_YMDHIS."', + wr_last = '".G5_TIME_YMDHIS."', + wr_ip = '{$_SERVER['REMOTE_ADDR']}', + wr_1 = '$wr_1', + wr_2 = '$wr_2', + wr_3 = '$wr_3', + wr_4 = '$wr_4', + wr_5 = '$wr_5', + wr_6 = '$wr_6', + wr_7 = '$wr_7', + wr_8 = '$wr_8', + wr_9 = '$wr_9', + wr_10 = '$wr_10' "; + sql_query($sql); + + $wr_id = mysql_insert_id(); + + // 부모 아이디에 UPDATE + sql_query(" update $write_table set wr_parent = '$wr_id' where wr_id = '$wr_id' "); + + // 새글 INSERT + sql_query(" insert into {$g5['board_new_table']} ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '{$bo_table}', '{$wr_id}', '{$wr_id}', '".G5_TIME_YMDHIS."', '{$member['mb_id']}' ) "); + + // 게시글 1 증가 + sql_query("update {$g5['board_table']} set bo_count_write = bo_count_write + 1 where bo_table = '{$bo_table}'"); + + // 쓰기 포인트 부여 + if ($w == '') { + if ($notice) { + $bo_notice = $wr_id.($board['bo_notice'] ? ",".$board['bo_notice'] : ''); + sql_query(" update {$g5['board_table']} set bo_notice = '{$bo_notice}' where bo_table = '{$bo_table}' "); + } + + insert_point($member['mb_id'], $board['bo_write_point'], "{$board['bo_subject']} {$wr_id} 글쓰기", $bo_table, $wr_id, '쓰기'); + } else { + // 답변은 코멘트 포인트를 부여함 + // 답변 포인트가 많은 경우 코멘트 대신 답변을 하는 경우가 많음 + insert_point($member['mb_id'], $board['bo_comment_point'], "{$board['bo_subject']} {$wr_id} 글답변", $bo_table, $wr_id, '쓰기'); + } +} else if ($w == 'u') { + if (get_session('ss_bo_table') != $_POST['bo_table'] || get_session('ss_wr_id') != $_POST['wr_id']) { + alert('올바른 방법으로 수정하여 주십시오.', G5_BBS_URL.'/board.php?bo_table='.$bo_table); + } + + $return_url = './board.php?bo_table='.$bo_table.'&wr_id='.$wr_id; + + if ($is_admin == 'super') // 최고관리자 통과 + ; + else if ($is_admin == 'group') { // 그룹관리자 + $mb = get_member($write['mb_id']); + if ($member['mb_id'] != $group['gr_admin']) // 자신이 관리하는 그룹인가? + alert('자신이 관리하는 그룹의 게시판이 아니므로 수정할 수 없습니다.', $return_url); + else if ($member['mb_level'] < $mb['mb_level']) // 자신의 레벨이 크거나 같다면 통과 + alert('자신의 권한보다 높은 권한의 회원이 작성한 글은 수정할 수 없습니다.', $return_url); + } else if ($is_admin == 'board') { // 게시판관리자이면 + $mb = get_member($write['mb_id']); + if ($member['mb_id'] != $board['bo_admin']) // 자신이 관리하는 게시판인가? + alert('자신이 관리하는 게시판이 아니므로 수정할 수 없습니다.', $return_url); + else if ($member['mb_level'] < $mb['mb_level']) // 자신의 레벨이 크거나 같다면 통과 + alert('자신의 권한보다 높은 권한의 회원이 작성한 글은 수정할 수 없습니다.', $return_url); + } else if ($member['mb_id']) { + if ($member['mb_id'] != $write['mb_id']) + alert('자신의 글이 아니므로 수정할 수 없습니다.', $return_url); + } else { + if ($write['mb_id']) + alert('로그인 후 수정하세요.', './login.php?url='.urlencode($return_url)); + } + + if ($member['mb_id']) { + // 자신의 글이라면 + if ($member['mb_id'] == $wr['mb_id']) { + $mb_id = $member['mb_id']; + $wr_name = addslashes(clean_xss_tags($board['bo_use_name'] ? $member['mb_name'] : $member['mb_nick'])); + $wr_email = addslashes($member['mb_email']); + $wr_homepage = addslashes(clean_xss_tags($member['mb_homepage'])); + } else { + $mb_id = $wr['mb_id']; + if(isset($_POST['wr_name']) && $_POST['wr_name']) + $wr_name = clean_xss_tags(trim($_POST['wr_name'])); + else + $wr_name = addslashes(clean_xss_tags($wr['wr_name'])); + if(isset($_POST['wr_email']) && $_POST['wr_email']) + $wr_email = get_email_address(trim($_POST['wr_email'])); + else + $wr_email = addslashes($wr['wr_email']); + if(isset($_POST['wr_homepage']) && $_POST['wr_homepage']) + $wr_homepage = addslashes(clean_xss_tags($_POST['wr_homepage'])); + else + $wr_homepage = addslashes(clean_xss_tags($wr['wr_homepage'])); + } + } else { + $mb_id = ""; + // 비회원의 경우 이름이 누락되는 경우가 있음 + if (!trim($wr_name)) alert("이름은 필히 입력하셔야 합니다."); + $wr_name = clean_xss_tags(trim($_POST['wr_name'])); + $wr_email = get_email_address(trim($_POST['wr_email'])); + } + + $sql_password = $wr_password ? " , wr_password = '".sql_password($wr_password)."' " : ""; + + $sql_ip = ''; + if (!$is_admin) + $sql_ip = " , wr_ip = '{$_SERVER['REMOTE_ADDR']}' "; + + $sql = " update {$write_table} + set ca_name = '{$ca_name}', + wr_option = '{$html},{$secret},{$mail}', + wr_subject = '{$wr_subject}', + wr_content = '{$wr_content}', + wr_link1 = '{$wr_link1}', + wr_link2 = '{$wr_link2}', + mb_id = '{$mb_id}', + wr_name = '{$wr_name}', + wr_email = '{$wr_email}', + wr_homepage = '{$wr_homepage}', + wr_1 = '{$wr_1}', + wr_2 = '{$wr_2}', + wr_3 = '{$wr_3}', + wr_4 = '{$wr_4}', + wr_5 = '{$wr_5}', + wr_6 = '{$wr_6}', + wr_7 = '{$wr_7}', + wr_8 = '{$wr_8}', + wr_9 = '{$wr_9}', + wr_10= '{$wr_10}' + {$sql_ip} + {$sql_password} + where wr_id = '{$wr['wr_id']}' "; + sql_query($sql); + + // 분류가 수정되는 경우 해당되는 코멘트의 분류명도 모두 수정함 + // 코멘트의 분류를 수정하지 않으면 검색이 제대로 되지 않음 + $sql = " update {$write_table} set ca_name = '{$ca_name}' where wr_parent = '{$wr['wr_id']}' "; + sql_query($sql); + + /* + if ($notice) { + //if (!preg_match("/[^0-9]{0,1}{$wr_id}[\r]{0,1}/",$board['bo_notice'])) + if (!in_array((int)$wr_id, $notice_array)) { + $bo_notice = $wr_id . ',' . $board['bo_notice']; + sql_query(" update {$g5['board_table']} set bo_notice = '{$bo_notice}' where bo_table = '{$bo_table}' "); + } + } else { + $bo_notice = ''; + for ($i=0; $i

    쇼핑몰 배너

      '.PHP_EOL; //print_r2($row); // 테두리 있는지 - $bn_border = ($row['bn_border']) ? ' sbn_border' : '';; + $bn_border = ($row['bn_border']) ? ' class="sbn_border"' : '';; // 새창 띄우기인지 $bn_new_win = ($row['bn_new_win']) ? ' target="_blank"' : ''; $bimg = G5_DATA_PATH.'/banner/'.$row['bn_id']; if (file_exists($bimg)) { + $banner = ''; $size = getimagesize($bimg); echo '
    • '.PHP_EOL; if ($row['bn_url'][0] == '#') - echo ''; + $banner .= ''; else if ($row['bn_url'] && $row['bn_url'] != 'http://') { - echo ''; + $banner .= ''; } - echo ''.$row['bn_alt'].''; - if($row['bn_url']) + echo $banner.''.$row['bn_alt'].''; + if($banner) echo ''.PHP_EOL; echo '
    • '.PHP_EOL; } diff --git a/skin/shop/basic/mainbanner.10.skin.php b/skin/shop/basic/mainbanner.10.skin.php index f5008b833..f68246456 100644 --- a/skin/shop/basic/mainbanner.10.skin.php +++ b/skin/shop/basic/mainbanner.10.skin.php @@ -14,13 +14,14 @@ for ($i=0; $row=sql_fetch_array($result); $i++) if ($i==0) echo '
      '.PHP_EOL.'

      쇼핑몰 배너

      '.PHP_EOL.'
        '.PHP_EOL; //print_r2($row); // 테두리 있는지 - $bn_border = ($row['bn_border']) ? ' sbn_border' : '';; + $bn_border = ($row['bn_border']) ? ' class="sbn_border"' : '';; // 새창 띄우기인지 $bn_new_win = ($row['bn_new_win']) ? ' target="_blank"' : ''; $bimg = G5_DATA_PATH.'/banner/'.$row['bn_id']; if (file_exists($bimg)) { + $banner = ''; $size = getimagesize($bimg); if($size[2] < 1 || $size[2] > 16) @@ -34,12 +35,12 @@ for ($i=0; $row=sql_fetch_array($result); $i++) echo ''.PHP_EOL; if ($row['bn_url'][0] == '#') - echo ''; + $banner .= ''; else if ($row['bn_url'] && $row['bn_url'] != 'http://') { - echo ''; + $banner .= ''; } - echo ''.$row['bn_alt'].''; - if($row['bn_url']) + echo $banner.''.$row['bn_alt'].''; + if($banner) echo ''.PHP_EOL; echo ''.PHP_EOL; diff --git a/skin/shop/basic/style.css b/skin/shop/basic/style.css index c3025c4f7..edffcfbd1 100644 --- a/skin/shop/basic/style.css +++ b/skin/shop/basic/style.css @@ -516,7 +516,7 @@ #sps dd img {position:relative;top:-2px} .sps_section {float:left;width:630px} -.sps_section p {padding:0;width:100%;height:20px;overflow:hidden} +.sps_section p {padding:0;width:100%} .sps_con_full {padding:0;height:auto !important} .sps_con_btn {margin:5px 0 0;text-align:right} .sps_con_btn button {margin:0;padding:5px;border:0;background:#565e60;color:#fff} @@ -542,7 +542,7 @@ .sqa_section {float:left;width:630px} .sqa_section .sqa_con {padding:10px;background:#f2f5f9;line-height:1.7em} -.sqa_section p {padding:0;width:100%;height:20px;overflow:hidden} +.sqa_section p {padding:0;width:100%} .sqa_con_full {padding:0;height:auto !important} .sqa_con_btn {margin:5px 0 0;text-align:right} .sqa_con_btn button {margin:0;padding:5px;border:0;background:#565e60;color:#fff} \ No newline at end of file