From 1aa77a0adac4e7918fa3a3781bbc145043270dc3 Mon Sep 17 00:00:00 2001 From: Arcturus Date: Fri, 18 Oct 2024 11:18:51 +0900 Subject: [PATCH] init --- day/lunar.txt | 31 ++++ day/solar.txt | 22 +++ list.skin.php | 366 +++++++++++++++++++++++++++++++++++++ moonday.php | 244 +++++++++++++++++++++++++ readme.md | 12 ++ style.css | 135 ++++++++++++++ view.skin.php | 229 +++++++++++++++++++++++ view_comment.skin.php | 321 ++++++++++++++++++++++++++++++++ write.php | 413 ++++++++++++++++++++++++++++++++++++++++++ write.skin.php | 157 ++++++++++++++++ write_update.skin.php | 15 ++ 11 files changed, 1945 insertions(+) create mode 100644 day/lunar.txt create mode 100644 day/solar.txt create mode 100644 list.skin.php create mode 100644 moonday.php create mode 100644 readme.md create mode 100644 style.css create mode 100644 view.skin.php create mode 100644 view_comment.skin.php create mode 100644 write.php create mode 100644 write.skin.php create mode 100644 write_update.skin.php diff --git a/day/lunar.txt b/day/lunar.txt new file mode 100644 index 0000000..550f16c --- /dev/null +++ b/day/lunar.txt @@ -0,0 +1,31 @@ +대보름" ; + +else if ( $myarray[month].'/'.$myarray[day]=="12/30" ) { + $annivmoonday="설연휴" ; $daycolor=red ;} + +else if ( $myarray[month].'/'.$myarray[day]=="1/1" ) { + $annivmoonday="설날" ; + $daycolor=red ;} + +else if ( $myarray[month].'/'.$myarray[day]=="1/2" ) { + $annivmoonday="설연휴" ; $daycolor=red ;} + +else if ( $myarray[month].'/'.$myarray[day]=="4/8" ) { + $annivmoonday="석가탄신일" ; $daycolor=red; } + +else if ( $myarray[month].'/'.$myarray[day]=="5/5" ) + $annivmoonday="단오" ; + +else if ( $myarray[month].'/'.$myarray[day]=="8/14" ) { + $annivmoonday="추석연휴" ; $daycolor=red ;} + +else if ( $myarray[month].'/'.$myarray[day]=="8/15" ) { + $annivmoonday="추석" ; + $daycolor=red ;} + +else if ( $myarray[month].'/'.$myarray[day]=="8/16" ) { + $annivmoonday="추석연휴" ; $daycolor=red ;} + +else $annivmoonday="" ; +?> \ No newline at end of file diff --git a/day/solar.txt b/day/solar.txt new file mode 100644 index 0000000..b96dc02 --- /dev/null +++ b/day/solar.txt @@ -0,0 +1,22 @@ +[양력 기념일] 형식 : 날짜(4자리) | 명칭 | 글자색 (공휴일은 red 로 표기) +0101|신정|red +0130|대체휴일|red +0214|발렌타인데이|blue +0301|삼일절|red +0314|화이트데이|blue +0405|식목일|blue +0501|근로자의날|red +0505|어린이날|red +0508|어버이날|blue +0515|스승의날|blue +0518|518기념일|blue +0606|현충일|red +0625|6.25 한국전쟁|blue +0717|제헌절|blue +0815|광복절|red +1001|국군의날|blue +1003|개천절|red +1006|대체휴일|red +1009|한글날|red +1225|성탄절|red +#빈줄삽입 \ No newline at end of file diff --git a/list.skin.php b/list.skin.php new file mode 100644 index 0000000..bdc1a65 --- /dev/null +++ b/list.skin.php @@ -0,0 +1,366 @@ +', 0); + +$width=$board['bo_table_width'] ? $board['bo_table_width'] : 1000; +if($width>100) $width.="px"; +else $width.="%"; +$gall_w=$board['bo_1'] ? $board['bo_1'] : 400; +$gall_h=$board['bo_2'] ? $board['bo_2'] : 300; +?> + +
+ + +
+
+
+

/

+
+ 관리자 +
+ + + + + + + + + + + + + + '; + $html_day[$start_day].= ''.$start_day.''; + $html_day[$start_day].=''; + } + + // 달력의 틀을 보여주는 부분 + + $temp = 7- (($lastday[$month]+$dayoftheweek)%7); + + if ($temp == 7) $temp = 0; + $lastcount = $lastday[$month]+$dayoftheweek + $temp; + + for ($iz = 1; $iz <= $lastcount; $iz++) { // 42번을 칠하게 된다. + $bgcolor = "days"; // 쭉 흰색으로 칠하고 + if ($b_year==$year && $b_mon==$month && $b_day==$cday) $bgcolor = "today"; // 오늘날짜 표기 + $re=$iz%7; + if ($re == 1) echo (""); // 주당 7개씩 한쎌씩을 쌓는다. + if ($dayoftheweek < $iz && $iz <= $lastday[$month]+$dayoftheweek) { + // 전체 루프안에서 숫자가 들어가는 셀들만 해당됨 + // 즉 11월 달에서 1일부터 30 일까지만 해당 + $daytext = "$cday"; // $cday 는 숫자 예> 11월달은 1~ 30일 까지 + //$daytext 은 셀에 써질 날짜 숫자 넣을 공간 + + // 여기까지 숫자와 들어갈 내용에 대한 변수들의 세팅이 끝나고 + // 이제 여기 부터 직접 셀이 그려지면서 그 안에 내용이 들어 간다. + if($re==0) $col="right"; + else if($re==1) $col="left"; + else $col=""; + $fr_date = $year.sprintf("%02d",$month).sprintf("%02d",$cday); + echo (""); // 한칸을 마무리 + $cday++; // 날짜를 카운팅 + } + // 유효날짜가 아니면 그냥 회색을 칠한다. + else { echo (""); } + if ($re == 0) echo (""); + } // 반복구문이 끝남 + unset($row); + ?> + +
"); + + + // 기념일 파일 내용 비교위한 변수 선언, 월과 일을 두자리 포맷으로 고정 + if (strlen($month) == 1) { + $monthp = "0".$month ; + } else { + $monthp = $month ; + } + if (strlen($cday) == 1) { + $cdayp = "0".$cday ; + } else { + $cdayp = $cday ; + } + $memday = $year.$monthp.$cdayp; + $daycont = "" ; + + // 기념일(양력) 표시 + /* + for($i=0 ; $i < sizeof($dayfile) ; $i++) { // 파일 첫 행부터 끝행까지 루프 + $arrDay = explode("|", $dayfile[$i]); + if($memday == $year.$arrDay[0]) { + $daycont = $arrDay[1]; + $daycontcolor = $arrDay[2]; + if(substr($arrDay[2],0,3)=="red") $daycolor = "red"; // 공휴일은 날짜를 빨간색으로 표시 + } + } + */ + /* + // 석봉운님의 음력날짜 변수선언 + $myarray = soltolun($year,$month,$cday); + if ($myarray[day]==1 || $myarray[day]==11 || $myarray[day]==21) { + $moonday =" (음)$myarray[month].$myarray[day]$myarray[leap]"; + } else { + $moonday=""; + } + + include($file_index."/lunar.txt"); ### 음력 기념일 파일 지정 + + if ($annivmoonday&&$daycont) $blank="
"; // 음력절기와 양력기념일이 동시에 있으면 한칸 띔 + else $blank=""; + */ + if($html_day[$cday]){ + echo $html_day[$cday]; + }else { + if($write_href){ $wlink="get_info('".$fr_date."');"; $cursor="";} + else {$wlink=""; $cursor=" default";} + $html_day[$cday].= ''; + $html_day[$cday].= ''.$daytext.''; + $html_day[$cday].=''; + echo $html_day[$cday]; + } + echo ("
 
+
+ +
+
+ +
+ + +
+
+ +
+
+ +
+
+
+ +
+
+

//

+

+ MD +

+
+
+
"> +
+ + + +
+
+

+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/moonday.php b/moonday.php new file mode 100644 index 0000000..79dc031 --- /dev/null +++ b/moonday.php @@ -0,0 +1,244 @@ +0) { + $yoon = ""; + switch($kk[$i]) { + case 1 : + $mm = 29; + break; + case 2 : + $mm = 30; + break; + case 3 : + $mm = 29; + $ymm = 29; + if($temptd > 29) { + $temptd -= 29; + $yoon = "*"; + } + break; + case 4 : + $mm = 29; + $ymm = 30; + if($temptd > 30) { + $temptd -= 30; + $yoon = "*"; + } + break; + case 5 : + $mm = 30; + $ymm = 29; + if($temptd > 29) { + $temptd -= 29; + $yoon = "*"; + } + break; + case 6 : + $mm = 30; + $ymm = 30; + if($temptd > 30) { + $temptd -= 30; + $yoon = "*"; + } + break; + } + $temptd -=$mm; + + $i++; + if($i%12 == 1) $ly += 1; + } + if($temptd <= 0) { + if($yoon=="*") $temptd += $ymm; + else $temptd +=$mm; + } + $ly += 1840; + $lm = $i % 12; + if($lm==0) $lm=12; + $ld = $temptd; + + /* output */ + $myarray["year"] = $ly; + $myarray["month"] = $lm; + $myarray["day"] = $ld; + $myarray["leap"] = $yoon; + return $myarray; +} + +function luntosol($ly, $lm, $ld) { + global $kk; + global $md; + + $temptd = 0; + $dm = ($ly-1841)*12 + ($lm-1) -1; + for($i=$dm;$i>=0;$i--) { + switch($kk[$i]) { + case 1 : + $temptd += 29; + break; + case 2 : + $temptd += 30; + break; + case 3 : + $temptd += 58; + break; + case 4 : + case 5 : + $temptd += 59; + break; + case 6 : + $temptd += 60; + break; + } + } + $dm = ($ly-1841)*12 + ($lm) -1; + if($leapyes == "yoon") { + switch($kk[$dm]) { + case 1 : + case 2 : break; + case 3 : + case 4 : + $temptd += 29; + break; + case 5 : + case 6 : + $temptd += 30; + break; + } + } + + $temptd += $ld; + $temptd += 22; + $td = $temptd; + $tempsy = 1841; + while(1) { + list($md[1]) = febdays($tempsy); + for($tempsm=0;$tempsm<=11;$tempsm++) { + $temptd -= $md[$tempsm]; + if($temptd <= 0) break; + } + if($temptd <= 0) { + $temptd += $md[$tempsm]; + $tempsd = $temptd; + break; + } + $tempsy++; + } + + $sy = $tempsy; + $sm = $tempsm + 1; + $sd = $tempsd; + + /* output */ + $myyarray["year"] = $sy; + $myyarray["month"] = $sm; + $myyarray["day"] = $sd; + $myyarray["leap"] = $yoob; + return $myyarray; +} + +?> \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..1b515d8 --- /dev/null +++ b/readme.md @@ -0,0 +1,12 @@ +## 게시판 Diary 스킨 + +작성자: 대하 (Extra Shot) +원본주소: https://extrashot.tistory.com/85 + +오류 수정 및 일부 코드에 최적화 작업을 진행했습니다. + +모든 아보카도 버전에 호환됩니다. + +``` +php 최소 버전: 5.3 +``` diff --git a/style.css b/style.css new file mode 100644 index 0000000..04f1a1d --- /dev/null +++ b/style.css @@ -0,0 +1,135 @@ +@charset "utf-8"; + +/* 공통 */ +.board-notice { max-width: 100%; padding: 20px; margin: 0 auto; text-align: center;} + +#bo_frame .pg_wrap {padding:2px;margin-bottom:15px;display:grid; gap:10px; grid-template-columns: 65px auto 65px; } +#bo_frame .pg {border:0 none;} +#bo_frame .pg.control .pg_page{padding:0 2px;} +#bo_frame .pg_wrap .pg_page {border:0 none;background:none;} +#bo_frame .pg_wrap .year {font-size:16px;font-weight:bold;display:inline-block;padding-right:10px;vertical-align: middle;} +#bo_frame .pg_wrap .year::after{display:inline-block;padding-left:15px;content:"||";font-weight:normal;opacity:0.8;} +#bo_frame .pg_wrap .month {padding:0 3px;} +#bo_frame .pg_wrap .month:last-child::after{content:"";} +#bo_frame .pg_wrap .ico{position:relative;display:inline-block;width:20px;height:30px;overflow:hidden;text-indent:100%;white-space:nowrap;} +#bo_frame .pg_wrap .ico:before{position:absolute;left:0;top:0;display:block;width:20px;height:30px;line-height:30px;text-indent:0;text-align:center;} +#bo_frame .pg_wrap .ico.prevyr:before{content:"◀◀";letter-spacing:-5px;text-indent:-2px;} +#bo_frame .pg_wrap .ico.prevmth:before{content:"◀";} +#bo_frame .pg_wrap .ico.nextyr:before{content:"▶▶";letter-spacing:-5px;text-indent:-2px;} +#bo_frame .pg_wrap .ico.nextmth:before{content:"▶";} +/* +#bo_frame .pg_wrap .ico:before{position:absolute;left:0;top:0;display:inline-block;width:24px;height:30px;line-height:30px;text-indent:0;font-family:'icon';} +#bo_frame .pg_wrap .ico.prevyr:before{content:"\ea21";} +#bo_frame .pg_wrap .ico.prevmth:before{content:"\ea23";} +#bo_frame .pg_wrap .ico.nextyr:before{content:"\ea22";} +#bo_frame .pg_wrap .ico.nextmth:before{content:"\ea24";} +*/ + +#bo_list {display:grid; grid-template-columns: 40% auto; gap:15px;} + +/* 캘린더 */ +#diary_calendar {max-height:calc(100vh - 200px); position:sticky;overflow:auto;top:70px;} /* 캘린더 고정 */ +.diary-calendar {height:fit-content;} +.diary-calendar h2{ padding:5px; font-size:18px;font-weight:normal;} +.diary-calendar .controls {position: absolute;right:10px;top:10px;} + +.calendar-list.theme-list {border-collapse:separate;border-spacing: 1px;padding:5px 0 0;} +.calendar-list.theme-list th{ height:26px;padding:0;border:0 none;font-size:11px;border-top:1px solid #aaaaaa22;border-bottom:1px solid #aaaaaa22;background:none;} /* 요일 표시 칸 */ +.calendar-list.theme-list th.sun{color:#c70039;} /* 일요일 */ +.calendar-list.theme-list th.sat{color:#345ad6;} /* 토요일 */ + +.calendar-list.theme-list td {text-align:center; padding:5px; font-size:11px;height:25px;border:0 none;} /* 날짜 표시 칸 */ +.calendar-list.theme-list td.noday {background:#aaaaaa11;} /* 날짜없는 칸 */ + +.calendar-list.theme-list td i {position:relative;display:block; font-style:normal;}/* 날짜(숫자) */ +.calendar-list.theme-list td.today i {font-weight:bold;} + +/* 날짜 */ +.calendar-list.theme-list td .wr-date {position:relative;display:inline-block;padding:0;width:25px;height:25px;line-height:25px;border-radius:100%;overflow:hidden;border:0 none;} +.calendar-list.theme-list td .wr-date.etc {background:none;color:inherit;} +.calendar-list.theme-list td .wr-date.default {cursor:default;} + +/* 게시판 쓰기 */ +#diary_write {text-align:left;z-index:1;} +#diary_write p.ui-btn.point{margin-bottom:10px;line-height:26px;cursor:default;} + +#write_open {display:block;} + +#bo_w {display:none;} +#bo_w.on {display:block;} +#bo_w .wr_content textarea {display:block;height:120px !important;} +#wr_info {position:relative;} +.options {position:relative;} +.options input {width:50%;} +.options .btn_confirm {position:absolute;right:5px;top:0; } +#btn_submit:disabled {filter:saturate(0);cursor:default;} +#file_del {float:left;} + + +/* 게시판 읽기 */ +#bo_v {margin-bottom:20px;padding-bottom:20px} + +#bo_v_table {position:absolute;top:0;right:16px;margin:0;padding:0 5px;height:25px;background:#ff3061;color:#fff;font-weight:bold;line-height:2.2em} +#bo_v_link h2, #bo_v_bot h2, #bo_v_atc_title{position:absolute;font-size:0;line-height:0;overflow:hidden} + +#bo_v_title {padding:10px 0;font-size:1.4em} + +#bo_v_bot {zoom:1} +#bo_v_bot:after {display:block;visibility:hidden;clear:both;content:""} +#bo_v_bot ul {margin:0;padding:0;list-style:none} + +.bo_v_nb {float:left} +.bo_v_nb li {float:left;margin-right:5px} +.bo_v_com {float:right} +.bo_v_com li {float:left;margin-left:5px} + +#bo_v_link {margin:20px 10px ;} + +#bo_v_img {margin:20px 0;} +#bo_v_img:after {display:block;visibility:hidden;clear:both;content:""} + +#bo_v_con {margin-bottom:5px;width:100%;line-height:1.7em;word-break:break-all;overflow:hidden} + +#diary_list .misc {padding-bottom:4px; opacity:0.65;font-size:11px;} +#diary_list .misc span,#diary_list .misc em {display:inline-block; } +#diary_list .misc span {padding-right:10px;} +#diary_list h3 {line-height:25px;padding:0 5px;} +#diary_list hr.line {margin:2px auto 8px;} +#diary_list .diary-text {padding:0 5px;} +#diary_list .btn_confirm a {display: inline-block;padding:0 8px;line-height:25px;font-size:10px;} + +.with-image {position:relative;padding-left:35%;min-height:80px;}/* 사진이 있을 경우 설정 */ +.with-image .ui-thumb { + position:absolute;top:0;left:0;bottom:0;width:35%;padding:5px; + display:flex;justify-content: center;align-items: center; + overflow:hidden; + box-sizing:border-box; +} + +/* 이미지뷰어 */ +#view_img {display:none;position:fixed;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,0.8);overflow:auto;z-index:9999;} +#view_img.on {display:block;text-align: center;} +#img_close {display:block;position:fixed;right: 0;top: 0;bottom: 0;left: 0;overflow:hidden;} +#img_cont p {display:inline-block;vertical-align: middle;font-size:0;height:100vh;} +#img_cont p::before {content:"";display:inline-block;width:0;height:100vh;vertical-align:middle;font-size:0;line-height:0;} +#img_cont p img {max-height:100%;} + +@media all and (min-width:721px){ + #diary_write.scroll-fix {transform: translateY(0) !important;} +} + +@media all and (max-width:720px){ + #bo_list {display:block;} + #file_del {float:none;} + #diary_calendar {max-height:none;position:static;top:auto;overflow:hidden;} + #diary_write.scroll-fix{position:absolute;width:calc(100% - 20px);top:0;} +} + +@media all and (max-width:480px) { + #bo_frame .pg_wrap {grid-template-columns: 30px auto 30px;} + #bo_frame .pg.control .pg_page {padding:0;} + #bo_frame .pg.control {display:flex;justify-content: space-between;flex-direction: column;} + #bo_frame .pg.control:last-of-type {flex-direction: column-reverse;} + #bo_frame .pg_wrap .year {display:block; padding:10px;} + #bo_frame .pg_wrap .year::after {display:none;} +} \ No newline at end of file diff --git a/view.skin.php b/view.skin.php new file mode 100644 index 0000000..e564d30 --- /dev/null +++ b/view.skin.php @@ -0,0 +1,229 @@ +', 0); +?> + + + + +
+
+

+ +

+ + + + + + +
+

첨부파일

+ +
+ + + + + + + + + + +
+

본문

+ + \n"; + + for ($i=0; $i<=count($view['file']); $i++) { + if ($view['file'][$i]['view']) { + //echo $view['file'][$i]['view']; + echo get_view_thumbnail($view['file'][$i]['view']); + } + } + + echo "\n"; + } + ?> + + +
+ + + +
+ + + + + +
+
+ + + + + + + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/view_comment.skin.php b/view_comment.skin.php new file mode 100644 index 0000000..224545e --- /dev/null +++ b/view_comment.skin.php @@ -0,0 +1,321 @@ + + + + + +
+ \]/i", "", $comment); + $cmt_sv = $cmt_amt - $i + 1; // 댓글 헤더 z-index 재설정 ie8 이하 사이드뷰 겹침 문제 해결 + ?> + +
style="margin-left:px;border-top-color:#e0e0e0"> +
+

님의 댓글

+ + 댓글의 댓글 + + + () + + 작성일 + + +
+ + +

+ 비밀글 + +

+ + + + + " id="secret_comment_"> + + + + + +
+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/write.php b/write.php new file mode 100644 index 0000000..241f2b8 --- /dev/null +++ b/write.php @@ -0,0 +1,413 @@ + 0) ? $member['mb_point'] : 0; + if ($tmp_point + $board['bo_write_point'] < 0 && !$is_admin) { + alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 글쓰기('.number_format($board['bo_write_point']).')가 불가합니다.\\n\\n포인트를 적립하신 후 다시 글쓰기 해 주십시오.'); + } + } + + $title_msg = '글쓰기'; +} else if ($w == 'u') { + // 김선용 1.00 : 글쓰기 권한과 수정은 별도로 처리되어야 함 + //if ($member['mb_level'] < $board['bo_write_level']) { + if($member['mb_id'] && $write['mb_id'] == $member['mb_id']) { + ; + } else if ($member['mb_level'] < $board['bo_write_level']) { + if ($member['mb_id']) { + alert('글을 수정할 권한이 없습니다.'); + } else { + alert('글을 수정할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?'.$qstr.'&url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table)); + } + } + + $len = strlen($write['wr_reply']); + if ($len < 0) $len = 0; + $reply = substr($write['wr_reply'], 0, $len); + + // 원글만 구한다. + $sql = " select count(*) as cnt from {$write_table} + where wr_reply like '{$reply}%' + and wr_id <> '{$write['wr_id']}' + and wr_num = '{$write['wr_num']}' + and wr_is_comment = 0 "; + $row = sql_fetch($sql); + if ($row['cnt'] && !$is_admin) + alert('이 글과 관련된 답변글이 존재하므로 수정 할 수 없습니다.\\n\\n답변글이 있는 원글은 수정할 수 없습니다.'); + + // 코멘트 달린 원글의 수정 여부 + $sql = " select count(*) as cnt from {$write_table} + where wr_parent = '{$wr_id}' + and mb_id <> '{$member['mb_id']}' + and wr_is_comment = 1 "; + $row = sql_fetch($sql); + if ($board['bo_count_modify'] && $row['cnt'] >= $board['bo_count_modify'] && !$is_admin) + alert('이 글과 관련된 댓글이 존재하므로 수정 할 수 없습니다.\\n\\n댓글이 '.$board['bo_count_modify'].'건 이상 달린 원글은 수정할 수 없습니다.'); + + $title_msg = '글수정'; +} else if ($w == 'r') { + if ($member['mb_level'] < $board['bo_reply_level']) { + if ($member['mb_id']) + alert('글을 답변할 권한이 없습니다.'); + else + alert('답변글을 작성할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', './login.php?'.$qstr.'&url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table)); + } + + $tmp_point = isset($member['mb_point']) ? $member['mb_point'] : 0; + if ($tmp_point + $board['bo_write_point'] < 0 && !$is_admin) + alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 글답변('.number_format($board['bo_comment_point']).')가 불가합니다.\\n\\n포인트를 적립하신 후 다시 글답변 해 주십시오.'); + + //if (preg_match("/[^0-9]{0,1}{$wr_id}[\r]{0,1}/",$board['bo_notice'])) + if (in_array((int)$wr_id, $notice_array)) + alert('공지에는 답변 할 수 없습니다.'); + + //---------- + // 4.06.13 : 비밀글을 타인이 열람할 수 있는 오류 수정 (헐랭이, 플록님께서 알려주셨습니다.) + // 코멘트에는 원글의 답변이 불가하므로 + if ($write['wr_is_comment']) + alert('정상적인 접근이 아닙니다.'); + + // 비밀글인지를 검사 + if (strstr($write['wr_option'], 'secret')) { + if ($write['mb_id']) { + // 회원의 경우는 해당 글쓴 회원 및 관리자 + if (!($write['mb_id'] == $member['mb_id'] || $is_admin)) + alert('비밀글에는 자신 또는 관리자만 답변이 가능합니다.'); + } else { + // 비회원의 경우는 비밀글에 답변이 불가함 + if (!$is_admin) + alert('비회원의 비밀글에는 답변이 불가합니다.'); + } + } + //---------- + + // 게시글 배열 참조 + $reply_array = &$write; + + // 최대 답변은 테이블에 잡아놓은 wr_reply 사이즈만큼만 가능합니다. + if (strlen($reply_array['wr_reply']) == 10) + alert('더 이상 답변하실 수 없습니다.\\n\\n답변은 10단계 까지만 가능합니다.'); + + $reply_len = strlen($reply_array['wr_reply']) + 1; + if ($board['bo_reply_order']) { + $begin_reply_char = 'A'; + $end_reply_char = 'Z'; + $reply_number = +1; + $sql = " select MAX(SUBSTRING(wr_reply, {$reply_len}, 1)) as reply from {$write_table} where wr_num = '{$reply_array['wr_num']}' and SUBSTRING(wr_reply, {$reply_len}, 1) <> '' "; + } else { + $begin_reply_char = 'Z'; + $end_reply_char = 'A'; + $reply_number = -1; + $sql = " select MIN(SUBSTRING(wr_reply, {$reply_len}, 1)) as reply from {$write_table} where wr_num = '{$reply_array['wr_num']}' and SUBSTRING(wr_reply, {$reply_len}, 1) <> '' "; + } + if ($reply_array['wr_reply']) $sql .= " and wr_reply like '{$reply_array['wr_reply']}%' "; + $row = sql_fetch($sql); + + if (!$row['reply']) + $reply_char = $begin_reply_char; + else if ($row['reply'] == $end_reply_char) // A~Z은 26 입니다. + alert('더 이상 답변하실 수 없습니다.\\n\\n답변은 26개 까지만 가능합니다.'); + else + $reply_char = chr(ord($row['reply']) + $reply_number); + + $reply = $reply_array['wr_reply'] . $reply_char; + + $title_msg = '글답변'; + + $write['wr_subject'] = 'Re: '.$write['wr_subject']; +} + +// 그룹접근 가능 +if (!empty($group['gr_use_access'])) { + if ($is_guest) { + alert("접근 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.", 'login.php?'.$qstr.'&url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table)); + } + + if ($is_admin == 'super' || $group['gr_admin'] == $member['mb_id'] || $board['bo_admin'] == $member['mb_id']) { + ; // 통과 + } else { + // 그룹접근 + $sql = " select gr_id from {$g5['group_member_table']} where gr_id = '{$board['gr_id']}' and mb_id = '{$member['mb_id']}' "; + $row = sql_fetch($sql); + if (!$row['gr_id']) + alert('접근 권한이 없으므로 글쓰기가 불가합니다.\\n\\n궁금하신 사항은 관리자에게 문의 바랍니다.'); + } +} + +// 본인확인을 사용한다면 +if ($config['cf_cert_use'] && !$is_admin) { + // 인증된 회원만 가능 + if ($board['bo_use_cert'] != '' && $is_guest) { + alert('이 게시판은 본인확인 하신 회원님만 글쓰기가 가능합니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.', 'login.php?'.$qstr.'&url='.urlencode($_SERVER['SCRIPT_NAME'].'?bo_table='.$bo_table)); + } + + if ($board['bo_use_cert'] == 'cert' && !$member['mb_certify']) { + alert('이 게시판은 본인확인 하신 회원님만 글쓰기가 가능합니다.\\n\\n회원정보 수정에서 본인확인을 해주시기 바랍니다.', G5_URL); + } + + if ($board['bo_use_cert'] == 'adult' && !$member['mb_adult']) { + alert('이 게시판은 본인확인으로 성인인증 된 회원님만 글쓰기가 가능합니다.\\n\\n성인인데 글쓰기가 안된다면 회원정보 수정에서 본인확인을 다시 해주시기 바랍니다.', G5_URL); + } + + if ($board['bo_use_cert'] == 'hp-cert' && $member['mb_certify'] != 'hp') { + alert('이 게시판은 휴대폰 본인확인 하신 회원님만 글읽기가 가능합니다.\\n\\n회원정보 수정에서 휴대폰 본인확인을 해주시기 바랍니다.', G5_URL); + } + + if ($board['bo_use_cert'] == 'hp-adult' && (!$member['mb_adult'] || $member['mb_certify'] != 'hp')) { + alert('이 게시판은 휴대폰 본인확인으로 성인인증 된 회원님만 글읽기가 가능합니다.\\n\\n현재 성인인데 글읽기가 안된다면 회원정보 수정에서 휴대폰 본인확인을 다시 해주시기 바랍니다.', G5_URL); + } +} + +// 글자수 제한 설정값 +if ($is_admin || $board['bo_use_dhtml_editor']) +{ + $write_min = $write_max = 0; +} +else +{ + $write_min = (int)$board['bo_write_min']; + $write_max = (int)$board['bo_write_max']; +} + +$g5['title'] = ((G5_IS_MOBILE && $board['bo_mobile_subject']) ? $board['bo_mobile_subject'] : $board['bo_subject']).' '.$title_msg; + +$is_notice = false; +$notice_checked = ''; +if ($is_admin && $w != 'r') { + $is_notice = true; + + if ($w == 'u') { + // 답변 수정시 공지 체크 없음 + if ($write['wr_reply']) { + $is_notice = false; + } else { + if (in_array((int)$wr_id, $notice_array)) { + $notice_checked = 'checked'; + } + } + } +} + +$is_html = false; +if ($member['mb_level'] >= $board['bo_html_level']) + $is_html = true; + +$is_secret = $board['bo_use_secret']; + +$is_mail = false; +if ($config['cf_email_use'] && $board['bo_use_email']) + $is_mail = true; + +$recv_email_checked = ''; +if ($w == '' || strstr($write['wr_option'], 'mail')) + $recv_email_checked = 'checked'; + +$is_name = false; +$is_password = false; +$is_email = false; +$is_homepage = false; +if ($is_guest || ($is_admin && $w == 'u' && $member['mb_id'] != $write['mb_id'])) { + $is_name = true; + $is_password = true; + $is_email = true; + $is_homepage = true; +} + +$is_category = false; +$category_option = ''; +if ($board['bo_use_category']) { + $ca_name = ""; + if (isset($write['ca_name'])) + $ca_name = $write['ca_name']; + $category_option = get_category_option($bo_table, $ca_name); + $is_category = true; +} + +$is_link = false; +if ($member['mb_level'] >= $board['bo_link_level']) { + $is_link = true; +} + +$is_file = false; +if ($member['mb_level'] >= $board['bo_upload_level']) { + $is_file = true; +} + +$is_file_content = false; +if ($board['bo_use_file_content']) { + $is_file_content = true; +} + +$file_count = (int)$board['bo_upload_count']; + +$name = ""; +$email = ""; +$homepage = ""; +if ($w == "" || $w == "r") { + if ($is_member) { + if (isset($write['wr_name'])) { + $name = get_text(cut_str(stripslashes($write['wr_name']),20)); + } + $email = get_email_address($member['mb_email']); + $homepage = get_text(stripslashes($member['mb_homepage'])); + } +} + +$html_checked = ""; +$html_value = ""; +$secret_checked = ""; + +if ($w == '') { + $password_required = 'required'; +} else if ($w == 'u') { + $password_required = ''; + + if (!$is_admin) { + if (!($is_member && $member['mb_id'] == $write['mb_id'])) { + if (!check_password($wr_password, $write['wr_password'])) { + alert('비밀번호가 틀립니다.'); + } + } + } + + $name = get_text(cut_str(stripslashes($write['wr_name']),20)); + $email = get_email_address($write['wr_email']); + $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]); + $link[$i] = $write['wr_link'.$i]; + } + + if (strstr($write['wr_option'], 'html1')) { + $html_checked = 'checked'; + $html_value = 'html1'; + } else if (strstr($write['wr_option'], 'html2')) { + $html_checked = 'checked'; + $html_value = 'html2'; + } + + if (strstr($write['wr_option'], 'secret')) { + $secret_checked = 'checked'; + } + + $file = get_file($bo_table, $wr_id); + if($file_count < $file['count']) + $file_count = $file['count']; +} else if ($w == 'r') { + if (strstr($write['wr_option'], 'secret')) { + $is_secret = true; + $secret_checked = 'checked'; + } + + $password_required = "required"; + + for ($i=1; $i<=G5_LINK_COUNT; $i++) { + $write['wr_link'.$i] = get_text($write['wr_link'.$i]); + } +} + +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)); +} + +$content = ''; +if ($w == '') { + $content = $board['bo_insert_content']; +} else if ($w == 'r') { + if (!strstr($write['wr_option'], 'html')) { + $content = "\n\n\n > " + ."\n > " + ."\n > ".str_replace("\n", "\n> ", get_text($write['wr_content'], 0)) + ."\n > " + ."\n > "; + + } +} else { + $content = get_text($write['wr_content'], 0); +} + +$upload_max_filesize = number_format($board['bo_upload_size']) . ' 바이트'; + +$width = $board['bo_table_width']; +if ($width <= 100) + $width .= '%'; +else + $width .= 'px'; + + +$is_dhtml_editor = false; +$is_dhtml_editor_use = false; +$editor_content_js = ''; +if(!is_mobile() || defined('G5_IS_MOBILE_DHTML_USE') && G5_IS_MOBILE_DHTML_USE) + $is_dhtml_editor_use = true; + +// 모바일에서는 G5_IS_MOBILE_DHTML_USE 설정에 따라 DHTML 에디터 적용 +if ($config['cf_editor'] && $is_dhtml_editor_use && $board['bo_use_dhtml_editor'] && $member['mb_level'] >= $board['bo_html_level']) { + $is_dhtml_editor = true; + + if(is_file(G5_EDITOR_PATH.'/'.$config['cf_editor'].'/autosave.editor.js')) + $editor_content_js = ''.PHP_EOL; +} +$editor_html = editor_html('wr_content', $content, $is_dhtml_editor); +$editor_js = ''; +$editor_js .= get_editor_js('wr_content', $is_dhtml_editor); +$editor_js .= chk_editor_js('wr_content', $is_dhtml_editor); + +// 임시 저장된 글 수 +$autosave_count = autosave_count($member['mb_id']); + +$action_url = https_url(G5_BBS_DIR)."/write_update.php"; + +echo ''; +include_once ($board_skin_path.'/write.skin.php'); + +?> \ No newline at end of file diff --git a/write.skin.php b/write.skin.php new file mode 100644 index 0000000..ac9c79c --- /dev/null +++ b/write.skin.php @@ -0,0 +1,157 @@ +', 0); +?> +
+
+ +
+ + + + + + + + + + + + +
+
+ +

+ + +

+ + +

+ + class="frm_input " maxlength="20"> +

+ + +

+ +

+ + +

+ +

+ +

+ + +

+
+
+ ">"> +
+ + +
+ + + +
+
+
+ +
+ + + \ No newline at end of file diff --git a/write_update.skin.php b/write_update.skin.php new file mode 100644 index 0000000..ca2cdd9 --- /dev/null +++ b/write_update.skin.php @@ -0,0 +1,15 @@ +